Browse code

topos: remove contact header for CANCEL,BYE,PRACK REQUESTS

emvondo authored on 18/06/2022 11:11:34
Showing 1 changed files
... ...
@@ -581,9 +581,12 @@ int tps_reinsert_via(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
581 581
 int tps_reinsert_contact(sip_msg_t *msg, tps_data_t *ptsd, str *hbody)
582 582
 {
583 583
 	str hname = str_init("Contact");
584
+	int method = get_cseq(msg)->method_id;
584 585
 
585
-	if(tps_add_headers(msg, &hname, hbody, 0)<0) {
586
-		return -1;
586
+    if (!(method & (METHOD_CANCEL|METHOD_BYE|METHOD_PRACK))) {
587
+		if(tps_add_headers(msg, &hname, hbody, 0)<0) {
588
+			return -1;
589
+		}
587 590
 	}
588 591
 
589 592
 	return 0;