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

Function cancel_branch

modules/tm/t_cancel.c:90–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89
90void cancel_branch( struct cell *t, int branch )
91{
92 char *cancel;
93 unsigned int len;
94 struct retr_buf *crb, *irb;
95 struct usr_avp **backup_list;
96
97 crb=&TM_BRANCH(t,branch).local_cancel;
98 irb=&TM_BRANCH(t,branch).request;
99
100# ifdef EXTRA_DEBUG
101 if (crb->buffer.s!=0 && crb->buffer.s!=BUSY_BUFFER) {
102 LM_CRIT("attempt to rewrite cancel buffer failed\n");
103 abort();
104 }
105# endif
106
107
108 cancel=build_cancel(t, branch, &len);
109 if (!cancel) {
110 LM_ERR("attempt to build a CANCEL failed\n");
111 return;
112 }
113 /* install cancel now */
114 crb->buffer.s=cancel;
115 crb->buffer.len=len;
116 crb->dst=irb->dst;
117 crb->branch=branch;
118 /* label it as cancel so that FR timer can better now how
119 * to deal with it */
120 crb->activ_type=TYPE_LOCAL_CANCEL;
121
122 if ( has_tran_tmcbs( t, TMCB_REQUEST_BUILT) ) {
123 _tm_branch_index = branch;
124 set_extra_tmcb_params( &crb->buffer, &crb->dst);
125 run_trans_callbacks( TMCB_REQUEST_BUILT,
126 t, t->uas.request, 0, 0);
127 _tm_branch_index = 0;
128 }
129
130 LM_DBG("sending cancel on branch %d...\n",branch);
131 if (TM_BRANCH(t,branch).br_flags & tcp_no_new_conn_bflag)
132 tcp_no_new_conn = 1;
133 backup_list = set_avp_list( &t->user_avps );
134 set_bavp_list(&TM_BRANCH(t,branch).user_avps);
135 if (SEND_BUFFER( crb )==0) {
136 if ( has_tran_tmcbs( t, TMCB_MSG_SENT_OUT) ) {
137 set_extra_tmcb_params( &crb->buffer, &crb->dst);
138 run_trans_callbacks( TMCB_MSG_SENT_OUT,
139 t, t->uas.request, 0, 0);
140 }
141 }
142 set_avp_list(backup_list);
143 tcp_no_new_conn = 0;
144 reset_bavp_list();
145
146 /*sets and starts the FINAL RESPONSE timer */
147 start_retr( crb );

Callers 2

process_reply_and_timerFunction · 0.85
cancel_uacsFunction · 0.85

Calls 7

build_cancelFunction · 0.85
set_extra_tmcb_paramsFunction · 0.85
run_trans_callbacksFunction · 0.85
set_avp_listFunction · 0.85
set_bavp_listFunction · 0.85
reset_bavp_listFunction · 0.85
start_retrFunction · 0.85

Tested by

no test coverage detected