[sr-dev] git:5.6:8137b8da: topos: skip adding contact header for BYE, CANCEL, PRACK

Daniel-Constantin Mierla miconda at gmail.com
Fri Jun 24 11:10:19 CEST 2022


Module: kamailio
Branch: 5.6
Commit: 8137b8da1a36e54787957ab3d4ee66ca49a4b5ee
URL: https://github.com/kamailio/kamailio/commit/8137b8da1a36e54787957ab3d4ee66ca49a4b5ee

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-06-24T11:08:25+02:00

topos: skip adding contact header for BYE, CANCEL, PRACK

- GH #3149

(cherry picked from commit 414c7dd608584df18f871b42e05f401e21ba775d)

---

Modified: src/modules/topos/tps_msg.c

---

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

---

diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 83d5f5fddff..c01dde7b3f1 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -46,6 +46,8 @@
 #include "tps_msg.h"
 #include "tps_storage.h"
 
+#define TPS_METHODS_NOCONTACT (METHOD_CANCEL|METHOD_BYE|METHOD_PRACK)
+
 extern int _tps_param_mask_callid;
 extern int _tps_contact_mode;
 extern str _tps_cparam_name;
@@ -582,6 +584,10 @@ int tps_reinsert_contact(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
 {
 	str hname = str_init("Contact");
 
+	if (get_cseq(msg)->method_id & TPS_METHODS_NOCONTACT) {
+		return 0;
+	}
+
 	if(tps_add_headers(msg, &hname, hbody, 0)<0) {
 		return -1;
 	}




More information about the sr-dev mailing list