Module: kamailio
Branch: master
Commit: d9269f8d9e745046558e57c3cd508130fda5a868
URL:
https://github.com/kamailio/kamailio/commit/d9269f8d9e745046558e57c3cd50813…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-03-21T14:30:06+01:00
etc/kamailio.cfg: do sanity check for sip responses
---
Modified: etc/kamailio.cfg
---
Diff:
https://github.com/kamailio/kamailio/commit/d9269f8d9e745046558e57c3cd50813…
Patch:
https://github.com/kamailio/kamailio/commit/d9269f8d9e745046558e57c3cd50813…
---
diff --git a/etc/kamailio.cfg b/etc/kamailio.cfg
index 9b8cc526f7..851a3d0af8 100644
--- a/etc/kamailio.cfg
+++ b/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]") {