[Freeswitch-svn] [commit] r8363 - freeswitch/trunk/src/mod/languages/mod_lua

Freeswitch SVN anthm at freeswitch.org
Mon May 12 11:38:51 EDT 2008


Author: anthm
Date: Mon May 12 11:38:51 2008
New Revision: 8363

Modified:
   freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp

Log:
fix the hangup hook extra arg code

Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp	Mon May 12 11:38:51 2008
@@ -83,6 +83,7 @@
 {
 	if (hh && !mark) {
 		const char *err = NULL;
+		int arg_count = 1;
 		mark++;
 
 		if (!getLUA()) {
@@ -94,10 +95,11 @@
 		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)) {



More information about the Freeswitch-svn mailing list