[sr-dev] git:master:3e7ff1f3: app_python: support for more combinations of functions with 4 params
Daniel-Constantin Mierla
miconda at gmail.com
Fri Jun 22 13:30:28 CEST 2018
Module: kamailio
Branch: master
Commit: 3e7ff1f3613db1c5de559bbf259a621647a5424b
URL: https://github.com/kamailio/kamailio/commit/3e7ff1f3613db1c5de559bbf259a621647a5424b
Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2018-06-22T13:30:09+02:00
app_python: support for more combinations of functions with 4 params
---
Modified: src/modules/app_python/apy_kemi.c
---
Diff: https://github.com/kamailio/kamailio/commit/3e7ff1f3613db1c5de559bbf259a621647a5424b.diff
Patch: https://github.com/kamailio/kamailio/commit/3e7ff1f3613db1c5de559bbf259a621647a5424b.patch
---
diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c
index 6a1d62d932..7110912b92 100644
--- a/src/modules/app_python/apy_kemi.c
+++ b/src/modules/app_python/apy_kemi.c
@@ -583,14 +583,46 @@ 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
&& ket->ptypes[3]==SR_KEMIP_STR) {
- /* ssnn */
+ /* nsss */
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