2
0
Эх сурвалжийг харах

etc/kamailio.cfg: do sanity check for sip responses

Daniel-Constantin Mierla 6 жил өмнө
parent
commit
d9269f8d9e
1 өөрчлөгдсөн 12 нэмэгдсэн , 1 устгасан
  1. 12 1
      etc/kamailio.cfg

+ 12 - 1
etc/kamailio.cfg

@@ -310,6 +310,9 @@ modparam("jsonrpcs", "pretty_format", 1)
 /* set the path to RPC unix socket control file */
 # modparam("ctl", "binrpc", "unix:/var/run/kamailio/kamailio_ctl")
 
+# ----- sanity params -----
+modparam("sanity", "autodrop", 0)
+
 # ----- tm params -----
 # auto-discard branches from previous serial forking leg
 modparam("tm", "failure_reply_mode", 3)
@@ -595,7 +598,7 @@ route[REQINIT] {
 	}
 
 	if(!sanity_check("17895", "7")) {
-		xlog("Malformed SIP message from $si:$sp\n");
+		xlog("Malformed SIP request from $si:$sp\n");
 		exit;
 	}
 }
@@ -951,6 +954,14 @@ branch_route[MANAGE_BRANCH] {
 }
 
 # Manage incoming replies
+reply_route {
+	if(!sanity_check("17604", "6")) {
+		xlog("Malformed SIP response from $si:$sp\n");
+		drop;
+	}
+}
+
+# Manage incoming replies in transaction context
 onreply_route[MANAGE_REPLY] {
 	xdbg("incoming reply\n");
 	if(status=~"[12][0-9][0-9]") {