Browse code

tm: add some more debug messages to debug X/AVP and transaction handling

Henning Westerholt authored on 09/08/2022 14:03:22
Showing 1 changed files
... ...
@@ -410,6 +410,7 @@ struct cell *build_cell(struct sip_msg *p_msg)
410 410
 	init_synonym_id(p_msg, new_cell->md5);
411 411
 	init_cell_lock(new_cell);
412 412
 	t_stats_created();
413
+	LM_DBG("created new cell %p\n", new_cell);
413 414
 	return new_cell;
414 415
 
415 416
 error:
... ...
@@ -444,6 +445,7 @@ error:
444 445
 	xavp_reset_list();
445 446
 	xavu_reset_list();
446 447
 	xavi_reset_list();
448
+	LM_DBG("could not create cell\n");
447 449
 	return NULL;
448 450
 }
449 451
 
... ...
@@ -524,6 +526,7 @@ void tm_xdata_swap(tm_cell_t *t, tm_xlinks_t *xd, int mode)
524 526
 		x = xd;
525 527
 
526 528
 	if(mode == 0) {
529
+		LM_DBG("copy X/AVPs from msg context to txdata\n");
527 530
 		if(t == NULL)
528 531
 			return;
529 532
 		x->uri_avps_from =
... ...
@@ -542,7 +545,7 @@ void tm_xdata_swap(tm_cell_t *t, tm_xlinks_t *xd, int mode)
542 545
 		x->xavus_list = xavu_set_list(&t->xavus_list);
543 546
 		x->xavis_list = xavi_set_list(&t->xavis_list);
544 547
 	} else if(mode == 1) {
545
-		/* restore original avp list */
548
+		LM_DBG("restore X/AVPs msg context from txdata\n");
546 549
 		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, x->uri_avps_from);
547 550
 		set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, x->uri_avps_to);
548 551
 		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, x->user_avps_from);
... ...
@@ -561,6 +564,7 @@ void tm_xdata_swap(tm_cell_t *t, tm_xlinks_t *xd, int mode)
561 564
 void tm_xdata_replace(tm_xdata_t *newxd, tm_xlinks_t *bakxd)
562 565
 {
563 566
 	if(newxd == NULL && bakxd != NULL) {
567
+		LM_DBG("restore X/AVP msg context from backup data\n");
564 568
 		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_URI, bakxd->uri_avps_from);
565 569
 		set_avp_list(AVP_TRACK_TO | AVP_CLASS_URI, bakxd->uri_avps_to);
566 570
 		set_avp_list(AVP_TRACK_FROM | AVP_CLASS_USER, bakxd->user_avps_from);
... ...
@@ -575,6 +579,7 @@ void tm_xdata_replace(tm_xdata_t *newxd, tm_xlinks_t *bakxd)
575 579
 	}
576 580
 
577 581
 	if(newxd != NULL && bakxd != NULL) {
582
+		LM_DBG("replace existing list in backup xd from new xd\n");
578 583
 		bakxd->uri_avps_from = set_avp_list(
579 584
 				AVP_TRACK_FROM | AVP_CLASS_URI, &newxd->uri_avps_from);
580 585
 		bakxd->uri_avps_to =