From f4239d95001108397952b34701cb0a51dee9c541 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 4 Nov 2009 23:58:26 +0000 Subject: [PATCH] reswig git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15361 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_cpp.h | 1 + .../src/org/freeswitch/swig/CoreSession.java | 4 +++ .../org/freeswitch/swig/freeswitchJNI.java | 1 + .../languages/mod_java/switch_swig_wrap.cpp | 11 ++++++++ src/mod/languages/mod_lua/mod_lua_wrap.cpp | 25 +++++++++++++++++ .../languages/mod_managed/freeswitch_wrap.cxx | 8 ++++++ src/mod/languages/mod_managed/managed/swig.cs | 7 +++++ src/mod/languages/mod_perl/freeswitch.pm | 1 + src/mod/languages/mod_perl/mod_perl_wrap.cpp | 28 +++++++++++++++++++ src/mod/languages/mod_python/freeswitch.py | 1 + .../languages/mod_python/mod_python_wrap.cpp | 22 +++++++++++++++ src/switch_cpp.cpp | 8 ++++++ 12 files changed, 117 insertions(+) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index 67c86c1e90..5a0b55447d 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -216,6 +216,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg); SWITCH_DECLARE(int) answer(); SWITCH_DECLARE(int) preAnswer(); SWITCH_DECLARE(void) hangup(const char *cause = "normal_clearing"); + SWITCH_DECLARE(void) hangupState(void); SWITCH_DECLARE(void) setVariable(char *var, char *val); SWITCH_DECLARE(void) setPrivate(char *var, void *val); SWITCH_DECLARE(void *) getPrivate(char *var); diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java index 03e7908d0e..0927adb6b8 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java @@ -132,6 +132,10 @@ public class CoreSession { freeswitchJNI.CoreSession_hangup__SWIG_1(swigCPtr, this); } + public void hangupState() { + freeswitchJNI.CoreSession_hangupState(swigCPtr, this); + } + public void setVariable(String var, String val) { freeswitchJNI.CoreSession_setVariable(swigCPtr, this, var, val); } diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java index be31fc0864..84f7794ad3 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java @@ -110,6 +110,7 @@ class freeswitchJNI { public final static native int CoreSession_preAnswer(long jarg1, CoreSession jarg1_); public final static native void CoreSession_hangup__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2); public final static native void CoreSession_hangup__SWIG_1(long jarg1, CoreSession jarg1_); + public final static native void CoreSession_hangupState(long jarg1, CoreSession jarg1_); public final static native void CoreSession_setVariable(long jarg1, CoreSession jarg1_, String jarg2, String jarg3); public final static native void CoreSession_setPrivate(long jarg1, CoreSession jarg1_, String jarg2, long jarg3); public final static native long CoreSession_getPrivate(long jarg1, CoreSession jarg1_, String jarg2); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 40604d6f00..cb030727ec 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -1990,6 +1990,17 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hang } +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hangupState(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + CoreSession *arg1 = (CoreSession *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + (arg1)->hangupState(); +} + + SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1setVariable(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index 98178817c8..626b22c33d 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -4802,6 +4802,30 @@ static int _wrap_CoreSession_hangup(lua_State* L) { } +static int _wrap_CoreSession_hangupState(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + + SWIG_check_num_args("hangupState",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupState",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hangupState",1,SWIGTYPE_p_CoreSession); + } + + (arg1)->hangupState(); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_CoreSession_setVariable(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; @@ -7332,6 +7356,7 @@ static swig_lua_method swig_CoreSession_methods[] = { {"answer", _wrap_CoreSession_answer}, {"preAnswer", _wrap_CoreSession_preAnswer}, {"hangup", _wrap_CoreSession_hangup}, + {"hangupState", _wrap_CoreSession_hangupState}, {"setVariable", _wrap_CoreSession_setVariable}, {"setPrivate", _wrap_CoreSession_setPrivate}, {"getPrivate", _wrap_CoreSession_getPrivate}, diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 956ea89fb8..34bfb0da8a 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -29114,6 +29114,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_Hangup(void * jarg1, char * jarg2 } +SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_hangupState(void * jarg1) { + CoreSession *arg1 = (CoreSession *) 0 ; + + arg1 = (CoreSession *)jarg1; + (arg1)->hangupState(); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_SetVariable(void * jarg1, char * jarg2, char * jarg3) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 35056ca8bc..5465215c27 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -218,6 +218,10 @@ public class CoreSession : IDisposable { freeswitchPINVOKE.CoreSession_Hangup(swigCPtr, cause); } + public void hangupState() { + freeswitchPINVOKE.CoreSession_hangupState(swigCPtr); + } + public void SetVariable(string var, string val) { freeswitchPINVOKE.CoreSession_SetVariable(swigCPtr, var, val); } @@ -11558,6 +11562,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_Hangup")] public static extern void CoreSession_Hangup(HandleRef jarg1, string jarg2); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_hangupState")] + public static extern void CoreSession_hangupState(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_SetVariable")] public static extern void CoreSession_SetVariable(HandleRef jarg1, string jarg2, string jarg3); diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm index ac3b42eaa4..d2f06edee7 100644 --- a/src/mod/languages/mod_perl/freeswitch.pm +++ b/src/mod/languages/mod_perl/freeswitch.pm @@ -404,6 +404,7 @@ sub DESTROY { *answer = *freeswitchc::CoreSession_answer; *preAnswer = *freeswitchc::CoreSession_preAnswer; *hangup = *freeswitchc::CoreSession_hangup; +*hangupState = *freeswitchc::CoreSession_hangupState; *setVariable = *freeswitchc::CoreSession_setVariable; *setPrivate = *freeswitchc::CoreSession_setPrivate; *getPrivate = *freeswitchc::CoreSession_getPrivate; diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 72280857f0..c807de8fe3 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -6045,6 +6045,33 @@ XS(_wrap_CoreSession_hangup) { } +XS(_wrap_CoreSession_hangupState) { + { + CoreSession *arg1 = (CoreSession *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CoreSession_hangupState(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_hangupState" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + (arg1)->hangupState(); + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_CoreSession_setVariable) { { CoreSession *arg1 = (CoreSession *) 0 ; @@ -11679,6 +11706,7 @@ static swig_command_info swig_commands[] = { {"freeswitchc::CoreSession_answer", _wrap_CoreSession_answer}, {"freeswitchc::CoreSession_preAnswer", _wrap_CoreSession_preAnswer}, {"freeswitchc::CoreSession_hangup", _wrap_CoreSession_hangup}, +{"freeswitchc::CoreSession_hangupState", _wrap_CoreSession_hangupState}, {"freeswitchc::CoreSession_setVariable", _wrap_CoreSession_setVariable}, {"freeswitchc::CoreSession_setPrivate", _wrap_CoreSession_setPrivate}, {"freeswitchc::CoreSession_getPrivate", _wrap_CoreSession_getPrivate}, diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index ce45b6ecee..2c777c84f3 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -262,6 +262,7 @@ class CoreSession(_object): def answer(*args): return _freeswitch.CoreSession_answer(*args) def preAnswer(*args): return _freeswitch.CoreSession_preAnswer(*args) def hangup(*args): return _freeswitch.CoreSession_hangup(*args) + def hangupState(*args): return _freeswitch.CoreSession_hangupState(*args) def setVariable(*args): return _freeswitch.CoreSession_setVariable(*args) def setPrivate(*args): return _freeswitch.CoreSession_setPrivate(*args) def getPrivate(*args): return _freeswitch.CoreSession_getPrivate(*args) diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index a74fd39643..1997314d07 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -6368,6 +6368,27 @@ fail: } +SWIGINTERN PyObject *_wrap_CoreSession_hangupState(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_hangupState",&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_hangupState" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + (arg1)->hangupState(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_setVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; @@ -10419,6 +10440,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"CoreSession_answer", _wrap_CoreSession_answer, METH_VARARGS, NULL}, { (char *)"CoreSession_preAnswer", _wrap_CoreSession_preAnswer, METH_VARARGS, NULL}, { (char *)"CoreSession_hangup", _wrap_CoreSession_hangup, METH_VARARGS, NULL}, + { (char *)"CoreSession_hangupState", _wrap_CoreSession_hangupState, METH_VARARGS, NULL}, { (char *)"CoreSession_setVariable", _wrap_CoreSession_setVariable, METH_VARARGS, NULL}, { (char *)"CoreSession_setPrivate", _wrap_CoreSession_setPrivate, METH_VARARGS, NULL}, { (char *)"CoreSession_getPrivate", _wrap_CoreSession_getPrivate, METH_VARARGS, NULL}, diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 094513dac8..b52815128e 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -564,6 +564,14 @@ SWITCH_DECLARE(int) CoreSession::preAnswer() return status == SWITCH_STATUS_SUCCESS ? 1 : 0; } +SWITCH_DECLARE(void) CoreSession::hangupState(void) +{ + sanity_check_noreturn; + this->begin_allow_threads(); + switch_core_session_hangup_state(session); + this->end_allow_threads(); +} + SWITCH_DECLARE(void) CoreSession::hangup(const char *cause) { this_check_void();