[sr-dev] git:master:9ad70dfd: app_python: handle the exported functions that return bool

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 20 17:05:20 CEST 2016


Module: kamailio
Branch: master
Commit: 9ad70dfd7061136bc86c9276f6064316b42d8012
URL: https://github.com/kamailio/kamailio/commit/9ad70dfd7061136bc86c9276f6064316b42d8012

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-04-20T17:04:36+02:00

app_python: handle the exported functions that return bool

---

Modified: modules/app_python/apy_kemi.c

---

Diff:  https://github.com/kamailio/kamailio/commit/9ad70dfd7061136bc86c9276f6064316b42d8012.diff
Patch: https://github.com/kamailio/kamailio/commit/9ad70dfd7061136bc86c9276f6064316b42d8012.patch

---

diff --git a/modules/app_python/apy_kemi.c b/modules/app_python/apy_kemi.c
index d3732b2..27ad6c2 100644
--- a/modules/app_python/apy_kemi.c
+++ b/modules/app_python/apy_kemi.c
@@ -122,6 +122,13 @@ PyObject *sr_apy_kemi_return_none(void)
  */
 PyObject *sr_apy_kemi_return_int(sr_kemi_t *ket, int rval)
 {
+	if(ket!=NULL && ket->rtype==SR_KEMIP_BOOL) {
+		if(rval==SR_KEMI_TRUE) {
+			return sr_apy_kemi_return_true();
+		} else {
+			return sr_apy_kemi_return_false();
+		}
+	}
 	return PyInt_FromLong((long)rval);
 }
 




More information about the sr-dev mailing list