Module: kamailio
Branch: master
Commit: d86b67bbde300e4aa1be7ea7c5bdb21469ece03c
URL:
https://github.com/kamailio/kamailio/commit/d86b67bbde300e4aa1be7ea7c5bdb21…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-05-25T12:01:00+02:00
app_sqlang: fix for executing kemi functions with 4 or more params
- more combinations for 4 params
---
Modified: src/modules/app_sqlang/app_sqlang_api.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d86b67bbde300e4aa1be7ea7c5bdb21…
Patch:
https://github.com/kamailio/kamailio/commit/d86b67bbde300e4aa1be7ea7c5bdb21…
---
diff --git a/src/modules/app_sqlang/app_sqlang_api.c
b/src/modules/app_sqlang/app_sqlang_api.c
index 77d98ddc3d..27f4ac2f36 100644
--- a/src/modules/app_sqlang/app_sqlang_api.c
+++ b/src/modules/app_sqlang/app_sqlang_api.c
@@ -1330,19 +1330,33 @@ int sr_kemi_sqlang_exec_func_ex(HSQUIRRELVM J, sr_kemi_t *ket)
break;
case 4:
if(ket->ptypes[0]==SR_KEMIP_STR
- || ket->ptypes[1]==SR_KEMIP_STR
- || ket->ptypes[2]==SR_KEMIP_STR
- || ket->ptypes[3]==SR_KEMIP_STR) {
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_STR) {
ret = ((sr_kemi_fmssss_f)(ket->func))(env_J->msg,
&vps[0].s, &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_STR
- || ket->ptypes[1]==SR_KEMIP_STR
- || ket->ptypes[2]==SR_KEMIP_INT
- || ket->ptypes[3]==SR_KEMIP_INT) {
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_INT) {
+ ret = ((sr_kemi_fmsssn_f)(ket->func))(env_J->msg,
+ &vps[0].s, &vps[1].s, &vps[2].s, 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_STR
+ && ket->ptypes[2]==SR_KEMIP_INT
+ && ket->ptypes[3]==SR_KEMIP_INT) {
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_INT
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_STR) {
+ 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 {
LM_ERR("invalid parameters for: %.*s\n",
fname->len, fname->s);
@@ -1351,10 +1365,10 @@ int sr_kemi_sqlang_exec_func_ex(HSQUIRRELVM J, sr_kemi_t *ket)
break;
case 5:
if(ket->ptypes[0]==SR_KEMIP_STR
- || ket->ptypes[1]==SR_KEMIP_STR
- || ket->ptypes[2]==SR_KEMIP_STR
- || ket->ptypes[3]==SR_KEMIP_STR
- || ket->ptypes[4]==SR_KEMIP_STR) {
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_STR
+ && ket->ptypes[4]==SR_KEMIP_STR) {
ret = ((sr_kemi_fmsssss_f)(ket->func))(env_J->msg,
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s,
&vps[4].s);
@@ -1367,11 +1381,11 @@ int sr_kemi_sqlang_exec_func_ex(HSQUIRRELVM J, sr_kemi_t *ket)
break;
case 6:
if(ket->ptypes[0]==SR_KEMIP_STR
- || ket->ptypes[1]==SR_KEMIP_STR
- || ket->ptypes[2]==SR_KEMIP_STR
- || ket->ptypes[3]==SR_KEMIP_STR
- || ket->ptypes[4]==SR_KEMIP_STR
- || ket->ptypes[5]==SR_KEMIP_STR) {
+ && ket->ptypes[1]==SR_KEMIP_STR
+ && ket->ptypes[2]==SR_KEMIP_STR
+ && ket->ptypes[3]==SR_KEMIP_STR
+ && ket->ptypes[4]==SR_KEMIP_STR
+ && ket->ptypes[5]==SR_KEMIP_STR) {
ret = ((sr_kemi_fmssssss_f)(ket->func))(env_J->msg,
&vps[0].s, &vps[1].s, &vps[2].s, &vps[3].s,
&vps[4].s, &vps[5].s);