Browse code

tmx: backup and restore existing T and branch pointers for t_cancel_callid()

- reported and initial patch by Guillaume Bour

(cherry picked from commit 60372d613544af1f8f06122eb77fa2a9636a6c3a)
(cherry picked from commit f7ed69d75746dc55e5a48a7a18602124e73cd3cd)

Daniel-Constantin Mierla authored on 24/11/2013 15:06:41
Showing 1 changed files
... ...
@@ -331,6 +331,8 @@ static int fixup_cancel_callid(void** param, int param_no)
331 331
 static int t_cancel_callid(struct sip_msg* msg, char *cid, char *cseq, char *flag)
332 332
 {
333 333
 	struct cell *trans;
334
+	struct cell *bkt;
335
+	int bkb;
334 336
 	struct cancel_info cancel_data;
335 337
 	str cseq_s;
336 338
 	str callid_s;
... ...
@@ -356,6 +358,8 @@ static int t_cancel_callid(struct sip_msg* msg, char *cid, char *cseq, char *fla
356 358
 		return -1;
357 359
 	}
358 360
 
361
+	bkt = _tmx_tmb.t_gett();
362
+	bkb = _tmx_tmb.t_gett_branch();
359 363
 	if( _tmx_tmb.t_lookup_callid(&trans, callid_s, cseq_s) < 0 ) {
360 364
 		DBG("Lookup failed - no transaction\n");
361 365
 		return -1;
... ...
@@ -370,6 +374,7 @@ static int t_cancel_callid(struct sip_msg* msg, char *cid, char *cseq, char *fla
370 374
 	_tmx_tmb.cancel_uacs(trans, &cancel_data, 0);
371 375
 
372 376
 	//_tmx_tmb.unref_cell(trans);
377
+	_tmx_tmb.t_sett(bkt, bkb);
373 378
 
374 379
 	return 1;
375 380
 }