Module: kamailio
Branch: master
Commit: f49f14a87606314e98a253ee29b1624ae814dccf
URL:
https://github.com/kamailio/kamailio/commit/f49f14a87606314e98a253ee29b1624…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-06-22T21:45:35+02:00
topos: don't insert contact header for 4xx replies
unless original msg has contact
---
Modified: src/modules/topos/tps_msg.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f49f14a87606314e98a253ee29b1624…
Patch:
https://github.com/kamailio/kamailio/commit/f49f14a87606314e98a253ee29b1624…
---
diff --git a/src/modules/topos/tps_msg.c b/src/modules/topos/tps_msg.c
index 6f5633119d..798885df56 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) {