This commit is contained in:
Anthony Minessale
2011-03-17 17:21:41 -05:00
parent 00a2b18541
commit c49c1fdea9
2 changed files with 26 additions and 12 deletions
+9 -4
View File
@@ -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) {