t_funcs.h File Reference

TM :: Transaction maintenance functions. More...

#include <errno.h>
#include <netdb.h>
#include "../../mem/shm_mem.h"
#include "../../parser/msg_parser.h"
#include "../../globals.h"
#include "../../udp_server.h"
#include "../../msg_translator.h"
#include "../../timer.h"
#include "../../forward.h"
#include "../../mem/mem.h"
#include "../../md5utils.h"
#include "../../ip_addr.h"
#include "../../parser/parse_uri.h"
#include "../../usr_avp.h"
#include "config.h"
#include "lock.h"
#include "timer.h"
#include "sip_msg.h"
#include "h_table.h"
#include "ut.h"

Include dependency graph for t_funcs.h:

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

Go to the source code of this file.

Defines

#define INIT_REF_UNSAFE(_T_cell)   ((_T_cell)->ref_count=1)
#define IS_REFFED_UNSAFE(_T_cell)   ((_T_cell)->ref_count!=0)
#define REF_UNSAFE(_T_cell)
#define SEND_BUFFER(_rb)   SEND_PR_BUFFER( (_rb) , (_rb)->buffer.s , (_rb)->buffer.len )
#define SEND_PR_BUFFER(_rb, _bf, _le)   send_pr_buffer( (_rb), (_bf), (_le))
#define TM_T_REPLY_no100_FLAG   (1<<1)
#define TM_T_REPLY_nodnsfo_FLAG   (1<<3)
#define TM_T_REPLY_noerr_FLAG   (1<<2)
#define TM_T_REPLY_repl_FLAG   (1<<0)
#define UNREF(_T_cell)
#define UNREF_UNSAFE(_T_cell)

Functions

static void _set_fr_retr (struct retr_buf *rb, int retr)
void cleanup_localcancel_timers (struct cell *t)
static void force_retr (struct retr_buf *rb)
int fr_avp2timer (utime_t *timer)
 Get the FR_{INV}_TIMER from corresponding AVP.
int fr_inv_avp2timer (utime_t *timer)
int get_ip_and_port_from_uri (str *uri, unsigned int *param_ip, unsigned int *param_port)
int init_avp_params (char *fr_timer_param, char *fr_inv_timer_param, char *contacts_avp_param)
 Parse and fixup the fr_*_timer AVP specs.
void put_on_wait (struct cell *Trans)
int send_pr_buffer (struct retr_buf *rb, void *buf, int len)
static void start_retr (struct retr_buf *rb)
int t_add_transaction (struct sip_msg *p_msg)
int t_relay_to (struct sip_msg *p_msg, struct proxy_l *proxy, int replicate)
int t_release_transaction (struct cell *trans)
void tm_shutdown (void)

Variables

int_str contacts_avp
int contacts_avp_type
int_str fr_inv_timer_avp
int fr_inv_timer_avp_type
 FR_INV_TIMER AVP and SERIAL AVP variables needed by next_branches() function.
int noisy_ctimer


Detailed Description

TM :: Transaction maintenance functions.

Definition in file t_funcs.h.


Define Documentation

#define INIT_REF_UNSAFE ( _T_cell   )     ((_T_cell)->ref_count=1)

Definition at line 117 of file t_funcs.h.

Referenced by new_t().

#define IS_REFFED_UNSAFE ( _T_cell   )     ((_T_cell)->ref_count!=0)

Definition at line 118 of file t_funcs.h.

Referenced by delete_cell().

#define REF_UNSAFE ( _T_cell   ) 

Value:

do {\
   ((_T_cell)->ref_count++);\
   LM_DBG("REF_UNSAFE: after is %d\n",(_T_cell)->ref_count);\
   }while(0)

Definition at line 113 of file t_funcs.h.

Referenced by t_lookup_callid(), t_lookup_ident(), t_lookup_request(), t_lookupOriginalT(), and t_reply_matching().

#define SEND_BUFFER ( _rb   )     SEND_PR_BUFFER( (_rb) , (_rb)->buffer.s , (_rb)->buffer.len )

#define SEND_PR_BUFFER ( _rb,
_bf,
_le   )     send_pr_buffer( (_rb), (_bf), (_le))

Definition at line 97 of file t_funcs.h.

Referenced by _reply_light(), relay_reply(), send_ack(), and t_retransmit_reply().

#define TM_T_REPLY_no100_FLAG   (1<<1)

Definition at line 77 of file t_funcs.h.

Referenced by t_relay_to().

#define TM_T_REPLY_nodnsfo_FLAG   (1<<3)

Definition at line 79 of file t_funcs.h.

Referenced by t_relay_to(), and w_t_relay().

#define TM_T_REPLY_noerr_FLAG   (1<<2)

Definition at line 78 of file t_funcs.h.

Referenced by t_relay_to().

#define TM_T_REPLY_repl_FLAG   (1<<0)

Definition at line 76 of file t_funcs.h.

Referenced by t_relay_to(), and t_replicate().

#define UNREF ( _T_cell   ) 

Value:

do{ \
   LOCK_HASH( (_T_cell)->hash_index ); \
   UNREF_UNSAFE(_T_cell); \
   UNLOCK_HASH( (_T_cell)->hash_index ); }while(0)

Definition at line 109 of file t_funcs.h.

Referenced by mi_tm_cancel(), t_check_trans(), t_reply_with_body(), t_unref(), and t_unref_cell().

#define UNREF_UNSAFE ( _T_cell   ) 

Value:

do { \
   ((_T_cell)->ref_count--);\
   LM_DBG("UNREF_UNSAFE: after is %d\n",(_T_cell)->ref_count);\
   }while(0)

Definition at line 105 of file t_funcs.h.


Function Documentation

static void _set_fr_retr ( struct retr_buf rb,
int  retr 
) [inline, static]

void cleanup_localcancel_timers ( struct cell t  ) 

static void force_retr ( struct retr_buf rb  )  [inline, static]

Definition at line 165 of file t_funcs.h.

References _set_fr_retr().

Referenced by set_final_timer().

int fr_avp2timer ( utime_t timer  ) 

Get the FR_{INV}_TIMER from corresponding AVP.

Definition at line 388 of file t_funcs.c.

References avp2timer(), fr_timer_avp_type, and int_str::n.

Referenced by _set_fr_retr().

int fr_inv_avp2timer ( utime_t timer  ) 

Definition at line 397 of file t_funcs.c.

References avp2timer(), fr_inv_timer_avp_type, and int_str::n.

Referenced by reply_received().

int get_ip_and_port_from_uri ( str uri,
unsigned int *  param_ip,
unsigned int *  param_port 
)

int init_avp_params ( char *  fr_timer_param,
char *  fr_inv_timer_param,
char *  contacts_avp_param 
)

Parse and fixup the fr_*_timer AVP specs.

Definition at line 292 of file t_funcs.c.

References contacts_avp_type, fr_inv_timer_avp_type, fr_timer_avp_type, _str::len, LM_ERR, int_str::n, pv_get_avp_name(), pv_parse_spec(), _pv_spec::pvp, PVT_AVP, _str::s, s, and _pv_spec::type.

Referenced by mod_init().

void put_on_wait ( struct cell Trans  ) 

we put the transaction on wait timer; we do it only once in transaction's timelife because putting it multiple-times might result in a second instance of a wait timer to be set after the first one fired; on expiration of the second instance, the transaction would be re-deleted

			PROCESS1		PROCESS2		TIMER PROCESS
		0. 200/INVITE rx;
		   put_on_wait
		1.					200/INVITE rx;
		2.									WAIT fires; transaction
											about to be deleted
		3.					avoid putting
							on WAIT again
		4.									WAIT timer executed,
											transaction deleted

Definition at line 140 of file t_funcs.c.

References LM_DBG, set_1timer(), cell::wait_tl, and WT_TIMER_LIST.

Referenced by _reply_light(), fake_reply(), final_response_handler(), local_reply(), reply_received(), set_final_timer(), t_newtran(), and t_release_transaction().

int send_pr_buffer ( struct retr_buf rb,
void *  buf,
int  len 
)

static void start_retr ( struct retr_buf rb  )  [inline, static]

int t_add_transaction ( struct sip_msg p_msg  ) 

int t_relay_to ( struct sip_msg p_msg,
struct proxy_l proxy,
int  replicate 
)

int t_release_transaction ( struct cell trans  ) 

void tm_shutdown ( void   ) 


Variable Documentation

Definition at line 72 of file t_funcs.c.

Referenced by t_load_contacts(), and t_next_contacts().

Definition at line 71 of file t_funcs.c.

Referenced by init_avp_params(), t_load_contacts(), and t_next_contacts().

Definition at line 70 of file t_funcs.c.

Referenced by t_next_contacts().

FR_INV_TIMER AVP and SERIAL AVP variables needed by next_branches() function.

Definition at line 69 of file t_funcs.c.

Referenced by fr_inv_avp2timer(), init_avp_params(), and t_next_contacts().


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