[Freeswitch-svn] [commit] r9244 - in freeswitch/trunk/src/mod/languages: mod_lua mod_perl

Freeswitch SVN anthm at freeswitch.org
Mon Aug 11 14:47:30 EDT 2008


Author: anthm
Date: Mon Aug 11 14:47:30 2008
New Revision: 9244

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
   freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp

Log:
tweak for MODLANG-77

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 Aug 11 14:47:30 2008
@@ -50,16 +50,21 @@
 
 void Session::setLUA(lua_State * state)
 {
-	sanity_check_noreturn;
-
 	L = state;
-	if (uuid) {
+
+	if (session && allocated && uuid) {
 		lua_setglobal(L, uuid);
 		lua_getfield(L, LUA_GLOBALSINDEX, uuid);
 	}
 
 }
 
+void Session::originate(CoreSession *a_leg_session, char *dest, int timeout)
+{
+	CoreSession::originate(a_leg_session, dest, timeout);
+	setLUA(L);
+}
+
 lua_State *Session::getLUA()
 {
 	if (!L) {

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	Mon Aug 11 14:47:30 2008
@@ -32,6 +32,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);
 	
 	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	Mon Aug 11 14:47:30 2008
@@ -7264,6 +7264,43 @@
 }
 
 
+static int _wrap_Session_originate(lua_State* L) {
+  int SWIG_arg = -1;
+  LUA::Session *arg1 = (LUA::Session *) 0 ;
+  CoreSession *arg2 = (CoreSession *) 0 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  
+  SWIG_check_num_args("originate",4,4)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("originate",1,"LUA::Session *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("originate",2,"CoreSession *");
+  if(!lua_isstring(L,3)) SWIG_fail_arg("originate",3,"char *");
+  if(!lua_isnumber(L,4)) SWIG_fail_arg("originate",4,"int");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+    SWIG_fail_ptr("Session_originate",1,SWIGTYPE_p_LUA__Session);
+  }
+  
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("Session_originate",2,SWIGTYPE_p_CoreSession);
+  }
+  
+  arg3 = (char *)lua_tostring(L, 3);
+  arg4 = (int)lua_tonumber(L, 4);
+  (arg1)->originate(arg2,arg3,arg4);
+  SWIG_arg=0;
+  
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
 static int _wrap_Session_cb_function_set(lua_State* L) {
   int SWIG_arg = -1;
   LUA::Session *arg1 = (LUA::Session *) 0 ;
@@ -7542,6 +7579,7 @@
     {"setInputCallback", _wrap_Session_setInputCallback}, 
     {"setHangupHook", _wrap_Session_setHangupHook}, 
     {"ready", _wrap_Session_ready}, 
+    {"originate", _wrap_Session_originate}, 
     {"setLUA", _wrap_Session_setLUA}, 
     {0,0}
 };

Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp	(original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp	Mon Aug 11 14:47:30 2008
@@ -72,7 +72,7 @@
 
 void Session::setPERL(PerlInterpreter * pi)
 {
-	sanity_check_noreturn;
+
 	my_perl = pi;
 }
 



More information about the Freeswitch-svn mailing list