Module: kamailio
Branch: 5.2
Commit: c4cda7ba406215ec8b84176ea533038770fd4485
URL:
https://github.com/kamailio/kamailio/commit/c4cda7ba406215ec8b84176ea533038…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-03T09:14:58+02:00
app_python3: fixed condition for function with siis params
- GH #1944
(cherry picked from commit 5d5b9786d3cd765a9cf957e34d849fec34bf5e9f)
---
Modified: src/modules/app_python3/apy_kemi.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c4cda7ba406215ec8b84176ea533038…
Patch:
https://github.com/kamailio/kamailio/commit/c4cda7ba406215ec8b84176ea533038…
---
diff --git a/src/modules/app_python3/apy_kemi.c b/src/modules/app_python3/apy_kemi.c
index 32d99913a4..0b78c29107 100755
--- a/src/modules/app_python3/apy_kemi.c
+++ b/src/modules/app_python3/apy_kemi.c
@@ -415,6 +415,25 @@ PyObject *sr_apy_kemi_exec_func_ex(sr_kemi_t *ket, PyObject *self,
PyObject *arg
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, vps[4].s.len, vps[4].s.s);
+ } else if(ket->ptypes[0]==SR_KEMIP_STR
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_INT
+ && ket->ptypes[4]==SR_KEMIP_STR) {
+ if(!PyArg_ParseTuple(args, "ssiis:kemi-param-ssnns",
+ &vps[0].s.s, &vps[1].s.s, &vps[2].n, &vps[3].n,
+ &vps[4].s.s)) {
+ LM_ERR("unable to retrieve str-str-int-int-str 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[4].s.len = strlen(vps[4].s.s);
+ LM_DBG("params[%d] for: %.*s are str: [%.*s] [%.*s]"
+ " [%d] [%d] [%.*s]\n", i,
+ fname.len, fname.s, vps[0].s.len, vps[0].s.s,
+ vps[1].s.len, vps[1].s.s, vps[2].n, vps[3].n,
+ vps[4].s.len, vps[4].s.s);
} else {
LM_ERR("not implemented yet\n");
return sr_kemi_apy_return_false();
@@ -661,6 +680,16 @@ PyObject *sr_apy_kemi_exec_func_ex(sr_kemi_t *ket, PyObject *self,
PyObject *arg
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s,
&vps[4].s);
return sr_kemi_apy_return_int(ket, ret);
+ } else if(ket->ptypes[0]==SR_KEMIP_STR
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_INT
+ && ket->ptypes[4]==SR_KEMIP_STR) {
+ /* sssss */
+ ret = ((sr_kemi_fmsssss_f)(ket->func))(lmsg,
+ &vps[0].s, &vps[1].s, vps[2].n, vps[3].n,
+ &vps[4].s);
+ return sr_kemi_apy_return_int(ket, ret);
} else {
LM_ERR("invalid parameters for: %.*s\n",
fname.len, fname.s);