ring.h File Reference

Module with several utiltity functions related to SIP messages handling

More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define HASHTABLEBITS   13
#define HASHTABLEMASK   (HASHTABLESIZE - 1)
#define HASHTABLESIZE   (((unsigned int)1) << HASHTABLEBITS)
#define MAXCALLIDLEN   255

Functions

void ring_destroy_hashtable (void)
 Destroy the ring hashtable.
int ring_filter (struct sip_msg *msg, void *bar)
 Callback function that does the work inside the server.
int ring_fixup (void **param, int param_no)
 Fixup function for the ring_insert_callid function.
void ring_init_hashtable (void)
 Initialize the ring hashtable in shared memory.
int ring_insert_callid (struct sip_msg *msg, char *unused1, char *unused2)
 Inserts callid of message into hashtable.

Variables

gen_lock_t * ring_lock
unsigned int ring_timeout


Detailed Description

Module with several utiltity functions related to SIP messages handling

Definition in file ring.h.


Define Documentation

#define HASHTABLEBITS   13

Definition at line 34 of file ring.h.

#define HASHTABLEMASK   (HASHTABLESIZE - 1)

Definition at line 36 of file ring.h.

Referenced by contains(), and insert().

#define HASHTABLESIZE   (((unsigned int)1) << HASHTABLEBITS)

Definition at line 35 of file ring.h.

Referenced by ring_destroy_hashtable(), and ring_init_hashtable().

#define MAXCALLIDLEN   255

Definition at line 37 of file ring.h.

Referenced by insert().


Function Documentation

void ring_destroy_hashtable ( void   ) 

Destroy the ring hashtable.

Definition at line 127 of file ring.c.

References hashtable, HASHTABLESIZE, hashtable_entry_t::head, ring_record_t::next, NULL, and shm_free.

Referenced by mod_destroy().

int ring_filter ( struct sip_msg msg,
void *  bar 
)

Callback function that does the work inside the server.

Parameters:
msg SIP message
bar unused
Returns:
1 on success, -1 on failure

Definition at line 323 of file ring.c.

References hdr_field::body, sip_msg::callid, contains(), conv183(), sip_msg::first_line, HDR_CALLID_F, _str::len, LM_DBG, LM_ERR, parse_headers(), msg_start::reply, ring_lock, _str::s, SIP_REPLY, msg_start::type, and msg_start::u.

Referenced by mod_init().

int ring_fixup ( void **  param,
int  param_no 
)

Fixup function for the ring_insert_callid function.

Parameters:
param unused
param_no unused
Returns:
0

Definition at line 356 of file ring.c.

References LM_ERR, and ring_timeout.

void ring_init_hashtable ( void   ) 

Initialize the ring hashtable in shared memory.

Definition at line 111 of file ring.c.

References hashtable, HASHTABLESIZE, NULL, and shm_malloc().

Referenced by mod_init().

int ring_insert_callid ( struct sip_msg msg,
char *  unused1,
char *  unused2 
)

Inserts callid of message into hashtable.

Inserts callid of message into hashtable. Any 183 messages with this callid that occur in the next ring_timeout seconds, will be converted to 180.

Parameters:
msg SIP message
unused1 unused
unused2 unused
Returns:
1 on success, -1 otherwise

Definition at line 90 of file ring.c.

References hdr_field::body, sip_msg::callid, contains(), HDR_CALLID_F, insert(), LM_ERR, parse_headers(), and ring_lock.


Variable Documentation

gen_lock_t* ring_lock

Definition at line 57 of file siputils.c.

Referenced by mod_destroy(), mod_init(), ring_filter(), and ring_insert_callid().

unsigned int ring_timeout

Definition at line 58 of file siputils.c.

Referenced by mod_init(), remove_timeout(), and ring_fixup().


Generated on Thu May 24 10:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6