#include <stdio.h>
#include <stdlib.h>
#include "../../dprint.h"
#include "../../pt.h"
#include "../../socket_info.h"
#include "callid.h"

Go to the source code of this file.
Defines | |
| #define | CALLID_NR_LEN 20 |
| #define | CALLID_SUFFIX_LEN |
| Call-ID has the following form: <callid_nr>-<pid>@<ip> callid_nr is initialized as a random number and continually increases; -<pid>@<ip> is kept in callid_suffix. | |
| #define | CID_SEP '-' |
Functions | |
| int | child_init_callid (int rank) |
| Child initialization -- generates suffix. | |
| void | generate_callid (str *callid) |
| Get a unique Call-ID. | |
| static int | inc_hexchar (char *_c) |
| Increment a character in hex, return carry flag. | |
| int | init_callid (void) |
| Initialize the Call-ID generator -- generates random prefix. | |
Variables | |
| static char | callid_buf [CALLID_NR_LEN+CALLID_SUFFIX_LEN] |
| static unsigned long | callid_nr |
| str | callid_prefix |
| str | callid_suffix |
Definition in file callid.c.
| #define CALLID_NR_LEN 20 |
| #define CALLID_SUFFIX_LEN |
Call-ID has the following form: <callid_nr>-<pid>@<ip> callid_nr is initialized as a random number and continually increases; -<pid>@<ip> is kept in callid_suffix.
Definition at line 51 of file callid.c.
Referenced by child_init_callid().
| #define CID_SEP '-' |
the character which separates random from constant part
Definition at line 59 of file callid.c.
Referenced by child_init_callid().
| int child_init_callid | ( | int | rank | ) |
Child initialization -- generates suffix.
Definition at line 111 of file callid.c.
References socket_info::address_str, bind_address, callid_buf, CALLID_SUFFIX_LEN, CID_SEP, get_first_socket(), _str::len, LM_CRIT, LM_DBG, LM_ERR, my_pid(), _str::s, and snprintf.
Referenced by child_init().
| void generate_callid | ( | str * | callid | ) |
Get a unique Call-ID.
Definition at line 162 of file callid.c.
References inc_hexchar(), _str::len, and _str::s.
Referenced by mi_tm_uac_dlg(), req_outside(), and request().
| static int inc_hexchar | ( | char * | _c | ) | [inline, static] |
Increment a character in hex, return carry flag.
Definition at line 142 of file callid.c.
Referenced by generate_callid().
| int init_callid | ( | void | ) |
Initialize the Call-ID generator -- generates random prefix.
Definition at line 71 of file callid.c.
References callid_buf, callid_nr, CALLID_NR_LEN, _str::len, LM_CRIT, LM_DBG, LM_ERR, _str::s, and snprintf.
Referenced by mod_init().
char callid_buf[CALLID_NR_LEN+CALLID_SUFFIX_LEN] [static] |
unsigned long callid_nr [static] |
1.5.6