Module: kamailio
Branch: master
Commit: 08f942c9efc4e898de3985d25379b88a9ffe73a4
URL:
https://github.com/kamailio/kamailio/commit/08f942c9efc4e898de3985d25379b88…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-25T17:24:09+02:00
app_sqlang: support functions with more combinations of 4 params
---
Modified: src/modules/app_sqlang/app_sqlang_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/08f942c9efc4e898de3985d25379b88…
Patch:
https://github.com/kamailio/kamailio/commit/08f942c9efc4e898de3985d25379b88…
---
diff --git a/src/modules/app_sqlang/app_sqlang_api.c
b/src/modules/app_sqlang/app_sqlang_api.c
index 27f4ac2f36..0d4672c32b 100644
--- a/src/modules/app_sqlang/app_sqlang_api.c
+++ b/src/modules/app_sqlang/app_sqlang_api.c
@@ -1350,6 +1350,13 @@ int sr_kemi_sqlang_exec_func_ex(HSQUIRRELVM J, sr_kemi_t *ket)
ret = ((sr_kemi_fmssnn_f)(ket->func))(env_J->msg,
&vps[0].s, &vps[1].s, vps[2].n, vps[3].n);
return sr_kemi_sqlang_return_int(J, 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) {
+ ret = ((sr_kemi_fmsnnn_f)(ket->func))(env_J->msg,
+ &vps[0].s, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_sqlang_return_int(J, ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
@@ -1357,6 +1364,27 @@ int sr_kemi_sqlang_exec_func_ex(HSQUIRRELVM J, sr_kemi_t *ket)
ret = ((sr_kemi_fmnsss_f)(ket->func))(env_J->msg,
vps[0].n, &vps[1].s, &vps[2].s, &vps[3].s);
return sr_kemi_sqlang_return_int(J, 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) {
+ ret = ((sr_kemi_fmnnss_f)(ket->func))(env_J->msg,
+ vps[0].n, vps[1].n, &vps[2].s, &vps[3].s);
+ return sr_kemi_sqlang_return_int(J, 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) {
+ ret = ((sr_kemi_fmnnns_f)(ket->func))(env_J->msg,
+ vps[0].n, vps[1].n, vps[2].n, &vps[3].s);
+ return sr_kemi_sqlang_return_int(J, 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) {
+ ret = ((sr_kemi_fmnnnn_f)(ket->func))(env_J->msg,
+ vps[0].n, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_sqlang_return_int(J, ket, ret);
} else {
LM_ERR("invalid parameters for: %.*s\n",
fname->len, fname->s);