Module: kamailio
Branch: master
Commit: bd42130e3cfb87856b4b0431de50eccdd4324f9f
URL:
https://github.com/kamailio/kamailio/commit/bd42130e3cfb87856b4b0431de50ecc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-12-20T08:55:51+01:00
misc/examples: kemi - sanity checks for response in python script
---
Modified: misc/examples/kemi/kamailio-basic-kemi-python.py
---
Diff:
https://github.com/kamailio/kamailio/commit/bd42130e3cfb87856b4b0431de50ecc…
Patch:
https://github.com/kamailio/kamailio/commit/bd42130e3cfb87856b4b0431de50ecc…
---
diff --git a/misc/examples/kemi/kamailio-basic-kemi-python.py
b/misc/examples/kemi/kamailio-basic-kemi-python.py
index 601daa3687..f62f392594 100644
--- a/misc/examples/kemi/kamailio-basic-kemi-python.py
+++ b/misc/examples/kemi/kamailio-basic-kemi-python.py
@@ -172,7 +172,7 @@ def ksr_route_reqinit(self, msg):
KSR.sl.sl_send_reply(200,"Keepalive")
return -255
- if KSR.sanity.sanity_check(1511, 7)<0 :
+ if KSR.sanity.sanity_check(17895, 7)<0 :
KSR.err("Malformed SIP message from "
+ KSR.pv.get("$si") + ":" +
str(KSR.pv.get("$sp")) +"\n")
return -255
@@ -372,7 +372,14 @@ def ksr_failure_manage(self, msg):
# SIP response handling
# -- equivalent of reply_route{}
def ksr_reply_route(self, msg):
- KSR.info("===== response - from kamailio python script\n")
+ KSR.dbg("response handling - python script\n")
+
+ if KSR.sanity.sanity_check(17604, 6)<0 :
+ KSR.err("Malformed SIP response from "
+ + KSR.pv.get("$si") + ":" +
str(KSR.pv.get("$sp")) +"\n")
+ KSR.set_drop()
+ return -255
+
return 1