Module: kamailio
Branch: master
Commit: 8ff9f0dc0c00e80ad3a9add41823ca3dc101b94e
URL:
https://github.com/kamailio/kamailio/commit/8ff9f0dc0c00e80ad3a9add41823ca3…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-06-22T13:30:08+02:00
app_lua: support for more combinations of functions with 4 params
---
Modified: src/modules/app_lua/app_lua_sr.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8ff9f0dc0c00e80ad3a9add41823ca3…
Patch:
https://github.com/kamailio/kamailio/commit/8ff9f0dc0c00e80ad3a9add41823ca3…
---
diff --git a/src/modules/app_lua/app_lua_sr.c b/src/modules/app_lua/app_lua_sr.c
index c98830da5c..a72e657279 100644
--- a/src/modules/app_lua/app_lua_sr.c
+++ b/src/modules/app_lua/app_lua_sr.c
@@ -1702,6 +1702,13 @@ int sr_kemi_lua_exec_func_ex(lua_State* L, sr_kemi_t *ket, int
pdelta)
ret = ((sr_kemi_fmssnn_f)(ket->func))(env_L->msg,
&vps[0].s, &vps[1].s, vps[2].n, vps[3].n);
return sr_kemi_lua_return_int(L, 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_L->msg,
+ &vps[0].s, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_lua_return_int(L, ket, ret);
} else if(ket->ptypes[0]==SR_KEMIP_INT
&& ket->ptypes[1]==SR_KEMIP_STR
&& ket->ptypes[2]==SR_KEMIP_STR
@@ -1709,6 +1716,27 @@ int sr_kemi_lua_exec_func_ex(lua_State* L, sr_kemi_t *ket, int
pdelta)
ret = ((sr_kemi_fmnsss_f)(ket->func))(env_L->msg,
vps[0].n, &vps[1].s, &vps[2].s, &vps[3].s);
return sr_kemi_lua_return_int(L, 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_L->msg,
+ vps[0].n, vps[1].n, &vps[2].s, &vps[3].s);
+ return sr_kemi_lua_return_int(L, 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_L->msg,
+ vps[0].n, vps[1].n, vps[2].n, &vps[3].s);
+ return sr_kemi_lua_return_int(L, 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_L->msg,
+ vps[0].n, vps[1].n, vps[2].n, vps[3].n);
+ return sr_kemi_lua_return_int(L, ket, ret);
} else {
LM_ERR("invalid parameters for: %.*s\n",
fname->len, fname->s);