add some methods to CoreSession

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8352 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-10 17:02:43 +00:00
parent 0e6bb5f606
commit a5e10ebcb9
10 changed files with 403 additions and 86 deletions

View File

@ -160,6 +160,7 @@ class CoreSession {
switch_input_args_t *ap; // ptr to args .. (is this really needed?) switch_input_args_t *ap; // ptr to args .. (is this really needed?)
switch_caller_profile_t caller_profile; // avoid passing so many args to originate, switch_caller_profile_t caller_profile; // avoid passing so many args to originate,
// instead set them here first // instead set them here first
char *xml_cdr_text;
char *uuid; char *uuid;
char *tts_name; char *tts_name;
char *voice_name; char *voice_name;
@ -309,6 +310,9 @@ class CoreSession {
SWITCH_DECLARE(void) sendEvent(Event *sendME); SWITCH_DECLARE(void) sendEvent(Event *sendME);
SWITCH_DECLARE(void) CoreSession::setEventData(Event *e);
SWITCH_DECLARE(char *) CoreSession::getXMLCDR();
virtual bool begin_allow_threads() = 0; virtual bool begin_allow_threads() = 0;
virtual bool end_allow_threads() = 0; virtual bool end_allow_threads() = 0;

View File

@ -213,6 +213,14 @@ public class CoreSession {
freeswitchJNI.CoreSession_sendEvent(swigCPtr, this, Event.getCPtr(sendME), sendME); freeswitchJNI.CoreSession_sendEvent(swigCPtr, this, Event.getCPtr(sendME), sendME);
} }
public void setEventData(Event e) {
freeswitchJNI.CoreSession_setEventData(swigCPtr, this, Event.getCPtr(e), e);
}
public String getXMLCDR() {
return freeswitchJNI.CoreSession_getXMLCDR(swigCPtr, this);
}
public boolean begin_allow_threads() { public boolean begin_allow_threads() {
return freeswitchJNI.CoreSession_begin_allow_threads(swigCPtr, this); return freeswitchJNI.CoreSession_begin_allow_threads(swigCPtr, this);
} }

View File

@ -104,6 +104,8 @@ class freeswitchJNI {
public final static native boolean CoreSession_ready(long jarg1, CoreSession jarg1_); public final static native boolean CoreSession_ready(long jarg1, CoreSession jarg1_);
public final static native void CoreSession_execute(long jarg1, CoreSession jarg1_, String jarg2, String jarg3); public final static native void CoreSession_execute(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
public final static native void CoreSession_sendEvent(long jarg1, CoreSession jarg1_, long jarg2, Event jarg2_); public final static native void CoreSession_sendEvent(long jarg1, CoreSession jarg1_, long jarg2, Event jarg2_);
public final static native void CoreSession_setEventData(long jarg1, CoreSession jarg1_, long jarg2, Event jarg2_);
public final static native String CoreSession_getXMLCDR(long jarg1, CoreSession jarg1_);
public final static native boolean CoreSession_begin_allow_threads(long jarg1, CoreSession jarg1_); public final static native boolean CoreSession_begin_allow_threads(long jarg1, CoreSession jarg1_);
public final static native boolean CoreSession_end_allow_threads(long jarg1, CoreSession jarg1_); public final static native boolean CoreSession_end_allow_threads(long jarg1, CoreSession jarg1_);
public final static native String CoreSession_get_uuid(long jarg1, CoreSession jarg1_); public final static native String CoreSession_get_uuid(long jarg1, CoreSession jarg1_);

View File

@ -2022,6 +2022,35 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1send
} }
SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1setEventData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
CoreSession *arg1 = (CoreSession *) 0 ;
Event *arg2 = (Event *) 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
(void)jarg2_;
arg1 = *(CoreSession **)&jarg1;
arg2 = *(Event **)&jarg2;
(arg1)->setEventData(arg2);
}
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1getXMLCDR(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jstring jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
char *result = 0 ;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(CoreSession **)&jarg1;
result = (char *)(arg1)->getXMLCDR();
if(result) jresult = jenv->NewStringUTF((const char *)result);
return jresult;
}
SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1begin_1allow_1threads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1begin_1allow_1threads(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jboolean jresult = 0 ; jboolean jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;

View File

@ -4726,6 +4726,62 @@ fail:
} }
static int _wrap_CoreSession_setEventData(lua_State* L) {
int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ;
Event *arg2 = (Event *) 0 ;
SWIG_check_num_args("setEventData",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setEventData",1,"CoreSession *");
if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("setEventData",2,"Event *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_setEventData",1,SWIGTYPE_p_CoreSession);
}
if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Event,0))){
SWIG_fail_ptr("CoreSession_setEventData",2,SWIGTYPE_p_Event);
}
(arg1)->setEventData(arg2);
SWIG_arg=0;
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_CoreSession_getXMLCDR(lua_State* L) {
int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ;
char *result = 0 ;
SWIG_check_num_args("getXMLCDR",1,1)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getXMLCDR",1,"CoreSession *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_getXMLCDR",1,SWIGTYPE_p_CoreSession);
}
result = (char *)(arg1)->getXMLCDR();
SWIG_arg=0;
lua_pushstring(L,(const char*)result); SWIG_arg++;
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_CoreSession_begin_allow_threads(lua_State* L) { static int _wrap_CoreSession_begin_allow_threads(lua_State* L) {
int SWIG_arg = -1; int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;
@ -4924,6 +4980,8 @@ static swig_lua_method swig_CoreSession_methods[] = {
{"ready", _wrap_CoreSession_ready}, {"ready", _wrap_CoreSession_ready},
{"execute", _wrap_CoreSession_execute}, {"execute", _wrap_CoreSession_execute},
{"sendEvent", _wrap_CoreSession_sendEvent}, {"sendEvent", _wrap_CoreSession_sendEvent},
{"setEventData", _wrap_CoreSession_setEventData},
{"getXMLCDR", _wrap_CoreSession_getXMLCDR},
{"begin_allow_threads", _wrap_CoreSession_begin_allow_threads}, {"begin_allow_threads", _wrap_CoreSession_begin_allow_threads},
{"end_allow_threads", _wrap_CoreSession_end_allow_threads}, {"end_allow_threads", _wrap_CoreSession_end_allow_threads},
{"get_uuid", _wrap_CoreSession_get_uuid}, {"get_uuid", _wrap_CoreSession_get_uuid},

View File

@ -326,6 +326,8 @@ sub DESTROY {
*ready = *freeswitchc::CoreSession_ready; *ready = *freeswitchc::CoreSession_ready;
*execute = *freeswitchc::CoreSession_execute; *execute = *freeswitchc::CoreSession_execute;
*sendEvent = *freeswitchc::CoreSession_sendEvent; *sendEvent = *freeswitchc::CoreSession_sendEvent;
*setEventData = *freeswitchc::CoreSession_setEventData;
*getXMLCDR = *freeswitchc::CoreSession_getXMLCDR;
*begin_allow_threads = *freeswitchc::CoreSession_begin_allow_threads; *begin_allow_threads = *freeswitchc::CoreSession_begin_allow_threads;
*end_allow_threads = *freeswitchc::CoreSession_end_allow_threads; *end_allow_threads = *freeswitchc::CoreSession_end_allow_threads;
*get_uuid = *freeswitchc::CoreSession_get_uuid; *get_uuid = *freeswitchc::CoreSession_get_uuid;

View File

@ -6243,6 +6243,71 @@ XS(_wrap_CoreSession_sendEvent) {
} }
XS(_wrap_CoreSession_setEventData) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
Event *arg2 = (Event *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: CoreSession_setEventData(self,e);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setEventData" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_Event, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setEventData" "', argument " "2"" of type '" "Event *""'");
}
arg2 = reinterpret_cast< Event * >(argp2);
(arg1)->setEventData(arg2);
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_CoreSession_getXMLCDR) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
SWIG_croak("Usage: CoreSession_getXMLCDR(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getXMLCDR" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
result = (char *)(arg1)->getXMLCDR();
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
XSRETURN(argvi);
fail:
SWIG_croak_null();
}
}
XS(_wrap_CoreSession_begin_allow_threads) { XS(_wrap_CoreSession_begin_allow_threads) {
{ {
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;
@ -7710,6 +7775,8 @@ static swig_command_info swig_commands[] = {
{"freeswitchc::CoreSession_ready", _wrap_CoreSession_ready}, {"freeswitchc::CoreSession_ready", _wrap_CoreSession_ready},
{"freeswitchc::CoreSession_execute", _wrap_CoreSession_execute}, {"freeswitchc::CoreSession_execute", _wrap_CoreSession_execute},
{"freeswitchc::CoreSession_sendEvent", _wrap_CoreSession_sendEvent}, {"freeswitchc::CoreSession_sendEvent", _wrap_CoreSession_sendEvent},
{"freeswitchc::CoreSession_setEventData", _wrap_CoreSession_setEventData},
{"freeswitchc::CoreSession_getXMLCDR", _wrap_CoreSession_getXMLCDR},
{"freeswitchc::CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads}, {"freeswitchc::CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads},
{"freeswitchc::CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads}, {"freeswitchc::CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads},
{"freeswitchc::CoreSession_get_uuid", _wrap_CoreSession_get_uuid}, {"freeswitchc::CoreSession_get_uuid", _wrap_CoreSession_get_uuid},

View File

@ -1,5 +1,5 @@
# This file was automatically generated by SWIG (http://www.swig.org). # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.31 # Version 1.3.35
# #
# Don't modify this file, modify the SWIG interface instead. # Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes. # This file is compatible with both classic and new-style classes.
@ -169,7 +169,7 @@ class CoreSession(_object):
__setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value) __setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value)
__swig_getmethods__ = {} __swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name) __getattr__ = lambda self, name: _swig_getattr(self, CoreSession, name)
def __init__(self): raise AttributeError, "No constructor defined" def __init__(self, *args, **kwargs): raise AttributeError, "No constructor defined"
__repr__ = _swig_repr __repr__ = _swig_repr
__swig_destroy__ = _freeswitch.delete_CoreSession __swig_destroy__ = _freeswitch.delete_CoreSession
__del__ = lambda self : None; __del__ = lambda self : None;
@ -217,6 +217,8 @@ class CoreSession(_object):
def ready(*args): return _freeswitch.CoreSession_ready(*args) def ready(*args): return _freeswitch.CoreSession_ready(*args)
def execute(*args): return _freeswitch.CoreSession_execute(*args) def execute(*args): return _freeswitch.CoreSession_execute(*args)
def sendEvent(*args): return _freeswitch.CoreSession_sendEvent(*args) def sendEvent(*args): return _freeswitch.CoreSession_sendEvent(*args)
def setEventData(*args): return _freeswitch.CoreSession_setEventData(*args)
def getXMLCDR(*args): return _freeswitch.CoreSession_getXMLCDR(*args)
def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args) def begin_allow_threads(*args): return _freeswitch.CoreSession_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args) def end_allow_threads(*args): return _freeswitch.CoreSession_end_allow_threads(*args)
def get_uuid(*args): return _freeswitch.CoreSession_get_uuid(*args) def get_uuid(*args): return _freeswitch.CoreSession_get_uuid(*args)

View File

@ -1,6 +1,6 @@
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org). * This file was automatically generated by SWIG (http://www.swig.org).
* Version 1.3.31 * Version 1.3.35
* *
* This file is not intended to be easily readable and contains a number of * This file is not intended to be easily readable and contains a number of
* coding conventions designed to improve portability and efficiency. Do not make * coding conventions designed to improve portability and efficiency. Do not make
@ -12,7 +12,7 @@
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
#ifdef __cplusplus #ifdef __cplusplus
template<class T> class SwigValueWrapper { template<typename T> class SwigValueWrapper {
T *tt; T *tt;
public: public:
SwigValueWrapper() : tt(0) { } SwigValueWrapper() : tt(0) { }
@ -25,6 +25,10 @@ public:
private: private:
SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
}; };
template <typename T> T SwigValueInit() {
return T();
}
#endif #endif
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
@ -34,12 +38,12 @@ private:
/* template workaround for compilers that cannot correctly implement the C++ standard */ /* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR #ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
# if (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
# define SWIGTEMPLATEDISAMBIGUATOR template # define SWIGTEMPLATEDISAMBIGUATOR template
# else
# define SWIGTEMPLATEDISAMBIGUATOR
# endif
# else # else
# define SWIGTEMPLATEDISAMBIGUATOR # define SWIGTEMPLATEDISAMBIGUATOR
# endif # endif
@ -124,6 +128,12 @@ private:
# define _CRT_SECURE_NO_DEPRECATE # define _CRT_SECURE_NO_DEPRECATE
#endif #endif
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif
/* Python.h has to appear first */ /* Python.h has to appear first */
#include <Python.h> #include <Python.h>
@ -137,7 +147,7 @@ private:
/* This should only be incremented when either the layout of swig_type_info changes, /* This should only be incremented when either the layout of swig_type_info changes,
or for whatever reason, the runtime changes incompatibly */ or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "3" #define SWIG_RUNTIME_VERSION "4"
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE #ifdef SWIG_TYPE_TABLE
@ -172,6 +182,7 @@ private:
/* Flags for pointer conversions */ /* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN 0x1 #define SWIG_POINTER_DISOWN 0x1
#define SWIG_CAST_NEW_MEMORY 0x2
/* Flags for new pointer objects */ /* Flags for new pointer objects */
#define SWIG_POINTER_OWN 0x1 #define SWIG_POINTER_OWN 0x1
@ -312,10 +323,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
extern "C" { extern "C" {
#endif #endif
typedef void *(*swig_converter_func)(void *); typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **); typedef struct swig_type_info *(*swig_dycast_func)(void **);
/* Structure to store inforomation on one type */ /* Structure to store information on one type */
typedef struct swig_type_info { typedef struct swig_type_info {
const char *name; /* mangled name of this type */ const char *name; /* mangled name of this type */
const char *str; /* human readable name of this type */ const char *str; /* human readable name of this type */
@ -360,7 +371,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
while ((*f2 == ' ') && (f2 != l2)) ++f2; while ((*f2 == ' ') && (f2 != l2)) ++f2;
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
} }
return (l1 - f1) - (l2 - f2); return (int)((l1 - f1) - (l2 - f2));
} }
/* /*
@ -442,8 +453,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
Cast a pointer up an inheritance hierarchy Cast a pointer up an inheritance hierarchy
*/ */
SWIGRUNTIMEINLINE void * SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr) { SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
} }
/* /*
@ -867,7 +878,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
Py_DECREF(old_str); Py_DECREF(old_str);
Py_DECREF(value); Py_DECREF(value);
} else { } else {
PyErr_Format(PyExc_RuntimeError, mesg); PyErr_SetString(PyExc_RuntimeError, mesg);
} }
} }
@ -1107,14 +1118,14 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
/* Unpack the argument tuple */ /* Unpack the argument tuple */
SWIGINTERN int SWIGINTERN int
SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs) SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
{ {
if (!args) { if (!args) {
if (!min && !max) { if (!min && !max) {
return 1; return 1;
} else { } else {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
name, (min == max ? "" : "at least "), min); name, (min == max ? "" : "at least "), (int)min);
return 0; return 0;
} }
} }
@ -1122,14 +1133,14 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyOb
PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
return 0; return 0;
} else { } else {
register int l = PyTuple_GET_SIZE(args); register Py_ssize_t l = PyTuple_GET_SIZE(args);
if (l < min) { if (l < min) {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
name, (min == max ? "" : "at least "), min, l); name, (min == max ? "" : "at least "), (int)min, (int)l);
return 0; return 0;
} else if (l > max) { } else if (l > max) {
PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
name, (min == max ? "" : "at most "), max, l); name, (min == max ? "" : "at most "), (int)max, (int)l);
return 0; return 0;
} else { } else {
register int i; register int i;
@ -1427,7 +1438,7 @@ PySwigObject_dealloc(PyObject *v)
{ {
PySwigObject *sobj = (PySwigObject *) v; PySwigObject *sobj = (PySwigObject *) v;
PyObject *next = sobj->next; PyObject *next = sobj->next;
if (sobj->own) { if (sobj->own == SWIG_POINTER_OWN) {
swig_type_info *ty = sobj->ty; swig_type_info *ty = sobj->ty;
PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
PyObject *destroy = data ? data->destroy : 0; PyObject *destroy = data ? data->destroy : 0;
@ -1445,12 +1456,13 @@ PySwigObject_dealloc(PyObject *v)
res = ((*meth)(mself, v)); res = ((*meth)(mself, v));
} }
Py_XDECREF(res); Py_XDECREF(res);
} else {
const char *name = SWIG_TypePrettyName(ty);
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
#endif
} }
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
else {
const char *name = SWIG_TypePrettyName(ty);
printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
}
#endif
} }
Py_XDECREF(next); Py_XDECREF(next);
PyObject_DEL(v); PyObject_DEL(v);
@ -1608,9 +1620,11 @@ _PySwigObject_type(void) {
(unaryfunc)0, /*nb_float*/ (unaryfunc)0, /*nb_float*/
(unaryfunc)PySwigObject_oct, /*nb_oct*/ (unaryfunc)PySwigObject_oct, /*nb_oct*/
(unaryfunc)PySwigObject_hex, /*nb_hex*/ (unaryfunc)PySwigObject_hex, /*nb_hex*/
#if PY_VERSION_HEX >= 0x02020000 #if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
#elif PY_VERSION_HEX >= 0x02000000 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
#endif #endif
}; };
@ -1953,7 +1967,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
SWIGRUNTIME int SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject *obj, int own) { SWIG_Python_AcquirePtr(PyObject *obj, int own) {
if (own) { if (own == SWIG_POINTER_OWN) {
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
if (sobj) { if (sobj) {
int oldown = sobj->own; int oldown = sobj->own;
@ -1974,6 +1988,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
return SWIG_OK; return SWIG_OK;
} else { } else {
PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
if (own)
*own = 0;
while (sobj) { while (sobj) {
void *vptr = sobj->ptr; void *vptr = sobj->ptr;
if (ty) { if (ty) {
@ -1987,7 +2003,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
if (!tc) { if (!tc) {
sobj = (PySwigObject *)sobj->next; sobj = (PySwigObject *)sobj->next;
} else { } else {
if (ptr) *ptr = SWIG_TypeCast(tc,vptr); if (ptr) {
int newmemory = 0;
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
if (newmemory == SWIG_CAST_NEW_MEMORY) {
assert(own);
if (own)
*own = *own | SWIG_CAST_NEW_MEMORY;
}
}
break; break;
} }
} }
@ -1997,7 +2021,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
} }
} }
if (sobj) { if (sobj) {
if (own) *own = sobj->own; if (own)
*own = *own | sobj->own;
if (flags & SWIG_POINTER_DISOWN) { if (flags & SWIG_POINTER_DISOWN) {
sobj->own = 0; sobj->own = 0;
} }
@ -2062,8 +2087,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
} }
if (ty) { if (ty) {
swig_cast_info *tc = SWIG_TypeCheck(desc,ty); swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
if (!tc) return SWIG_ERROR; if (tc) {
*ptr = SWIG_TypeCast(tc,vptr); int newmemory = 0;
*ptr = SWIG_TypeCast(tc,vptr,&newmemory);
assert(!newmemory); /* newmemory handling not yet implemented */
} else {
return SWIG_ERROR;
}
} else { } else {
*ptr = vptr; *ptr = vptr;
} }
@ -2505,7 +2535,7 @@ static swig_module_info swig_module = {swig_types, 20, 0, 0, 0, 0};
#define SWIG_name "_freeswitch" #define SWIG_name "_freeswitch"
#define SWIGVERSION 0x010331 #define SWIGVERSION 0x010335
#define SWIG_VERSION SWIGVERSION #define SWIG_VERSION SWIGVERSION
@ -2533,7 +2563,9 @@ namespace swig {
PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj)
{ {
if (initial_ref) Py_XINCREF(_obj); if (initial_ref) {
Py_XINCREF(_obj);
}
} }
PyObject_ptr & operator=(const PyObject_ptr& item) PyObject_ptr & operator=(const PyObject_ptr& item)
@ -2649,14 +2681,12 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
#include <limits.h> #include <limits.h>
#ifndef LLONG_MIN #if !defined(SWIG_NO_LLONG_MAX)
# define LLONG_MIN LONG_LONG_MIN # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
#endif # define LLONG_MAX __LONG_LONG_MAX__
#ifndef LLONG_MAX # define LLONG_MIN (-LLONG_MAX - 1LL)
# define LLONG_MAX LONG_LONG_MAX # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
#endif # endif
#ifndef ULLONG_MAX
# define ULLONG_MAX ULONG_LONG_MAX
#endif #endif
@ -2914,18 +2944,11 @@ SWIG_From_unsigned_SS_int (unsigned int value)
SWIGINTERN int SWIGINTERN int
SWIG_AsVal_bool (PyObject *obj, bool *val) SWIG_AsVal_bool (PyObject *obj, bool *val)
{ {
if (obj == Py_True) { int r = PyObject_IsTrue(obj);
if (val) *val = true; if (r == -1)
return SWIG_ERROR;
if (val) *val = r ? true : false;
return SWIG_OK; return SWIG_OK;
} else if (obj == Py_False) {
if (val) *val = false;
return SWIG_OK;
} else {
long v = 0;
int res = SWIG_AddCast(SWIG_AsVal_long (obj, val ? &v : 0));
if (SWIG_IsOK(res) && val) *val = v ? true : false;
return res;
}
} }
#ifdef __cplusplus #ifdef __cplusplus
@ -3265,7 +3288,7 @@ fail:
SWIGINTERN PyObject *IVRMenu_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *IVRMenu_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_IVRMenu, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_IVRMenu, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -3387,7 +3410,7 @@ fail:
SWIGINTERN PyObject *API_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *API_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_API, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_API, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -3643,7 +3666,7 @@ fail:
SWIGINTERN PyObject *input_callback_state_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *input_callback_state_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_input_callback_state, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_input_callback_state, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -3689,7 +3712,7 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 1); ii++) { for (ii = 0; (ii < argc) && (ii < 1); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -3707,7 +3730,10 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Stream'.\n Possible C/C++ prototypes are:\n Stream()\n Stream(switch_stream_handle_t *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Stream'.\n"
" Possible C/C++ prototypes are:\n"
" Stream()\n"
" Stream(switch_stream_handle_t *)\n");
return NULL; return NULL;
} }
@ -3791,7 +3817,7 @@ fail:
SWIGINTERN PyObject *Stream_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *Stream_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_Stream, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_Stream, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -4084,7 +4110,7 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 2); ii++) { for (ii = 0; (ii < argc) && (ii < 2); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -4134,7 +4160,12 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Event'.\n Possible C/C++ prototypes are:\n Event(char const *,char const *)\n Event(char const *)\n Event(switch_event_t *,int)\n Event(switch_event_t *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Event'.\n"
" Possible C/C++ prototypes are:\n"
" Event(char const *,char const *)\n"
" Event(char const *)\n"
" Event(switch_event_t *,int)\n"
" Event(switch_event_t *)\n");
return NULL; return NULL;
} }
@ -4223,7 +4254,7 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 2); ii++) { for (ii = 0; (ii < argc) && (ii < 2); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -4251,7 +4282,10 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Event_serialize'.\n Possible C/C++ prototypes are:\n serialize(char const *)\n serialize()\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Event_serialize'.\n"
" Possible C/C++ prototypes are:\n"
" serialize(Event *,char const *)\n"
" serialize(Event *)\n");
return NULL; return NULL;
} }
@ -4323,7 +4357,7 @@ SWIGINTERN PyObject *_wrap_Event_setPriority(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 2); ii++) { for (ii = 0; (ii < argc) && (ii < 2); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -4351,7 +4385,10 @@ SWIGINTERN PyObject *_wrap_Event_setPriority(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Event_setPriority'.\n Possible C/C++ prototypes are:\n setPriority(switch_priority_t)\n setPriority()\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Event_setPriority'.\n"
" Possible C/C++ prototypes are:\n"
" setPriority(Event *,switch_priority_t)\n"
" setPriority(Event *)\n");
return NULL; return NULL;
} }
@ -4572,7 +4609,7 @@ fail:
SWIGINTERN PyObject *Event_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *Event_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_Event, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_Event, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -5029,7 +5066,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 2); ii++) { for (ii = 0; (ii < argc) && (ii < 2); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -5057,7 +5094,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_hangup'.\n Possible C/C++ prototypes are:\n hangup(char *)\n hangup()\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_hangup'.\n"
" Possible C/C++ prototypes are:\n"
" hangup(CoreSession *,char *)\n"
" hangup(CoreSession *)\n");
return NULL; return NULL;
} }
@ -5411,7 +5451,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *self, PyObject *args
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 5); ii++) { for (ii = 0; (ii < argc) && (ii < 5); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -5505,7 +5545,12 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *self, PyObject *args
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_recordFile'.\n Possible C/C++ prototypes are:\n recordFile(char *,int,int,int)\n recordFile(char *,int,int)\n recordFile(char *,int)\n recordFile(char *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_recordFile'.\n"
" Possible C/C++ prototypes are:\n"
" recordFile(CoreSession *,char *,int,int,int)\n"
" recordFile(CoreSession *,char *,int,int)\n"
" recordFile(CoreSession *,char *,int)\n"
" recordFile(CoreSession *,char *)\n");
return NULL; return NULL;
} }
@ -5656,7 +5701,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *self, PyObject *args)
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 4); ii++) { for (ii = 0; (ii < argc) && (ii < 4); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -5704,7 +5749,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *self, PyObject *args)
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_originate'.\n Possible C/C++ prototypes are:\n originate(CoreSession *,char *,int)\n originate(CoreSession *,char *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_originate'.\n"
" Possible C/C++ prototypes are:\n"
" originate(CoreSession *,CoreSession *,char *,int)\n"
" originate(CoreSession *,CoreSession *,char *)\n");
return NULL; return NULL;
} }
@ -6231,7 +6279,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *self, PyObject *args
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 3); ii++) { for (ii = 0; (ii < argc) && (ii < 3); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -6269,7 +6317,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *self, PyObject *args
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_streamFile'.\n Possible C/C++ prototypes are:\n streamFile(char *,int)\n streamFile(char *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'CoreSession_streamFile'.\n"
" Possible C/C++ prototypes are:\n"
" streamFile(CoreSession *,char *,int)\n"
" streamFile(CoreSession *,char *)\n");
return NULL; return NULL;
} }
@ -6474,6 +6525,58 @@ fail:
} }
SWIGINTERN PyObject *_wrap_CoreSession_setEventData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
Event *arg2 = (Event *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
void *argp2 = 0 ;
int res2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_setEventData",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setEventData" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Event, 0 | 0 );
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_setEventData" "', argument " "2"" of type '" "Event *""'");
}
arg2 = reinterpret_cast< Event * >(argp2);
(arg1)->setEventData(arg2);
resultobj = SWIG_Py_Void();
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_CoreSession_getXMLCDR(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *result = 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject * obj0 = 0 ;
if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_getXMLCDR",&obj0)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_getXMLCDR" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
result = (char *)(arg1)->getXMLCDR();
resultobj = SWIG_FromCharPtr((const char *)result);
return resultobj;
fail:
return NULL;
}
SWIGINTERN PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *_wrap_CoreSession_begin_allow_threads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0; PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ; CoreSession *arg1 = (CoreSession *) 0 ;
@ -6634,7 +6737,7 @@ fail:
SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_CoreSession, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_CoreSession, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -6885,7 +6988,7 @@ SWIGINTERN PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) {
int ii; int ii;
if (!PyTuple_Check(args)) SWIG_fail; if (!PyTuple_Check(args)) SWIG_fail;
argc = PyObject_Length(args); argc = (int)PyObject_Length(args);
for (ii = 0; (ii < argc) && (ii < 1); ii++) { for (ii = 0; (ii < argc) && (ii < 1); ii++) {
argv[ii] = PyTuple_GET_ITEM(args,ii); argv[ii] = PyTuple_GET_ITEM(args,ii);
} }
@ -6911,7 +7014,11 @@ SWIGINTERN PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) {
} }
fail: fail:
SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_PySession'.\n Possible C/C++ prototypes are:\n PySession()\n PySession(char *)\n PySession(switch_core_session_t *)\n"); SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_PySession'.\n"
" Possible C/C++ prototypes are:\n"
" PySession()\n"
" PySession(char *)\n"
" PySession(switch_core_session_t *)\n");
return NULL; return NULL;
} }
@ -7144,7 +7251,7 @@ fail:
SWIGINTERN PyObject *PySession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { SWIGINTERN PyObject *PySession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj; PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
SWIG_TypeNewClientData(SWIGTYPE_p_PySession, SWIG_NewClientData(obj)); SWIG_TypeNewClientData(SWIGTYPE_p_PySession, SWIG_NewClientData(obj));
return SWIG_Py_Void(); return SWIG_Py_Void();
} }
@ -7235,6 +7342,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"CoreSession_ready", _wrap_CoreSession_ready, METH_VARARGS, NULL}, { (char *)"CoreSession_ready", _wrap_CoreSession_ready, METH_VARARGS, NULL},
{ (char *)"CoreSession_execute", _wrap_CoreSession_execute, METH_VARARGS, NULL}, { (char *)"CoreSession_execute", _wrap_CoreSession_execute, METH_VARARGS, NULL},
{ (char *)"CoreSession_sendEvent", _wrap_CoreSession_sendEvent, METH_VARARGS, NULL}, { (char *)"CoreSession_sendEvent", _wrap_CoreSession_sendEvent, METH_VARARGS, NULL},
{ (char *)"CoreSession_setEventData", _wrap_CoreSession_setEventData, METH_VARARGS, NULL},
{ (char *)"CoreSession_getXMLCDR", _wrap_CoreSession_getXMLCDR, METH_VARARGS, NULL},
{ (char *)"CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads, METH_VARARGS, NULL}, { (char *)"CoreSession_begin_allow_threads", _wrap_CoreSession_begin_allow_threads, METH_VARARGS, NULL},
{ (char *)"CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads, METH_VARARGS, NULL}, { (char *)"CoreSession_end_allow_threads", _wrap_CoreSession_end_allow_threads, METH_VARARGS, NULL},
{ (char *)"CoreSession_get_uuid", _wrap_CoreSession_get_uuid, METH_VARARGS, NULL}, { (char *)"CoreSession_get_uuid", _wrap_CoreSession_get_uuid, METH_VARARGS, NULL},
@ -7263,7 +7372,7 @@ static PyMethodDef SwigMethods[] = {
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
static void *_p_PySessionTo_p_CoreSession(void *x) { static void *_p_PySessionTo_p_CoreSession(void *x, int *newmemory) {
return (void *)((CoreSession *) ((PySession *) x)); return (void *)((CoreSession *) ((PySession *) x));
} }
static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)0, 0};
@ -7273,7 +7382,7 @@ static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (voi
static swig_type_info _swigt__p_PySession = {"_p_PySession", "PySession *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PySession = {"_p_PySession", "PySession *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_session_flag_t = {"_p_session_flag_t", "enum session_flag_t *|session_flag_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_swap_state_t = {"_p_swap_state_t", "enum swap_state_t *|swap_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_swap_state_t = {"_p_swap_state_t", "enum swap_state_t *|swap_state_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_channel_state_t = {"_p_switch_channel_state_t", "switch_channel_state_t *", 0, 0, (void*)0, 0};
@ -7420,7 +7529,7 @@ SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) { SWIG_InitializeModule(void *clientdata) {
size_t i; size_t i;
swig_module_info *module_head, *iter; swig_module_info *module_head, *iter;
int found; int found, init;
clientdata = clientdata; clientdata = clientdata;
@ -7430,6 +7539,9 @@ SWIG_InitializeModule(void *clientdata) {
swig_module.type_initial = swig_type_initial; swig_module.type_initial = swig_type_initial;
swig_module.cast_initial = swig_cast_initial; swig_module.cast_initial = swig_cast_initial;
swig_module.next = &swig_module; swig_module.next = &swig_module;
init = 1;
} else {
init = 0;
} }
/* Try and load any already created modules */ /* Try and load any already created modules */
@ -7458,6 +7570,12 @@ SWIG_InitializeModule(void *clientdata) {
module_head->next = &swig_module; module_head->next = &swig_module;
} }
/* When multiple interpeters are used, a module could have already been initialized in
a different interpreter, but not yet have a pointer in this interpreter.
In this case, we do not want to continue adding types... everything should be
set up already */
if (init == 0) return;
/* Now work on filling in swig_module.types */ /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG #ifdef SWIGRUNTIME_DEBUG
printf("SWIG_InitializeModule: size %d\n", swig_module.size); printf("SWIG_InitializeModule: size %d\n", swig_module.size);

View File

@ -382,11 +382,38 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::~CoreSession()
switch_core_session_rwunlock(session); switch_core_session_rwunlock(session);
} }
switch_safe_free(xml_cdr_text);
switch_safe_free(uuid); switch_safe_free(uuid);
switch_safe_free(tts_name); switch_safe_free(tts_name);
switch_safe_free(voice_name); switch_safe_free(voice_name);
} }
SWITCH_DECLARE(char *) CoreSession::getXMLCDR()
{
switch_xml_t cdr;
sanity_check("");
switch_safe_free(xml_cdr_text);
if (switch_ivr_generate_xml_cdr(session, &cdr) == SWITCH_STATUS_SUCCESS) {
xml_cdr_text = switch_xml_toxml(cdr, SWITCH_FALSE);
switch_xml_free(cdr);
}
return (char *) (xml_cdr_text ? xml_cdr_text : "");
}
SWITCH_DECLARE(void) CoreSession::setEventData(Event *e)
{
sanity_check_noreturn;
if (channel && e->event) {
switch_channel_event_set_data(channel, e->event);
}
}
SWITCH_DECLARE(int) CoreSession::answer() SWITCH_DECLARE(int) CoreSession::answer()
{ {
switch_status_t status; switch_status_t status;