MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / run_any_trans_callbacks

Function run_any_trans_callbacks

modules/tm/t_hooks.c:191–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191static void run_any_trans_callbacks(struct tmcb_head_list *list, unsigned int type,
192 struct cell *trans, struct sip_msg *req, struct sip_msg *rpl, int code)
193{
194 struct tmcb_params params;
195 struct tm_callback *cbp;
196 struct usr_avp **backup;
197 struct cell *trans_backup = get_t();
198
199 params.req = req;
200 params.rpl = rpl;
201 params.code = code;
202 params.extra1 = tmcb_extra1;
203 params.extra2 = tmcb_extra2;
204
205 if (list->first==0 || ((list->reg_types)&type)==0)
206 return;
207
208 backup = set_avp_list( &trans->user_avps );
209 for (cbp=list->first; cbp; cbp=cbp->next) {
210 if ((cbp->types)&type) {
211 LM_DBG("trans=%p, callback type %d, id %d entered\n",
212 trans, type, cbp->id );
213 params.param = &(cbp->param);
214 cbp->callback( trans, type, &params );
215 if ((cbp->types)&(TMCB_REQUEST_IN|TMCB_LOCAL_TRANS_NEW)) {
216 if (req && req->dst_uri.len==-1) {
217 LM_CRIT("callback %s id %d entered\n",
218 (type&TMCB_REQUEST_IN?"REQIN":"LOCAL_NEW"),cbp->id );
219 req->dst_uri.len = 0;
220 }
221 }
222 }
223 }
224 /* env cleanup */
225 set_avp_list( backup );
226 tmcb_extra1 = tmcb_extra2 = 0;
227 set_t(trans_backup);
228}
229
230void run_trans_callbacks( int type , struct cell *trans,
231 struct sip_msg *req, struct sip_msg *rpl, int code )

Callers 3

run_trans_callbacksFunction · 0.85
run_new_local_callbacksFunction · 0.85
run_reqin_callbacksFunction · 0.85

Calls 3

get_tFunction · 0.85
set_avp_listFunction · 0.85
set_tFunction · 0.85

Tested by

no test coverage detected