void run_onsend_callbacks2(int type, struct cell* trans, struct tmcb_params* p) { if (p->t_rbuf==0) return; if ( trans==0 || trans->tmcb_hl.first==0 || ((trans->tmcb_hl.reg_types)&type)==0 ) return; run_trans_callbacks_internal(&trans->tmcb_hl, type, p->t_rbuf->my_T, p); }
void run_trans_callbacks( int type , struct cell *trans, struct sip_msg *req, struct sip_msg *rpl, int code ) { struct tmcb_params params; if (trans->tmcb_hl.first==0 || ((trans->tmcb_hl.reg_types)&type)==0 ) return; memset (¶ms, 0, sizeof(params)); params.req = req; params.rpl = rpl; params.code = code; run_trans_callbacks_internal(&trans->tmcb_hl, type, trans, ¶ms); }
void run_onsend_callbacks(int type, struct retr_buf* rbuf, struct sip_msg* req, struct sip_msg* repl, short flags) { struct tmcb_params params; struct cell * trans; trans=rbuf->my_T; if ( trans==0 || trans->tmcb_hl.first==0 || ((trans->tmcb_hl.reg_types)&type)==0 ) return; INIT_TMCB_ONSEND_PARAMS(params, req, repl, rbuf, &rbuf->dst, rbuf->buffer, rbuf->buffer_len, flags, rbuf->branch, rbuf->activ_type); /* req, rpl */ run_trans_callbacks_internal(&trans->tmcb_hl, type, trans, ¶ms); }
/* per dialog callbacks receive only the transaction, send buffer, destination * and the retr. buff */ void run_trans_dlg_callbacks(dlg_t* dlg, struct cell* trans, struct retr_buf* rbuf) { struct tmcb_params params; if (dlg->dlg_callbacks.first==0) return; memset(¶ms, 0, sizeof(params)); if (rbuf){ params.t_rbuf=rbuf; params.dst=&rbuf->dst; params.send_buf.s=rbuf->buffer; params.send_buf.len=rbuf->buffer_len; } run_trans_callbacks_internal(&dlg->dlg_callbacks, TMCB_DLG, trans, ¶ms); }