Module: kamailio
Branch: master
Commit: 5e29aecbdc77498f95ce6d6fc764f402893eb65b
URL: 
https://github.com/kamailio/kamailio/commit/5e29aecbdc77498f95ce6d6fc764f402893eb65b

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2016-04-29T11:14:39+02:00

examples/kemi: notes about use of os.exit() in python script

---

Modified: examples/kemi/kamailio-basic-kemi-python.py

---

Diff:  
https://github.com/kamailio/kamailio/commit/5e29aecbdc77498f95ce6d6fc764f402893eb65b.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5e29aecbdc77498f95ce6d6fc764f402893eb65b.patch

---

diff --git a/examples/kemi/kamailio-basic-kemi-python.py 
b/examples/kemi/kamailio-basic-kemi-python.py
index ecd72eb..8d23a6b 100644
--- a/examples/kemi/kamailio-basic-kemi-python.py
+++ b/examples/kemi/kamailio-basic-kemi-python.py
@@ -4,6 +4,13 @@
 ## Router - the old object exporting Kamailio functions
 ##
 
+## Relevant remarks:
+##  * return code -255 is used to propagate the 'exit' behaviour to the
+##  parent route block function. The alternative is to use the native
+##  Python function os.exit() (or exit()) -- it throws an exception that
+##  is caught by Kamailio and previents the stop of the interpreter.
+
+
 import sys
 import Router.Logger as Logger
 import KSR as KSR


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to