提交 5b63c744 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix the hangup hook extra arg code

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8363 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 996cfa54
...@@ -83,6 +83,7 @@ void Session::do_hangup_hook() ...@@ -83,6 +83,7 @@ void Session::do_hangup_hook()
{ {
if (hh && !mark) { if (hh && !mark) {
const char *err = NULL; const char *err = NULL;
int arg_count = 1;
mark++; mark++;
if (!getLUA()) { if (!getLUA()) {
...@@ -94,10 +95,11 @@ void Session::do_hangup_hook() ...@@ -94,10 +95,11 @@ void Session::do_hangup_hook()
lua_pushstring(L, hook_state == CS_HANGUP ? "hangup" : "transfer"); lua_pushstring(L, hook_state == CS_HANGUP ? "hangup" : "transfer");
if (hangup_func_arg) { 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); err = lua_tostring(L, -1);
if (!switch_strlen_zero(err)) { if (!switch_strlen_zero(err)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论