Module: kamailio
Branch: master
Commit: 414c7dd608584df18f871b42e05f401e21ba775d
URL:
https://github.com/kamailio/kamailio/commit/414c7dd608584df18f871b42e05f401…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-06-21T08:57:05+02:00
topos: skip adding contact header for BYE, CANCEL, PRACK
- GH #3149
---
Modified: src/modules/topos/tps_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/414c7dd608584df18f871b42e05f401…
Patch:
https://github.com/kamailio/kamailio/commit/414c7dd608584df18f871b42e05f401…
---
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;
}