mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-08 05:11:51 +00:00
FS-3161
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
#include "freeswitch_lua.h"
|
||||
using namespace LUA;
|
||||
|
||||
extern "C" {
|
||||
int docall(lua_State * L, int narg, int clear, int perror);
|
||||
};
|
||||
|
||||
Session::Session():CoreSession()
|
||||
{
|
||||
cb_function = cb_arg = hangup_func_str = hangup_func_arg = NULL;
|
||||
@@ -137,7 +141,7 @@ void Session::do_hangup_hook()
|
||||
arg_count++;
|
||||
}
|
||||
|
||||
lua_call(L, arg_count, 1);
|
||||
docall(L, arg_count, 1, 1);
|
||||
err = lua_tostring(L, -1);
|
||||
|
||||
if (!zstr(err)) {
|
||||
@@ -273,7 +277,8 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
|
||||
arg_count++;
|
||||
}
|
||||
|
||||
lua_call(L, arg_count, 1);
|
||||
docall(L, arg_count, 0, 1);
|
||||
|
||||
ret = lua_tostring(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
@@ -297,7 +302,7 @@ switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t ityp
|
||||
arg_count++;
|
||||
}
|
||||
|
||||
lua_call(L, arg_count, 1);
|
||||
docall(L, arg_count, 1, 1);
|
||||
ret = lua_tostring(L, -1);
|
||||
lua_pop(L, 1);
|
||||
|
||||
@@ -374,7 +379,7 @@ int Dbh::query_callback(void *pArg, int argc, char **argv, char **cargv)
|
||||
lua_settable(lua_fun->L, -3);
|
||||
}
|
||||
|
||||
lua_call(lua_fun->L, 1, 1); /* 1 in, 1 out */
|
||||
docall(lua_fun->L, 1, 1, 1); /* 1 in, 1 out */
|
||||
|
||||
if (lua_isnumber(lua_fun->L, -1)) {
|
||||
if (lua_tonumber(lua_fun->L, -1) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user