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

Freeswitch SVN brian at freeswitch.org
Thu Aug 14 13:35:46 EDT 2008


Author: brian
Date: Thu Aug 14 13:35:46 2008
New Revision: 9297

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

Log:
fix lua originate

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	Thu Aug 14 13:35:46 2008
@@ -59,10 +59,15 @@
 
 }
 
-void Session::originate(CoreSession *a_leg_session, char *dest, int timeout)
+int Session::originate(CoreSession *a_leg_session, char *dest, int timeout)
 {
-	CoreSession::originate(a_leg_session, dest, timeout);
-	setLUA(L);
+	int x = CoreSession::originate(a_leg_session, dest, timeout);
+
+	if (x) {
+		setLUA(L);
+	}
+
+	return x;
 }
 
 lua_State *Session::getLUA()

Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h	(original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h	Thu Aug 14 13:35:46 2008
@@ -33,7 +33,7 @@
 	void setInputCallback(char *cbfunc, char *funcargs = NULL);
 	void setHangupHook(char *func, char *arg = NULL);
 	bool ready();
-	void originate(CoreSession *a_leg_session, char *dest, int timeout);
+	int originate(CoreSession *a_leg_session, char *dest, int timeout);
 	
 	char *cb_function;
 	char *cb_arg;

Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp	Thu Aug 14 13:35:46 2008
@@ -7438,6 +7438,7 @@
   CoreSession *arg2 = (CoreSession *) 0 ;
   char *arg3 = (char *) 0 ;
   int arg4 ;
+  int result;
   
   SWIG_check_num_args("originate",4,4)
   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *");
@@ -7456,9 +7457,9 @@
   
   arg3 = (char *)lua_tostring(L, 3);
   arg4 = (int)lua_tonumber(L, 4);
-  (arg1)->originate(arg2,arg3,arg4);
+  result = (int)(arg1)->originate(arg2,arg3,arg4);
   SWIG_arg=0;
-  
+  lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
   return SWIG_arg;
   
   if(0) SWIG_fail;



More information about the Freeswitch-svn mailing list