Module: kamailio Branch: 5.2 Commit: babd8c28b27a2f4154ca3997b04d181f019c82c8 URL: https://github.com/kamailio/kamailio/commit/babd8c28b27a2f4154ca3997b04d181f...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2019-05-03T09:37:04+02:00
app_python: handle kemi sssi parameters
(cherry picked from commit a36f2c050ff607b5f3c08b7fc8ed01e082e91dc8)
---
Modified: src/modules/app_python/apy_kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/babd8c28b27a2f4154ca3997b04d181f... Patch: https://github.com/kamailio/kamailio/commit/babd8c28b27a2f4154ca3997b04d181f...
---
diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c index d9d2cf08d7..d621eae774 100644 --- a/src/modules/app_python/apy_kemi.c +++ b/src/modules/app_python/apy_kemi.c @@ -351,6 +351,22 @@ PyObject *sr_apy_kemi_exec_func_ex(sr_kemi_t *ket, PyObject *self, fname.len, fname.s, vps[0].s.len, vps[0].s.s, vps[1].s.len, vps[1].s.s, vps[2].s.len, vps[2].s.s, vps[3].s.len, vps[3].s.s); + } else if(ket->ptypes[0]==SR_KEMIP_STR + && ket->ptypes[1]==SR_KEMIP_STR + && ket->ptypes[2]==SR_KEMIP_STR + && ket->ptypes[3]==SR_KEMIP_INT) { + if(!PyArg_ParseTuple(args, "sssi:kemi-param-sssn", + &vps[0].s.s, &vps[1].s.s, &vps[2].s.s, &vps[3].n)) { + LM_ERR("unable to retrieve str-str-int-int params %d\n", i); + return sr_kemi_apy_return_false(); + } + vps[0].s.len = strlen(vps[0].s.s); + vps[1].s.len = strlen(vps[1].s.s); + vps[2].s.len = strlen(vps[2].s.s); + LM_DBG("params[%d] for: %.*s are str: [%.*s] [%.*s]" + " [%.*s] [%d]\n", i, + fname.len, fname.s, vps[0].s.len, vps[0].s.s, + vps[1].s.len, vps[1].s.s, vps[2].s.len, vps[2].s.s, vps[3].n); } else if(ket->ptypes[0]==SR_KEMIP_STR && ket->ptypes[1]==SR_KEMIP_STR && ket->ptypes[2]==SR_KEMIP_INT