]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak for MODLANG-77
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 11 Aug 2008 18:47:30 +0000 (18:47 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 11 Aug 2008 18:47:30 +0000 (18:47 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9244 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/languages/mod_lua/freeswitch_lua.cpp
src/mod/languages/mod_lua/freeswitch_lua.h
src/mod/languages/mod_lua/mod_lua_wrap.cpp
src/mod/languages/mod_perl/freeswitch_perl.cpp

index eb86e66d48829608170972affb4c525c19748451..1e5b8ef2c8418a7117d04f870c6847eab07dee52 100644 (file)
@@ -50,16 +50,21 @@ bool Session::end_allow_threads()
 
 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) {
index 0b9b6dbbcd6c3ee9b611ea1aaa83d83df355fa39..63f5490db92ac5ef6a0db940c1ed472befae7d75 100644 (file)
@@ -32,6 +32,7 @@ class Session : public CoreSession {
        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;
index b8430e5db81dea7c65f54f3de04b1c2a146e2f55..6b0bc44e0b79e020cae4248f54b1a8c70896b086 100644 (file)
@@ -7264,6 +7264,43 @@ fail:
 }
 
 
+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 @@ static swig_lua_method swig_LUA_Session_methods[] = {
     {"setInputCallback", _wrap_Session_setInputCallback}, 
     {"setHangupHook", _wrap_Session_setHangupHook}, 
     {"ready", _wrap_Session_ready}, 
+    {"originate", _wrap_Session_originate}, 
     {"setLUA", _wrap_Session_setLUA}, 
     {0,0}
 };
index 795aa2bec2c6ac69cd0c6bbc129ddb8ae2fb6ce7..ef252fccea2ee497b51d59b52cd5b165987d93c5 100644 (file)
@@ -72,7 +72,7 @@ bool Session::end_allow_threads()
 
 void Session::setPERL(PerlInterpreter * pi)
 {
-       sanity_check_noreturn;
+
        my_perl = pi;
 }