TT#94500 upstream fix for TOPOS contact header

https://github.com/kamailio/kamailio/pull/3149#issuecomment-1161330436

Our solution was not complete

Change-Id: I7f8e165f4827fef875ba486a11dfc413cf4437ca
mr11.0
Victor Seva 4 years ago
parent acb89bfaef
commit 868a9ee038

@ -40,6 +40,7 @@ upstream/dialog-reworked-kemi-export-for-dlg_get_var.patch
upstream/dialog-fix-ki_dlg_get_var-introduced-previously.patch
upstream/dialog-dlg_get_var-assure-return-null-on-error.patch
upstream/dialog-w_dlg_get_var-fix-incompatible-pointer.patch
upstream/topos-skip-adding-contact-header-for-BYE-CANCEL-PRAC.patch
### relevant for upstream
sipwise/pua_dialoginfo-refresh_pubruri_avps_flag.patch
sipwise/pua_dialoginfo-use-lock-when-use_puburi_avps-is-set.patch

@ -8,10 +8,10 @@ unless original msg has contact
1 file changed, 5 insertions(+)
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 83d5f5f..6e9393e 100644
index c01dde7..a3f123b 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -1161,6 +1161,11 @@ int tps_response_sent(sip_msg_t *msg)
@@ -1167,6 +1167,11 @@ int tps_response_sent(sip_msg_t *msg)
&& msg->contact==NULL) {
contact_keep = 1;
}

@ -0,0 +1,33 @@
From: Daniel-Constantin Mierla <miconda@gmail.com>
Date: Tue, 21 Jun 2022 08:41:53 +0200
Subject: topos: skip adding contact header for BYE, CANCEL, PRACK
- GH #3149
---
src/modules/topos/tps_msg.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 83d5f5f..c01dde7 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;
}
Loading…
Cancel
Save