From ec5c366f3061e2f04b5018fbc31929cb82525af5 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Thu, 20 Nov 2008 23:12:15 +0000 Subject: [PATCH] swigall git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10485 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../src/org/freeswitch/swig/freeswitch.java | 4 +++ .../org/freeswitch/swig/freeswitchJNI.java | 1 + .../languages/mod_java/switch_swig_wrap.cpp | 16 ++++++++++ src/mod/languages/mod_lua/mod_lua_wrap.cpp | 27 ++++++++++++++++ .../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 | 32 +++++++++++++++++++ src/mod/languages/mod_python/freeswitch.py | 1 + .../languages/mod_python/mod_python_wrap.cpp | 30 +++++++++++++++++ 10 files changed, 127 insertions(+) diff --git a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java index e56969ef16..c8b05b8ab1 100644 --- a/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java +++ b/src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitch.java @@ -25,6 +25,10 @@ public class freeswitch { freeswitchJNI.console_clean_log(msg); } + public static void msleep(SWIGTYPE_p_uint32_t ms) { + freeswitchJNI.msleep(SWIGTYPE_p_uint32_t.getCPtr(ms)); + } + public static void bridge(CoreSession session_a, CoreSession session_b) { freeswitchJNI.bridge(CoreSession.getCPtr(session_a), session_a, CoreSession.getCPtr(session_b), session_b); } 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 0fc0eb7914..0e50a182fe 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 @@ -158,6 +158,7 @@ class freeswitchJNI { public final static native long CoreSession_run_dtmf_callback(long jarg1, CoreSession jarg1_, long jarg2, long jarg3); public final static native void console_log(String jarg1, String jarg2); public final static native void console_clean_log(String jarg1); + public final static native void msleep(long jarg1); public final static native void bridge(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_); public final static native long hanguphook(long jarg1); public final static native long dtmf_callback(long jarg1, long jarg2, long jarg3, long jarg4, long jarg5); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 4fe6bbe431..e4a391a1d4 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -3032,6 +3032,22 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_console_1clean_1l } +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_msleep(JNIEnv *jenv, jclass jcls, jlong jarg1) { + uint32_t arg1 ; + uint32_t *argp1 ; + + (void)jenv; + (void)jcls; + argp1 = *(uint32_t **)&jarg1; + if (!argp1) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null uint32_t"); + return ; + } + arg1 = *argp1; + msleep(arg1); +} + + SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_bridge(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) { CoreSession *arg1 = 0 ; CoreSession *arg2 = 0 ; diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index cfffa45f7d..433fd1fba6 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -6791,6 +6791,32 @@ fail: } +static int _wrap_msleep(lua_State* L) { + int SWIG_arg = -1; + uint32_t arg1 ; + uint32_t *argp1 ; + + SWIG_check_num_args("msleep",1,1) + if(!lua_isuserdata(L,1)) SWIG_fail_arg("msleep",1,"uint32_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_uint32_t,0))){ + SWIG_fail_ptr("msleep",1,SWIGTYPE_p_uint32_t); + } + arg1 = *argp1; + + msleep(arg1); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_bridge(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = 0 ; @@ -7801,6 +7827,7 @@ static const struct luaL_reg swig_commands[] = { { "consoleCleanLog", _wrap_consoleCleanLog}, { "console_log", _wrap_console_log}, { "console_clean_log", _wrap_console_clean_log}, + { "msleep", _wrap_msleep}, { "bridge", _wrap_bridge}, { "hanguphook", _wrap_hanguphook}, { "dtmf_callback", _wrap_dtmf_callback}, diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index adaff31fa2..b2fc701ce3 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -26839,6 +26839,14 @@ SWIGEXPORT void SWIGSTDCALL CSharp_console_clean_log(char * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_msleep(unsigned long jarg1) { + uint32_t arg1 ; + + arg1 = (uint32_t)jarg1; + msleep(arg1); +} + + SWIGEXPORT void SWIGSTDCALL CSharp_bridge(void * jarg1, void * jarg2) { CoreSession *arg1 = 0 ; CoreSession *arg2 = 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 61ba925c70..57984bb373 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -3856,6 +3856,10 @@ public class freeswitch { freeswitchPINVOKE.console_clean_log(msg); } + public static void msleep(uint ms) { + freeswitchPINVOKE.msleep(ms); + } + public static void bridge(CoreSession session_a, CoreSession session_b) { freeswitchPINVOKE.bridge(CoreSession.getCPtr(session_a), CoreSession.getCPtr(session_b)); if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve(); @@ -10507,6 +10511,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_console_clean_log")] public static extern void console_clean_log(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_msleep")] + public static extern void msleep(uint jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_bridge")] public static extern void bridge(HandleRef jarg1, HandleRef jarg2); diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm index 6b92a1ba03..f422316289 100644 --- a/src/mod/languages/mod_perl/freeswitch.pm +++ b/src/mod/languages/mod_perl/freeswitch.pm @@ -52,6 +52,7 @@ package freeswitch; *consoleCleanLog = *freeswitchc::consoleCleanLog; *console_log = *freeswitchc::console_log; *console_clean_log = *freeswitchc::console_clean_log; +*msleep = *freeswitchc::msleep; *bridge = *freeswitchc::bridge; *hanguphook = *freeswitchc::hanguphook; *dtmf_callback = *freeswitchc::dtmf_callback; diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index a768bb091c..69381edf3e 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -8968,6 +8968,37 @@ XS(_wrap_console_clean_log) { } +XS(_wrap_msleep) { + { + uint32_t arg1 ; + void *argp1 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: msleep(ms);"); + } + { + res1 = SWIG_ConvertPtr(ST(0), &argp1, SWIGTYPE_p_uint32_t, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "msleep" "', argument " "1"" of type '" "uint32_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "msleep" "', argument " "1"" of type '" "uint32_t""'"); + } else { + arg1 = *(reinterpret_cast< uint32_t * >(argp1)); + } + } + msleep(arg1); + + XSRETURN(argvi); + fail: + SWIG_croak_null(); + } +} + + XS(_wrap_bridge) { { CoreSession *arg1 = 0 ; @@ -10656,6 +10687,7 @@ static swig_command_info swig_commands[] = { {"freeswitchc::CoreSession_run_dtmf_callback", _wrap_CoreSession_run_dtmf_callback}, {"freeswitchc::console_log", _wrap_console_log}, {"freeswitchc::console_clean_log", _wrap_console_clean_log}, +{"freeswitchc::msleep", _wrap_msleep}, {"freeswitchc::bridge", _wrap_bridge}, {"freeswitchc::hanguphook", _wrap_hanguphook}, {"freeswitchc::dtmf_callback", _wrap_dtmf_callback}, diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index 01d8a88333..e1af53eba4 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -302,6 +302,7 @@ CoreSession_swigregister(CoreSession) console_log = _freeswitch.console_log console_clean_log = _freeswitch.console_clean_log +msleep = _freeswitch.msleep bridge = _freeswitch.bridge hanguphook = _freeswitch.hanguphook dtmf_callback = _freeswitch.dtmf_callback diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 17c3417870..4e1a66d251 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -8683,6 +8683,35 @@ fail: } +SWIGINTERN PyObject *_wrap_msleep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + uint32_t arg1 ; + void *argp1 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:msleep",&obj0)) SWIG_fail; + { + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_uint32_t, 0 | 0); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "msleep" "', argument " "1"" of type '" "uint32_t""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "msleep" "', argument " "1"" of type '" "uint32_t""'"); + } else { + uint32_t * temp = reinterpret_cast< uint32_t * >(argp1); + arg1 = *temp; + if (SWIG_IsNewObj(res1)) delete temp; + } + } + msleep(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_bridge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = 0 ; @@ -9701,6 +9730,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"CoreSession_swigregister", CoreSession_swigregister, METH_VARARGS, NULL}, { (char *)"console_log", _wrap_console_log, METH_VARARGS, NULL}, { (char *)"console_clean_log", _wrap_console_clean_log, METH_VARARGS, NULL}, + { (char *)"msleep", _wrap_msleep, METH_VARARGS, NULL}, { (char *)"bridge", _wrap_bridge, METH_VARARGS, NULL}, { (char *)"hanguphook", _wrap_hanguphook, METH_VARARGS, NULL}, { (char *)"dtmf_callback", _wrap_dtmf_callback, METH_VARARGS, NULL},