[sr-dev] git:master:f49f14a8: topos: don't insert contact header for 4xx replies

Daniel-Constantin Mierla miconda at gmail.com
Wed Jun 22 21:45:39 CEST 2022


Module: kamailio
Branch: master
Commit: f49f14a87606314e98a253ee29b1624ae814dccf
URL: https://github.com/kamailio/kamailio/commit/f49f14a87606314e98a253ee29b1624ae814dccf

Author: Victor Seva <vseva at sipwise.com>
Committer: Daniel-Constantin Mierla <miconda at 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/f49f14a87606314e98a253ee29b1624ae814dccf.diff
Patch: https://github.com/kamailio/kamailio/commit/f49f14a87606314e98a253ee29b1624ae814dccf.patch

---

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) {




More information about the sr-dev mailing list