[sr-dev] git:master:a4043c44: topos: reused stored branch attributes in case of retransmission

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 28 10:58:13 CEST 2016


Module: kamailio
Branch: master
Commit: a4043c445b0673ca8f5ff7819caf9ac156da1e73
URL: https://github.com/kamailio/kamailio/commit/a4043c445b0673ca8f5ff7819caf9ac156da1e73

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-03-28T10:56:14+02:00

topos: reused stored branch attributes in case of retransmission

---

Modified: modules/topos/tps_msg.c

---

Diff:  https://github.com/kamailio/kamailio/commit/a4043c445b0673ca8f5ff7819caf9ac156da1e73.diff
Patch: https://github.com/kamailio/kamailio/commit/a4043c445b0673ca8f5ff7819caf9ac156da1e73.patch

---

diff --git a/modules/topos/tps_msg.c b/modules/topos/tps_msg.c
index fc39d33..f35eeaf 100644
--- a/modules/topos/tps_msg.c
+++ b/modules/topos/tps_msg.c
@@ -644,8 +644,12 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int local)
 
 	tps_storage_lock_get(&lkey);
 	if(dialog==0) {
-		if(tps_storage_record(msg, ptsd)<0) {
-			goto error;
+		if(tps_storage_load_branch(msg, &mtsd, &stsd)!=0) {
+			if(tps_storage_record(msg, ptsd)<0) {
+				goto error;
+			}
+		} else {
+			ptsd = &stsd;
 		}
 	}
 
@@ -667,7 +671,7 @@ int tps_request_sent(sip_msg_t *msg, int dialog, int local)
 	tps_remove_headers(msg, HDR_CONTACT_T);
 	tps_remove_headers(msg, HDR_VIA_T);
 
-	tps_reinsert_via(msg, ptsd, &ptsd->x_via1);
+	tps_reinsert_via(msg, &mtsd, &mtsd.x_via1);
 	if(direction==TPS_DIR_UPSTREAM) {
 		tps_reinsert_contact(msg, ptsd, &ptsd->as_contact);
 	} else {




More information about the sr-dev mailing list