Module: kamailio
Branch: master
Commit: 9ad70dfd7061136bc86c9276f6064316b42d8012
URL:
https://github.com/kamailio/kamailio/commit/9ad70dfd7061136bc86c9276f606431…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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/9ad70dfd7061136bc86c9276f606431…
Patch:
https://github.com/kamailio/kamailio/commit/9ad70dfd7061136bc86c9276f606431…
---
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);
}