Module: kamailio
Branch: 5.5
Commit: d06fbbea95b33934d841f37bff6ae2b32dde2f87
URL:
https://github.com/kamailio/kamailio/commit/d06fbbea95b33934d841f37bff6ae2b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-16T08:31:55+01:00
misc/examples: kemi - sanity check for response in lua script
(cherry picked from commit 96ba8bdf87221c985d8198fe36f7f0bd9858a738)
---
Modified: misc/examples/kemi/kamailio-basic-kemi-lua.lua
---
Diff:
https://github.com/kamailio/kamailio/commit/d06fbbea95b33934d841f37bff6ae2b…
Patch:
https://github.com/kamailio/kamailio/commit/d06fbbea95b33934d841f37bff6ae2b…
---
diff --git a/misc/examples/kemi/kamailio-basic-kemi-lua.lua
b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
index bddabbaa89..a406b6429c 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-lua.lua
+++ b/misc/examples/kemi/kamailio-basic-kemi-lua.lua
@@ -195,7 +195,7 @@ function ksr_route_reqinit()
end
if KSR.sanity.sanity_check(1511, 7)<0 then
- KSR.err("Malformed SIP message from "
+ KSR.err("malformed SIP message from "
.. KSR.kx.get_srcip() .. ":" .. KSR.kx.get_srcport() .."\n");
KSR.x.exit();
end
@@ -418,6 +418,11 @@ end
-- SIP response handling
-- equivalent of reply_route{}
function ksr_reply_route()
- KSR.info("===== response - from kamailio lua script\n");
+ KSR.dbg("response - from kamailio lua script\n");
+ if KSR.sanity.sanity_check(17604, 6)<0 then
+ KSR.err("malformed SIP response from "
+ .. KSR.kx.get_srcip() .. ":" .. KSR.kx.get_srcport() .."\n");
+ KSR.x.drop();
+ end
return 1;
end