t_hooks.h File Reference

TM :: Callback hooks. More...

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

Go to the source code of this file.

Data Structures

struct  tm_callback
struct  tmcb_head_list
struct  tmcb_params
 pack structure with all params passed to callback function More...

Defines

#define has_reqin_tmcbs()   ( req_in_tmcb_hl->first!=0 )
#define has_tran_tmcbs(_T_, _types_)   ( ((_T_)->tmcb_hl.reg_types)&(_types_) )
#define TMCB_E2EACK_IN   (1<<2)
#define TMCB_LOCAL_COMPLETED   (1<<9)
#define TMCB_LOCAL_RESPONSE_OUT   (1<<10)
#define TMCB_MAX   ((1<<13)-1)
#define TMCB_ON_FAILURE   (1<<6)
#define TMCB_ON_FAILURE_RO   (1<<5)
#define TMCB_REQUEST_BUILT   (1<<11)
#define TMCB_REQUEST_FWDED   (1<<3)
#define TMCB_REQUEST_IN   (1<<0)
#define TMCB_RESPONSE_FWDED   (1<<4)
#define TMCB_RESPONSE_IN   (1<<1)
#define TMCB_RESPONSE_OUT   (1<<8)
#define TMCB_RESPONSE_PRE_OUT   (1<<7)
#define TMCB_TRANS_DELETED   (1<<12)

Typedefs

typedef int(* register_tmcb_f )(struct sip_msg *p_msg, struct cell *t, int cb_types, transaction_cb f, void *param, release_tmcb_param func)
 register callback function prototype
typedef void( release_tmcb_param )(void *param)
 function to release the callback param
typedef void( transaction_cb )(struct cell *t, int type, struct tmcb_params *)
 callback function prototype

Functions

void destroy_tmcb_lists (void)
void empty_tmcb_list (struct tmcb_head_list *head)
int init_tmcb_lists (void)
int insert_tmcb (struct tmcb_head_list *cb_list, int types, transaction_cb f, void *param, release_tmcb_param release_func)
 Inserts a callback into the a callback list.
int register_tmcb (struct sip_msg *p_msg, struct cell *t, int types, transaction_cb f, void *param, release_tmcb_param release_func)
 Register a callback function for several types of events.
void run_reqin_callbacks (struct cell *trans, struct sip_msg *req, int code)
 run all REQUEST_IN callbacks
void run_trans_callbacks (int type, struct cell *trans, struct sip_msg *req, struct sip_msg *rpl, int code)
 Run all transaction callbacks for an event type.
void set_extra_tmcb_params (void *extra1, void *extra2)
 Set extra parameter for tm callback.

Variables

struct tmcb_head_listreq_in_tmcb_hl
struct tmcb_head_list tmcb_pending_hl
unsigned int tmcb_pending_id


Detailed Description

TM :: Callback hooks.

Definition in file t_hooks.h.


Define Documentation

 
#define has_reqin_tmcbs (  )     ( req_in_tmcb_hl->first!=0 )

Definition at line 213 of file t_hooks.h.

Referenced by build_cell().

#define has_tran_tmcbs ( _T_,
_types_   )     ( ((_T_)->tmcb_hl.reg_types)&(_types_) )

#define TMCB_E2EACK_IN   (1<<2)

#define TMCB_LOCAL_COMPLETED   (1<<9)

#define TMCB_LOCAL_RESPONSE_OUT   (1<<10)

Definition at line 58 of file t_hooks.h.

Referenced by local_reply(), and t_uac().

#define TMCB_MAX   ((1<<13)-1)

Definition at line 61 of file t_hooks.h.

Referenced by register_tmcb().

#define TMCB_ON_FAILURE   (1<<6)

#define TMCB_ON_FAILURE_RO   (1<<5)

Definition at line 53 of file t_hooks.h.

Referenced by ospOnReq(), and ospTmcbFunc().

#define TMCB_REQUEST_BUILT   (1<<11)

Definition at line 59 of file t_hooks.h.

Referenced by cancel_branch(), t_forward_nonack(), and trace_onreq_in().

#define TMCB_REQUEST_FWDED   (1<<3)

Definition at line 51 of file t_hooks.h.

Referenced by ospTmcbFunc(), and pre_print_uac_request().

#define TMCB_REQUEST_IN   (1<<0)

Definition at line 48 of file t_hooks.h.

Referenced by mod_init(), ospInitTm(), and register_tmcb().

#define TMCB_RESPONSE_FWDED   (1<<4)

#define TMCB_RESPONSE_IN   (1<<1)

#define TMCB_RESPONSE_OUT   (1<<8)

#define TMCB_RESPONSE_PRE_OUT   (1<<7)

Definition at line 55 of file t_hooks.h.

Referenced by _reply_light(), dlg_new_dialog(), local_reply(), relay_reply(), and t_reply_matching().

#define TMCB_TRANS_DELETED   (1<<12)

Definition at line 60 of file t_hooks.h.

Referenced by dlg_onreply(), free_cell(), uac_cb(), and unref_new_dialog().


Typedef Documentation

typedef int(* register_tmcb_f)(struct sip_msg *p_msg, struct cell *t, int cb_types, transaction_cb f, void *param, release_tmcb_param func)

register callback function prototype

Definition at line 187 of file t_hooks.h.

typedef void( release_tmcb_param)(void *param)

function to release the callback param

Definition at line 185 of file t_hooks.h.

typedef void( transaction_cb)(struct cell *t, int type, struct tmcb_params *)

callback function prototype

Definition at line 183 of file t_hooks.h.


Function Documentation

void destroy_tmcb_lists ( void   ) 

Definition at line 85 of file t_hooks.c.

References empty_tmcb_list(), and shm_free.

Referenced by tm_shutdown().

void empty_tmcb_list ( struct tmcb_head_list head  ) 

int init_tmcb_lists ( void   ) 

Definition at line 71 of file t_hooks.c.

References tmcb_head_list::first, LM_CRIT, tmcb_head_list::reg_types, and shm_malloc().

Referenced by mod_init().

int insert_tmcb ( struct tmcb_head_list cb_list,
int  types,
transaction_cb  f,
void *  param,
release_tmcb_param  release_func 
)

Inserts a callback into the a callback list.

Parameters:
cb_list callback list
types callback type
f transaction callback
param callback parameter
release_func release function for callback parameter
cb_list callback list
types callback type
f transaction callback
param callback parameter

Definition at line 102 of file t_hooks.c.

References tm_callback::callback, E_OUT_OF_MEM, tmcb_head_list::first, tm_callback::id, LM_ERR, tm_callback::next, tm_callback::param, tmcb_head_list::reg_types, tm_callback::release, shm_malloc(), and tm_callback::types.

Referenced by register_tmcb(), t_uac(), and t_uac_cancel().

int register_tmcb ( struct sip_msg p_msg,
struct cell t,
int  types,
transaction_cb  f,
void *  param,
release_tmcb_param  release_func 
)

Register a callback function for several types of events.

Register a callback function 'f' for 'types' mask of events. This will be called back whenever one of the events occurs in transaction module (global or per transaction, depending of event type).

Parameters:
p_msg SIP message
t transaction
types 
f callback
param callback parameter
release_func release function for callback parameter
Returns:
negative result on error, the return code from insert_tmcb on success
Register a callback function 'f' for 'types' mask of events. This will be called back whenever one of the events occurs in transaction module (global or per transaction, depending of event type).
Parameters:
p_msg SIP message
t transaction
types 
f callback
param callback parameter
release_func release function for the callback parameter
Returns:
negative result on error, the return code from insert_tmcb on success

Definition at line 146 of file t_hooks.c.

References E_BUG, E_CFG, empty_tmcb_list(), get_t(), sip_msg::id, insert_tmcb(), LM_CRIT, LM_ERR, NULL, T_UNDEFINED, cell::tmcb_hl, TMCB_MAX, tmcb_pending_id, and TMCB_REQUEST_IN.

Referenced by load_tm().

void run_reqin_callbacks ( struct cell trans,
struct sip_msg req,
int  code 
)

void run_trans_callbacks ( int  type,
struct cell trans,
struct sip_msg req,
struct sip_msg rpl,
int  code 
)

void set_extra_tmcb_params ( void *  extra1,
void *  extra2 
)

Set extra parameter for tm callback.

Definition at line 206 of file t_hooks.c.

References tmcb_params::extra1, and tmcb_params::extra2.

Referenced by _reply_light(), cancel_branch(), relay_reply(), and t_forward_nonack().


Variable Documentation

Definition at line 49 of file t_hooks.c.

Definition at line 51 of file t_hooks.c.

Referenced by build_cell().

unsigned int tmcb_pending_id

Definition at line 52 of file t_hooks.c.

Referenced by build_cell(), and register_tmcb().


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