mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-06 04:11:52 +00:00
even more lang stuff
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9063 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -10,7 +10,7 @@ Session::Session():CoreSession()
|
||||
py_init_vars();
|
||||
}
|
||||
|
||||
Session::Session(char *uuid):CoreSession(uuid)
|
||||
Session::Session(char *nuuid, CoreSession *a_leg):CoreSession(nuuid, a_leg)
|
||||
{
|
||||
py_init_vars();
|
||||
}
|
||||
@@ -59,6 +59,9 @@ bool Session::begin_allow_threads()
|
||||
|
||||
if (!TS) {
|
||||
TS = PyEval_SaveThread();
|
||||
if (channel) {
|
||||
switch_channel_set_private(channel, "SwapInThreadState", TS);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -75,6 +78,10 @@ bool Session::end_allow_threads()
|
||||
PyEval_RestoreThread(TS);
|
||||
TS = NULL;
|
||||
|
||||
if (channel) {
|
||||
switch_channel_set_private(channel, "SwapInThreadState", NULL);
|
||||
}
|
||||
|
||||
do_hangup_hook();
|
||||
|
||||
return true;
|
||||
|
||||
@@ -20,7 +20,7 @@ class Session : public CoreSession {
|
||||
PyThreadState *TS;
|
||||
public:
|
||||
Session();
|
||||
Session(char *uuid);
|
||||
Session(char *nuuid, CoreSession *a_leg = NULL);
|
||||
Session(switch_core_session_t *session);
|
||||
virtual ~Session();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- mod_python_wrap.cpp 2008-07-10 13:14:21.000000000 -0500
|
||||
+++ old.cpp 2008-07-10 13:13:57.000000000 -0500
|
||||
@@ -8150,20 +8150,20 @@
|
||||
--- mod_python_wrap.cpp 2008-07-16 17:05:18.000000000 -0400
|
||||
+++ old.cpp 2008-07-16 17:05:07.000000000 -0400
|
||||
@@ -8621,20 +8621,20 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,28 @@
|
||||
|
||||
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
CoreSession *arg2 = (CoreSession *) 0 ;
|
||||
@@ -8659,7 +8659,7 @@
|
||||
}
|
||||
arg2 = reinterpret_cast< CoreSession * >(argp2);
|
||||
result = (PYTHON::Session *)new PYTHON::Session(arg1,arg2);
|
||||
- resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 );
|
||||
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 ); result->setPython(self);
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
return resultobj;
|
||||
fail:
|
||||
@@ -8668,7 +8668,7 @@
|
||||
}
|
||||
|
||||
|
||||
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
PYTHON::Session *result = 0 ;
|
||||
@@ -8179,7 +8179,7 @@
|
||||
@@ -8684,7 +8684,7 @@
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
result = (PYTHON::Session *)new PYTHON::Session(arg1);
|
||||
@@ -33,16 +51,16 @@
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
return resultobj;
|
||||
fail:
|
||||
@@ -8188,7 +8188,7 @@
|
||||
@@ -8693,7 +8693,7 @@
|
||||
}
|
||||
|
||||
|
||||
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
|
||||
-SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
+SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||
PYTHON::Session *result = 0 ;
|
||||
@@ -8203,7 +8203,7 @@
|
||||
@@ -8708,7 +8708,7 @@
|
||||
}
|
||||
arg1 = reinterpret_cast< switch_core_session_t * >(argp1);
|
||||
result = (PYTHON::Session *)new PYTHON::Session(arg1);
|
||||
|
||||
@@ -8635,6 +8635,40 @@ fail:
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_Session__SWIG_1(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
CoreSession *arg2 = (CoreSession *) 0 ;
|
||||
PYTHON::Session *result = 0 ;
|
||||
int res1 ;
|
||||
char *buf1 = 0 ;
|
||||
int alloc1 = 0 ;
|
||||
void *argp2 = 0 ;
|
||||
int res2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:new_Session",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Session" "', argument " "1"" of type '" "char *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< char * >(buf1);
|
||||
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CoreSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Session" "', argument " "2"" of type '" "CoreSession *""'");
|
||||
}
|
||||
arg2 = reinterpret_cast< CoreSession * >(argp2);
|
||||
result = (PYTHON::Session *)new PYTHON::Session(arg1,arg2);
|
||||
resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PYTHON__Session, SWIG_POINTER_NEW | 0 ); result->setPython(self);
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
return resultobj;
|
||||
fail:
|
||||
if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
char *arg1 = (char *) 0 ;
|
||||
PYTHON::Session *result = 0 ;
|
||||
@@ -8659,7 +8693,7 @@ fail:
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_Session__SWIG_2(PyObject *self, PyObject *args) {
|
||||
SWIGINTERN PyObject *_wrap_new_Session__SWIG_3(PyObject *self, PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
|
||||
PYTHON::Session *result = 0 ;
|
||||
@@ -8683,12 +8717,12 @@ fail:
|
||||
|
||||
SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
|
||||
int argc;
|
||||
PyObject *argv[2];
|
||||
PyObject *argv[3];
|
||||
int ii;
|
||||
|
||||
if (!PyTuple_Check(args)) SWIG_fail;
|
||||
argc = (int)PyObject_Length(args);
|
||||
for (ii = 0; (ii < argc) && (ii < 1); ii++) {
|
||||
for (ii = 0; (ii < argc) && (ii < 2); ii++) {
|
||||
argv[ii] = PyTuple_GET_ITEM(args,ii);
|
||||
}
|
||||
if (argc == 0) {
|
||||
@@ -8700,7 +8734,7 @@ SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
|
||||
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_switch_core_session_t, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_Session__SWIG_2(self, args);
|
||||
return _wrap_new_Session__SWIG_3(self, args);
|
||||
}
|
||||
}
|
||||
if (argc == 1) {
|
||||
@@ -8708,7 +8742,20 @@ SWIGINTERN PyObject *_wrap_new_Session(PyObject *self, PyObject *args) {
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_Session__SWIG_1(self, args);
|
||||
return _wrap_new_Session__SWIG_2(self, args);
|
||||
}
|
||||
}
|
||||
if (argc == 2) {
|
||||
int _v;
|
||||
int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
void *vptr = 0;
|
||||
int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CoreSession, 0);
|
||||
_v = SWIG_CheckState(res);
|
||||
if (_v) {
|
||||
return _wrap_new_Session__SWIG_1(self, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8716,6 +8763,7 @@ fail:
|
||||
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Session'.\n"
|
||||
" Possible C/C++ prototypes are:\n"
|
||||
" PYTHON::Session()\n"
|
||||
" PYTHON::Session(char *,CoreSession *)\n"
|
||||
" PYTHON::Session(char *)\n"
|
||||
" PYTHON::Session(switch_core_session_t *)\n");
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user