From 08f942c9efc4e898de3985d25379b88a9ffe73a4 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Mon, 25 Jun 2018 17:24:09 +0200 Subject: [PATCH] app_sqlang: support functions with more combinations of 4 params --- src/modules/app_sqlang/app_sqlang_api.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/modules/app_sqlang/app_sqlang_api.c b/src/modules/app_sqlang/app_sqlang_api.c index 27f4ac2f36f..0d4672c32b7 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);