[sr-dev] git:master:5e29aecb: examples/kemi: notes about use of os.exit() in python script

Daniel-Constantin Mierla miconda at gmail.com
Fri Apr 29 11:15:08 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
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




More information about the sr-dev mailing list