Module: kamailio
Branch: 5.6
Commit: 8137b8da1a36e54787957ab3d4ee66ca49a4b5ee
URL:
https://github.com/kamailio/kamailio/commit/8137b8da1a36e54787957ab3d4ee66c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/8137b8da1a36e54787957ab3d4ee66c…
Patch:
https://github.com/kamailio/kamailio/commit/8137b8da1a36e54787957ab3d4ee66c…
---
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;
}