Browse code

topos: don't insert contact header for 4xx replies

unless original msg has contact

(cherry picked from commit f49f14a87606314e98a253ee29b1624ae814dccf)

Victor Seva authored on 07/10/2020 13:35:50 • Daniel-Constantin Mierla committed on 24/06/2022 09:08:52
Showing 1 changed files
... ...
@@ -1167,6 +1167,11 @@ int tps_response_sent(sip_msg_t *msg)
1167 1167
 				&& msg->contact==NULL) {
1168 1168
 		contact_keep = 1;
1169 1169
 	}
1170
+	if(contact_keep==0 && msg->first_line.u.reply.statuscode>=400
1171
+				&& msg->first_line.u.reply.statuscode<500
1172
+				&& msg->contact==NULL) {
1173
+		contact_keep = 1;
1174
+	}
1170 1175
 	if(contact_keep==0) {
1171 1176
 		tps_remove_headers(msg, HDR_CONTACT_T);
1172 1177
 		if(direction==TPS_DIR_DOWNSTREAM) {