Module: kamailio
Branch: 5.6
Commit: 45c3b1b6cd97b610ca3bd8753df44e14ec780b22
URL:
https://github.com/kamailio/kamailio/commit/45c3b1b6cd97b610ca3bd8753df44e1…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-06-24T11:08:52+02:00
topos: don't insert contact header for 4xx replies
unless original msg has contact
(cherry picked from commit f49f14a87606314e98a253ee29b1624ae814dccf)
---
Modified: src/modules/topos/tps_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/45c3b1b6cd97b610ca3bd8753df44e1…
Patch:
https://github.com/kamailio/kamailio/commit/45c3b1b6cd97b610ca3bd8753df44e1…
---
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index c01dde7b3f..a3f123b593 100644
--- a/src/modules/topos/tps_msg.c
+++ b/src/modules/topos/tps_msg.c
@@ -1167,6 +1167,11 @@ int tps_response_sent(sip_msg_t *msg)
&& msg->contact==NULL) {
contact_keep = 1;
}
+ if(contact_keep==0 && msg->first_line.u.reply.statuscode>=400
+ && msg->first_line.u.reply.statuscode<500
+ && msg->contact==NULL) {
+ contact_keep = 1;
+ }
if(contact_keep==0) {
tps_remove_headers(msg, HDR_CONTACT_T);
if(direction==TPS_DIR_DOWNSTREAM) {