Browse code

misc/examples: kemi - sanity checks for response in python script

(cherry picked from commit bd42130e3cfb87856b4b0431de50eccdd4324f9f)

Daniel-Constantin Mierla authored on 20/12/2021 07:55:51
Showing 1 changed files
... ...
@@ -172,7 +172,7 @@ class kamailio:
172 172
             KSR.sl.sl_send_reply(200,"Keepalive")
173 173
             return -255
174 174
 
175
-        if KSR.sanity.sanity_check(1511, 7)<0 :
175
+        if KSR.sanity.sanity_check(17895, 7)<0 :
176 176
             KSR.err("Malformed SIP message from "
177 177
                     + KSR.pv.get("$si") + ":" + str(KSR.pv.get("$sp")) +"\n")
178 178
             return -255
... ...
@@ -372,7 +372,14 @@ class kamailio:
372 372
     # SIP response handling
373 373
     # -- equivalent of reply_route{}
374 374
     def ksr_reply_route(self, msg):
375
-        KSR.info("===== response - from kamailio python script\n")
375
+        KSR.dbg("response handling - python script\n")
376
+
377
+        if KSR.sanity.sanity_check(17604, 6)<0 :
378
+            KSR.err("Malformed SIP response from "
379
+                    + KSR.pv.get("$si") + ":" + str(KSR.pv.get("$sp")) +"\n")
380
+            KSR.set_drop()
381
+            return -255
382
+
376 383
         return 1
377 384
 
378 385