[sr-dev] git:master:48de203f: app_python: support for functions with more combinations of 4 params
Daniel-Constantin Mierla
miconda at gmail.com
Mon Jun 25 20:42:45 CEST 2018
Module: kamailio
Branch: master
Commit: 48de203fda213749ac1e6fdb081c22dd701f85c4
URL: https://github.com/kamailio/kamailio/commit/48de203fda213749ac1e6fdb081c22dd701f85c4
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-06-25T17:33:29+02:00
app_python: support for functions with more combinations of 4 params
---
Modified: src/modules/app_python3/apy_kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/48de203fda213749ac1e6fdb081c22dd701f85c4.diff
Patch: https://github.com/kamailio/kamailio/commit/48de203fda213749ac1e6fdb081c22dd701f85c4.patch
---
diff --git a/src/modules/app_python3/apy_kemi.c b/src/modules/app_python3/apy_kemi.c
index 520bbda52c..1e9fd23d48 100755
--- a/src/modules/app_python3/apy_kemi.c
+++ b/src/modules/app_python3/apy_kemi.c
@@ -607,6 +607,14 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
ret = ((sr_kemi_fmssnn_f)(ket->func))(lmsg,
&vps[0].s, &vps[1].s, vps[2].n, vps[3].n);
return sr_kemi_apy_return_int(ket, ret);
+ } else if(ket->ptypes[0]==SR_KEMIP_STR
+ && ket->ptypes[1]==SR_KEMIP_INT
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_INT) {
+ /* snnn */
+ ret = ((sr_kemi_fmsnnn_f)(ket->func))(lmsg,
+ &vps[0].s, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_apy_return_int(ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
@@ -615,6 +623,30 @@ PyObject *sr_apy_kemi_exec_func(PyObject *self, PyObject *args, int idx)
ret = ((sr_kemi_fmnsss_f)(ket->func))(lmsg,
vps[0].n, &vps[1].s, &vps[2].s, &vps[3].s);
return sr_kemi_apy_return_int(ket, ret);
+ } else if(ket->ptypes[0]==SR_KEMIP_INT
+ && ket->ptypes[1]==SR_KEMIP_INT
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_STR) {
+ /* nnss */
+ ret = ((sr_kemi_fmnnss_f)(ket->func))(lmsg,
+ vps[0].n, vps[1].n, &vps[2].s, &vps[3].s);
+ return sr_kemi_apy_return_int(ket, ret);
+ } else if(ket->ptypes[0]==SR_KEMIP_INT
+ && ket->ptypes[1]==SR_KEMIP_INT
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_STR) {
+ /* nnns */
+ ret = ((sr_kemi_fmnnns_f)(ket->func))(lmsg,
+ vps[0].n, vps[1].n, vps[2].n, &vps[3].s);
+ return sr_kemi_apy_return_int(ket, ret);
+ } else if(ket->ptypes[0]==SR_KEMIP_INT
+ && ket->ptypes[1]==SR_KEMIP_INT
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_INT) {
+ /* nnnn */
+ ret = ((sr_kemi_fmnnnn_f)(ket->func))(lmsg,
+ vps[0].n, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_apy_return_int(ket, ret);
} else {
LM_ERR("invalid parameters for: %.*s\n",
fname.len, fname.s);
More information about the sr-dev
mailing list