fix the hangup hook extra arg code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8363 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
996cfa54bd
commit
5b63c744bb
|
@ -83,6 +83,7 @@ void Session::do_hangup_hook()
|
|||
{
|
||||
if (hh && !mark) {
|
||||
const char *err = NULL;
|
||||
int arg_count = 1;
|
||||
mark++;
|
||||
|
||||
if (!getLUA()) {
|
||||
|
@ -94,10 +95,11 @@ void Session::do_hangup_hook()
|
|||
lua_pushstring(L, hook_state == CS_HANGUP ? "hangup" : "transfer");
|
||||
|
||||
if (hangup_func_arg) {
|
||||
lua_pushstring(L, hangup_func_arg);
|
||||
lua_getfield(L, LUA_GLOBALSINDEX, (char *)hangup_func_arg);
|
||||
arg_count++;
|
||||
}
|
||||
|
||||
lua_call(L, 1, 1);
|
||||
|
||||
lua_call(L, arg_count, 1);
|
||||
err = lua_tostring(L, -1);
|
||||
|
||||
if (!switch_strlen_zero(err)) {
|
||||
|
|
Loading…
Reference in New Issue