From c54f0c394522dedd35e214ed545edec7ad2ae357 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 17 Sep 2009 23:28:38 +0000 Subject: [PATCH] add session.hangupCause() git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14912 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_cpp.h | 5 +- .../src/org/freeswitch/swig/CoreSession.java | 12 ++ .../org/freeswitch/swig/freeswitchJNI.java | 3 + .../languages/mod_java/switch_swig_wrap.cpp | 50 ++++++ src/mod/languages/mod_lua/mod_lua_wrap.cpp | 128 +++++++++++++-- .../languages/mod_managed/freeswitch_wrap.cxx | 141 +++++++++++++++++ src/mod/languages/mod_managed/managed/swig.cs | 102 +++++++++++- src/mod/languages/mod_perl/freeswitch.pm | 3 + src/mod/languages/mod_perl/mod_perl_wrap.cpp | 146 +++++++++++++++--- src/mod/languages/mod_python/freeswitch.py | 4 + .../languages/mod_python/mod_python_wrap.cpp | 125 +++++++++++++-- src/switch_cpp.cpp | 7 +- 12 files changed, 668 insertions(+), 58 deletions(-) diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index a143b0616b..4c690db6cb 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -37,7 +37,8 @@ extern "C" { on_hangup = NULL; \ memset(&cb_state, 0, sizeof(cb_state)); \ hook_state = CS_NEW; \ - fhp = NULL + fhp = NULL; \ + cause = SWITCH_CAUSE_NONE //// C++ Interface: switch_to_cpp_mempool//// Description: This class allows for overloading the new operator to allocate from a switch_memory_pool_t//// Author: Yossi Neiman , (C) 2007//// Copyright: See COPYING file that comes with this distribution// #if 0 @@ -218,6 +219,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg); input_callback_state cb_state; // callback state, always pointed to by the buf // field in this->args switch_channel_state_t hook_state; // store hookstate for on_hangup callback + switch_call_cause_t cause; char *uuid; char *tts_name; @@ -233,6 +235,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg); SWITCH_DECLARE(switch_status_t) process_callback_result(char *result); SWITCH_DECLARE(void) say(const char *tosay, const char *module_name, const char *say_type, const char *say_method); SWITCH_DECLARE(void) sayPhrase(const char *phrase_name, const char *phrase_data = "", const char *phrase_lang = NULL); + SWITCH_DECLARE(const char *) hangupCause(); /** \brief Record to a file * \param file_name 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 b7107aa219..ec3de3b9b4 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 @@ -84,6 +84,14 @@ public class CoreSession { return new SWIGTYPE_p_switch_channel_state_t(freeswitchJNI.CoreSession_hook_state_get(swigCPtr, this), true); } + public void setCause(SWIGTYPE_p_switch_call_cause_t value) { + freeswitchJNI.CoreSession_cause_set(swigCPtr, this, SWIGTYPE_p_switch_call_cause_t.getCPtr(value)); + } + + public SWIGTYPE_p_switch_call_cause_t getCause() { + return new SWIGTYPE_p_switch_call_cause_t(freeswitchJNI.CoreSession_cause_get(swigCPtr, this), true); + } + public void setUuid(String value) { freeswitchJNI.CoreSession_uuid_set(swigCPtr, this, value); } @@ -161,6 +169,10 @@ public class CoreSession { freeswitchJNI.CoreSession_sayPhrase__SWIG_2(swigCPtr, this, phrase_name); } + public String hangupCause() { + return freeswitchJNI.CoreSession_hangupCause(swigCPtr, this); + } + public int recordFile(String file_name, int time_limit, int silence_threshold, int silence_hits) { return freeswitchJNI.CoreSession_recordFile__SWIG_0(swigCPtr, this, file_name, time_limit, silence_threshold, silence_hits); } 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 b7c5475f38..58f3563b81 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 @@ -98,6 +98,8 @@ class freeswitchJNI { public final static native long CoreSession_cb_state_get(long jarg1, CoreSession jarg1_); public final static native void CoreSession_hook_state_set(long jarg1, CoreSession jarg1_, long jarg2); public final static native long CoreSession_hook_state_get(long jarg1, CoreSession jarg1_); + public final static native void CoreSession_cause_set(long jarg1, CoreSession jarg1_, long jarg2); + public final static native long CoreSession_cause_get(long jarg1, CoreSession jarg1_); public final static native void CoreSession_uuid_set(long jarg1, CoreSession jarg1_, String jarg2); public final static native String CoreSession_uuid_get(long jarg1, CoreSession jarg1_); public final static native void CoreSession_tts_name_set(long jarg1, CoreSession jarg1_, String jarg2); @@ -117,6 +119,7 @@ class freeswitchJNI { public final static native void CoreSession_sayPhrase__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, String jarg4); public final static native void CoreSession_sayPhrase__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, String jarg3); public final static native void CoreSession_sayPhrase__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2); + public final static native String CoreSession_hangupCause(long jarg1, CoreSession jarg1_); public final static native int CoreSession_recordFile__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4, int jarg5); public final static native int CoreSession_recordFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4); public final static native int CoreSession_recordFile__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2, int jarg3); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 2f76f2471b..6fa390903d 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -1773,6 +1773,41 @@ SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hoo } +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1cause_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2) { + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t arg2 ; + switch_call_cause_t *argp2 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + argp2 = *(switch_call_cause_t **)&jarg2; + if (!argp2) { + SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "Attempt to dereference null switch_call_cause_t"); + return ; + } + arg2 = *argp2; + if (arg1) (arg1)->cause = arg2; + +} + + +SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1cause_1get(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) { + jlong jresult = 0 ; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t result; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(CoreSession **)&jarg1; + result = ((arg1)->cause); + *(switch_call_cause_t **)&jresult = new switch_call_cause_t((switch_call_cause_t &)result); + return jresult; +} + + SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1uuid_1set(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; @@ -2180,6 +2215,21 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1sayP } +SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1hangupCause(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)->hangupCause(); + if(result) jresult = jenv->NewStringUTF((const char *)result); + return jresult; +} + + SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1recordFile_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jint jarg3, jint jarg4, jint jarg5) { jint jresult = 0 ; CoreSession *arg1 = (CoreSession *) 0 ; diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index d2134a670c..4de4fb65e9 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1495,23 +1495,24 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_input_callback_state swig_types[8] #define SWIGTYPE_p_lua_State swig_types[9] #define SWIGTYPE_p_session_flag_t swig_types[10] -#define SWIGTYPE_p_switch_channel_state_t swig_types[11] -#define SWIGTYPE_p_switch_channel_t swig_types[12] -#define SWIGTYPE_p_switch_core_session_t swig_types[13] -#define SWIGTYPE_p_switch_event_node_t swig_types[14] -#define SWIGTYPE_p_switch_event_t swig_types[15] -#define SWIGTYPE_p_switch_event_types_t swig_types[16] -#define SWIGTYPE_p_switch_input_args_t swig_types[17] -#define SWIGTYPE_p_switch_input_type_t swig_types[18] -#define SWIGTYPE_p_switch_priority_t swig_types[19] -#define SWIGTYPE_p_switch_queue_t swig_types[20] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[21] -#define SWIGTYPE_p_switch_status_t swig_types[22] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[23] -#define SWIGTYPE_p_uint32_t swig_types[24] -#define SWIGTYPE_p_void swig_types[25] -static swig_type_info *swig_types[27]; -static swig_module_info swig_module = {swig_types, 26, 0, 0, 0, 0}; +#define SWIGTYPE_p_switch_call_cause_t swig_types[11] +#define SWIGTYPE_p_switch_channel_state_t swig_types[12] +#define SWIGTYPE_p_switch_channel_t swig_types[13] +#define SWIGTYPE_p_switch_core_session_t swig_types[14] +#define SWIGTYPE_p_switch_event_node_t swig_types[15] +#define SWIGTYPE_p_switch_event_t swig_types[16] +#define SWIGTYPE_p_switch_event_types_t swig_types[17] +#define SWIGTYPE_p_switch_input_args_t swig_types[18] +#define SWIGTYPE_p_switch_input_type_t swig_types[19] +#define SWIGTYPE_p_switch_priority_t swig_types[20] +#define SWIGTYPE_p_switch_queue_t swig_types[21] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[22] +#define SWIGTYPE_p_switch_status_t swig_types[23] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[24] +#define SWIGTYPE_p_uint32_t swig_types[25] +#define SWIGTYPE_p_void swig_types[26] +static swig_type_info *swig_types[28]; +static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -4412,6 +4413,68 @@ fail: } +static int _wrap_CoreSession_cause_set(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t arg2 ; + switch_call_cause_t *argp2 ; + + SWIG_check_num_args("cause",2,2) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); + if(!lua_isuserdata(L,2)) SWIG_fail_arg("cause",2,"switch_call_cause_t"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cause_set",1,SWIGTYPE_p_CoreSession); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_switch_call_cause_t,0))){ + SWIG_fail_ptr("CoreSession_cause_set",2,SWIGTYPE_p_switch_call_cause_t); + } + arg2 = *argp2; + + if (arg1) (arg1)->cause = arg2; + + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_CoreSession_cause_get(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t result; + + SWIG_check_num_args("cause",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("cause",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_cause_get",1,SWIGTYPE_p_CoreSession); + } + + result = ((arg1)->cause); + SWIG_arg=0; + { + switch_call_cause_t * resultptr = new switch_call_cause_t((switch_call_cause_t &) result); + SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_switch_call_cause_t,1); SWIG_arg++; + } + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + static int _wrap_CoreSession_uuid_set(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; @@ -5097,6 +5160,31 @@ static int _wrap_CoreSession_sayPhrase(lua_State* L) { } +static int _wrap_CoreSession_hangupCause(lua_State* L) { + int SWIG_arg = -1; + CoreSession *arg1 = (CoreSession *) 0 ; + char *result = 0 ; + + SWIG_check_num_args("hangupCause",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("hangupCause",1,"CoreSession *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("CoreSession_hangupCause",1,SWIGTYPE_p_CoreSession); + } + + result = (char *)(arg1)->hangupCause(); + 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_recordFile__SWIG_0(lua_State* L) { int SWIG_arg = -1; CoreSession *arg1 = (CoreSession *) 0 ; @@ -7169,6 +7257,7 @@ static swig_lua_method swig_CoreSession_methods[] = { {"process_callback_result", _wrap_CoreSession_process_callback_result}, {"say", _wrap_CoreSession_say}, {"sayPhrase", _wrap_CoreSession_sayPhrase}, + {"hangupCause", _wrap_CoreSession_hangupCause}, {"recordFile", _wrap_CoreSession_recordFile}, {"setCallerData", _wrap_CoreSession_setCallerData}, {"originate", _wrap_CoreSession_originate}, @@ -7210,6 +7299,7 @@ static swig_lua_attribute swig_CoreSession_attributes[] = { { "allocated", _wrap_CoreSession_allocated_get, _wrap_CoreSession_allocated_set}, { "cb_state", _wrap_CoreSession_cb_state_get, _wrap_CoreSession_cb_state_set}, { "hook_state", _wrap_CoreSession_hook_state_get, _wrap_CoreSession_hook_state_set}, + { "cause", _wrap_CoreSession_cause_get, _wrap_CoreSession_cause_set}, { "uuid", _wrap_CoreSession_uuid_get, _wrap_CoreSession_uuid_set}, { "tts_name", _wrap_CoreSession_tts_name_get, _wrap_CoreSession_tts_name_set}, { "voice_name", _wrap_CoreSession_voice_name_get, _wrap_CoreSession_voice_name_set}, @@ -8351,6 +8441,7 @@ static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*) static swig_type_info _swigt__p_input_callback_state = {"_p_input_callback_state", "input_callback_state_t *|input_callback_state *", 0, 0, (void*)&_wrap_class_input_callback_state_t, 0}; static swig_type_info _swigt__p_lua_State = {"_p_lua_State", "lua_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_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_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_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0}; @@ -8379,6 +8470,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_input_callback_state, &_swigt__p_lua_State, &_swigt__p_session_flag_t, + &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, &_swigt__p_switch_core_session_t, @@ -8407,6 +8499,7 @@ static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0 static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_lua_State[] = { {&_swigt__p_lua_State, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -8435,6 +8528,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_input_callback_state, _swigc__p_lua_State, _swigc__p_session_flag_t, + _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, _swigc__p_switch_core_session_t, diff --git a/src/mod/languages/mod_managed/freeswitch_wrap.cxx b/src/mod/languages/mod_managed/freeswitch_wrap.cxx index 7f19df7220..9da475d164 100644 --- a/src/mod/languages/mod_managed/freeswitch_wrap.cxx +++ b/src/mod/languages/mod_managed/freeswitch_wrap.cxx @@ -938,6 +938,17 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_URL_SEPARATOR_get() { } +SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_AUDIO_SPOOL_PATH_VARIABLE_get() { + char * jresult ; + char *result = 0 ; + + result = (char *) "audio_spool_path"; + + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE_get() { char * jresult ; char *result = 0 ; @@ -9450,6 +9461,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_find_end_paren(char * jarg1, char ja } +SWIGEXPORT int SWIGSTDCALL CSharp_switch_is_file_path(char * jarg1) { + int jresult ; + char *arg1 = (char *) 0 ; + switch_bool_t result; + + arg1 = (char *)jarg1; + result = (switch_bool_t)switch_is_file_path((char const *)arg1); + jresult = result; + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_switch_parse_cidr(char * jarg1, void * jarg2, void * jarg3, void * jarg4) { int jresult ; char *arg1 = (char *) 0 ; @@ -14250,6 +14273,66 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_file_handle_line_get(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_file_path_set(void * jarg1, char * jarg2) { + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_file_handle *)jarg1; + arg2 = (char *)jarg2; + { + if (arg1->file_path) delete [] arg1->file_path; + if (arg2) { + arg1->file_path = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->file_path, (const char *)arg2); + } else { + arg1->file_path = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_file_handle_file_path_get(void * jarg1) { + char * jresult ; + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + char *result = 0 ; + + arg1 = (switch_file_handle *)jarg1; + result = (char *) ((arg1)->file_path); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + +SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_spool_path_set(void * jarg1, char * jarg2) { + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + char *arg2 = (char *) 0 ; + + arg1 = (switch_file_handle *)jarg1; + arg2 = (char *)jarg2; + { + if (arg1->spool_path) delete [] arg1->spool_path; + if (arg2) { + arg1->spool_path = (char *) (new char[strlen((const char *)arg2)+1]); + strcpy((char *)arg1->spool_path, (const char *)arg2); + } else { + arg1->spool_path = 0; + } + } +} + + +SWIGEXPORT char * SWIGSTDCALL CSharp_switch_file_handle_spool_path_get(void * jarg1) { + char * jresult ; + switch_file_handle *arg1 = (switch_file_handle *) 0 ; + char *result = 0 ; + + arg1 = (switch_file_handle *)jarg1; + result = (char *) ((arg1)->spool_path); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_file_handle() { void * jresult ; switch_file_handle *result = 0 ; @@ -20599,6 +20682,29 @@ SWIGEXPORT void * SWIGSTDCALL CSharp_switch_event_next_get(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_switch_event_flags_set(void * jarg1, int jarg2) { + switch_event *arg1 = (switch_event *) 0 ; + int arg2 ; + + arg1 = (switch_event *)jarg1; + arg2 = (int)jarg2; + if (arg1) (arg1)->flags = arg2; + +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_flags_get(void * jarg1) { + int jresult ; + switch_event *arg1 = (switch_event *) 0 ; + int result; + + arg1 = (switch_event *)jarg1; + result = (int) ((arg1)->flags); + jresult = result; + return jresult; +} + + SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_event() { void * jresult ; switch_event *result = 0 ; @@ -28441,6 +28547,29 @@ SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_HookState_get(void * jarg1) { } +SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_cause_set(void * jarg1, int jarg2) { + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t arg2 ; + + arg1 = (CoreSession *)jarg1; + arg2 = (switch_call_cause_t)jarg2; + if (arg1) (arg1)->cause = arg2; + +} + + +SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_cause_get(void * jarg1) { + int jresult ; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t result; + + arg1 = (CoreSession *)jarg1; + result = (switch_call_cause_t) ((arg1)->cause); + jresult = result; + return jresult; +} + + SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_uuid_set(void * jarg1, char * jarg2) { CoreSession *arg1 = (CoreSession *) 0 ; char *arg2 = (char *) 0 ; @@ -28647,6 +28776,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_SayPhrase(void * jarg1, char * ja } +SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_hangupCause(void * jarg1) { + char * jresult ; + CoreSession *arg1 = (CoreSession *) 0 ; + char *result = 0 ; + + arg1 = (CoreSession *)jarg1; + result = (char *)(arg1)->hangupCause(); + jresult = SWIG_csharp_string_callback((const char *)result); + return jresult; +} + + SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_RecordFile(void * jarg1, char * jarg2, int jarg3, int jarg4, int jarg5) { int jresult ; CoreSession *arg1 = (CoreSession *) 0 ; diff --git a/src/mod/languages/mod_managed/managed/swig.cs b/src/mod/languages/mod_managed/managed/swig.cs index 3116015867..5f2913088b 100644 --- a/src/mod/languages/mod_managed/managed/swig.cs +++ b/src/mod/languages/mod_managed/managed/swig.cs @@ -164,6 +164,16 @@ public class CoreSession : IDisposable { } } + public switch_call_cause_t cause { + set { + freeswitchPINVOKE.CoreSession_cause_set(swigCPtr, (int)value); + } + get { + switch_call_cause_t ret = (switch_call_cause_t)freeswitchPINVOKE.CoreSession_cause_get(swigCPtr); + return ret; + } + } + public string uuid { set { freeswitchPINVOKE.CoreSession_uuid_set(swigCPtr, value); @@ -235,6 +245,11 @@ public class CoreSession : IDisposable { freeswitchPINVOKE.CoreSession_SayPhrase(swigCPtr, phrase_name, phrase_data, phrase_lang); } + public string hangupCause() { + string ret = freeswitchPINVOKE.CoreSession_hangupCause(swigCPtr); + return ret; + } + public int RecordFile(string file_name, int time_limit, int silence_threshold, int silence_hits) { int ret = freeswitchPINVOKE.CoreSession_RecordFile(swigCPtr, file_name, time_limit, silence_threshold, silence_hits); return ret; @@ -2348,6 +2363,11 @@ public class freeswitch { return ret; } + public static switch_bool_t switch_is_file_path(string file) { + switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_is_file_path(file); + return ret; + } + public static int switch_parse_cidr(string arg0, SWIGTYPE_p_unsigned_long ip, SWIGTYPE_p_unsigned_long mask, SWIGTYPE_p_unsigned_long bitp) { int ret = freeswitchPINVOKE.switch_parse_cidr(arg0, SWIGTYPE_p_unsigned_long.getCPtr(ip), SWIGTYPE_p_unsigned_long.getCPtr(mask), SWIGTYPE_p_unsigned_long.getCPtr(bitp)); return ret; @@ -4309,6 +4329,7 @@ public class freeswitch { public static readonly int SWITCH_MAX_DTMF_DURATION = freeswitchPINVOKE.SWITCH_MAX_DTMF_DURATION_get(); public static readonly string SWITCH_PATH_SEPARATOR = freeswitchPINVOKE.SWITCH_PATH_SEPARATOR_get(); public static readonly string SWITCH_URL_SEPARATOR = freeswitchPINVOKE.SWITCH_URL_SEPARATOR_get(); + public static readonly string SWITCH_AUDIO_SPOOL_PATH_VARIABLE = freeswitchPINVOKE.SWITCH_AUDIO_SPOOL_PATH_VARIABLE_get(); public static readonly string SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE = freeswitchPINVOKE.SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE_get(); public static readonly string SWITCH_READ_TERMINATOR_USED_VARIABLE = freeswitchPINVOKE.SWITCH_READ_TERMINATOR_USED_VARIABLE_get(); public static readonly string SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE = freeswitchPINVOKE.SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE_get(); @@ -4791,6 +4812,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_URL_SEPARATOR_get")] public static extern string SWITCH_URL_SEPARATOR_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_AUDIO_SPOOL_PATH_VARIABLE_get")] + public static extern string SWITCH_AUDIO_SPOOL_PATH_VARIABLE_get(); + [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE_get")] public static extern string SWITCH_BRIDGE_HANGUP_CAUSE_VARIABLE_get(); @@ -6780,6 +6804,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_find_end_paren")] public static extern string switch_find_end_paren(string jarg1, char jarg2, char jarg3); + [DllImport("mod_managed", EntryPoint="CSharp_switch_is_file_path")] + public static extern int switch_is_file_path(string jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_parse_cidr")] public static extern int switch_parse_cidr(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4); @@ -7962,6 +7989,18 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_line_get")] public static extern int switch_file_handle_line_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_file_path_set")] + public static extern void switch_file_handle_file_path_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_file_path_get")] + public static extern string switch_file_handle_file_path_get(HandleRef jarg1); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_spool_path_set")] + public static extern void switch_file_handle_spool_path_set(HandleRef jarg1, string jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_spool_path_get")] + public static extern string switch_file_handle_spool_path_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_file_handle")] public static extern IntPtr new_switch_file_handle(); @@ -9519,6 +9558,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_switch_event_next_get")] public static extern IntPtr switch_event_next_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_flags_set")] + public static extern void switch_event_flags_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_switch_event_flags_get")] + public static extern int switch_event_flags_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_new_switch_event")] public static extern IntPtr new_switch_event(); @@ -11289,6 +11334,12 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_HookState_get")] public static extern int CoreSession_HookState_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_cause_set")] + public static extern void CoreSession_cause_set(HandleRef jarg1, int jarg2); + + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_cause_get")] + public static extern int CoreSession_cause_get(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_uuid_set")] public static extern void CoreSession_uuid_set(HandleRef jarg1, string jarg2); @@ -11334,6 +11385,9 @@ class freeswitchPINVOKE { [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_SayPhrase")] public static extern void CoreSession_SayPhrase(HandleRef jarg1, string jarg2, string jarg3, string jarg4); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_hangupCause")] + public static extern string CoreSession_hangupCause(HandleRef jarg1); + [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_RecordFile")] public static extern int CoreSession_RecordFile(HandleRef jarg1, string jarg2, int jarg3, int jarg4, int jarg5); @@ -16167,7 +16221,8 @@ namespace FreeSWITCH.Native { [System.Flags] public enum switch_application_flag_enum_t { SAF_NONE = 0, - SAF_SUPPORT_NOMEDIA = (1 << 0) + SAF_SUPPORT_NOMEDIA = (1 << 0), + SAF_ROUTING_EXEC = (1 << 1) } } @@ -20627,6 +20682,16 @@ public class switch_event : IDisposable { } } + public int flags { + set { + freeswitchPINVOKE.switch_event_flags_set(swigCPtr, value); + } + get { + int ret = freeswitchPINVOKE.switch_event_flags_get(swigCPtr); + return ret; + } + } + public switch_event() : this(freeswitchPINVOKE.new_switch_event(), true) { } @@ -20643,6 +20708,21 @@ public class switch_event : IDisposable { namespace FreeSWITCH.Native { +public enum switch_event_flag_t { + EF_UNIQ_HEADERS = (1 << 0) +} + +} +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.35 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +namespace FreeSWITCH.Native { + using System; using System.Runtime.InteropServices; @@ -21257,6 +21337,26 @@ public class switch_file_handle : IDisposable { } } + public string file_path { + set { + freeswitchPINVOKE.switch_file_handle_file_path_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_file_handle_file_path_get(swigCPtr); + return ret; + } + } + + public string spool_path { + set { + freeswitchPINVOKE.switch_file_handle_spool_path_set(swigCPtr, value); + } + get { + string ret = freeswitchPINVOKE.switch_file_handle_spool_path_get(swigCPtr); + return ret; + } + } + public switch_file_handle() : this(freeswitchPINVOKE.new_switch_file_handle(), true) { } diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm index 2f527812eb..b0d19934d2 100644 --- a/src/mod/languages/mod_perl/freeswitch.pm +++ b/src/mod/languages/mod_perl/freeswitch.pm @@ -393,6 +393,8 @@ sub DESTROY { *swig_cb_state_set = *freeswitchc::CoreSession_cb_state_set; *swig_hook_state_get = *freeswitchc::CoreSession_hook_state_get; *swig_hook_state_set = *freeswitchc::CoreSession_hook_state_set; +*swig_cause_get = *freeswitchc::CoreSession_cause_get; +*swig_cause_set = *freeswitchc::CoreSession_cause_set; *swig_uuid_get = *freeswitchc::CoreSession_uuid_get; *swig_uuid_set = *freeswitchc::CoreSession_uuid_set; *swig_tts_name_get = *freeswitchc::CoreSession_tts_name_get; @@ -409,6 +411,7 @@ sub DESTROY { *process_callback_result = *freeswitchc::CoreSession_process_callback_result; *say = *freeswitchc::CoreSession_say; *sayPhrase = *freeswitchc::CoreSession_sayPhrase; +*hangupCause = *freeswitchc::CoreSession_hangupCause; *recordFile = *freeswitchc::CoreSession_recordFile; *setCallerData = *freeswitchc::CoreSession_setCallerData; *originate = *freeswitchc::CoreSession_originate; diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 7ea3dd751a..fd9819a04a 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -1458,23 +1458,24 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_char swig_types[9] #define SWIGTYPE_p_input_callback_state swig_types[10] #define SWIGTYPE_p_session_flag_t swig_types[11] -#define SWIGTYPE_p_switch_channel_state_t swig_types[12] -#define SWIGTYPE_p_switch_channel_t swig_types[13] -#define SWIGTYPE_p_switch_core_session_t swig_types[14] -#define SWIGTYPE_p_switch_event_node_t swig_types[15] -#define SWIGTYPE_p_switch_event_t swig_types[16] -#define SWIGTYPE_p_switch_event_types_t swig_types[17] -#define SWIGTYPE_p_switch_input_args_t swig_types[18] -#define SWIGTYPE_p_switch_input_type_t swig_types[19] -#define SWIGTYPE_p_switch_priority_t swig_types[20] -#define SWIGTYPE_p_switch_queue_t swig_types[21] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[22] -#define SWIGTYPE_p_switch_status_t swig_types[23] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[24] -#define SWIGTYPE_p_uint32_t swig_types[25] -#define SWIGTYPE_p_void swig_types[26] -static swig_type_info *swig_types[28]; -static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; +#define SWIGTYPE_p_switch_call_cause_t swig_types[12] +#define SWIGTYPE_p_switch_channel_state_t swig_types[13] +#define SWIGTYPE_p_switch_channel_t swig_types[14] +#define SWIGTYPE_p_switch_core_session_t swig_types[15] +#define SWIGTYPE_p_switch_event_node_t swig_types[16] +#define SWIGTYPE_p_switch_event_t swig_types[17] +#define SWIGTYPE_p_switch_event_types_t swig_types[18] +#define SWIGTYPE_p_switch_input_args_t swig_types[19] +#define SWIGTYPE_p_switch_input_type_t swig_types[20] +#define SWIGTYPE_p_switch_priority_t swig_types[21] +#define SWIGTYPE_p_switch_queue_t swig_types[22] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[23] +#define SWIGTYPE_p_switch_status_t swig_types[24] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[25] +#define SWIGTYPE_p_uint32_t swig_types[26] +#define SWIGTYPE_p_void swig_types[27] +static swig_type_info *swig_types[29]; +static swig_module_info swig_module = {swig_types, 28, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -5567,6 +5568,76 @@ XS(_wrap_CoreSession_hook_state_get) { } +XS(_wrap_CoreSession_cause_set) { + { + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 2) || (items > 2)) { + SWIG_croak("Usage: CoreSession_cause_set(self,cause);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_cause_set" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + { + res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_switch_call_cause_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_cause_set" "', argument " "2"" of type '" "switch_call_cause_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_cause_set" "', argument " "2"" of type '" "switch_call_cause_t""'"); + } else { + arg2 = *(reinterpret_cast< switch_call_cause_t * >(argp2)); + } + } + if (arg1) (arg1)->cause = arg2; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_CoreSession_cause_get) { + { + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t result; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: CoreSession_cause_get(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_cause_get" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + result = ((arg1)->cause); + ST(argvi) = SWIG_NewPointerObj((new switch_call_cause_t(static_cast< const switch_call_cause_t& >(result))), SWIGTYPE_p_switch_call_cause_t, SWIG_POINTER_OWN | 0); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_CoreSession_uuid_set) { { CoreSession *arg1 = (CoreSession *) 0 ; @@ -6537,6 +6608,34 @@ XS(_wrap_CoreSession_sayPhrase) { } +XS(_wrap_CoreSession_hangupCause) { + { + 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_hangupCause(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_hangupCause" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + result = (char *)(arg1)->hangupCause(); + ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ; + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + XS(_wrap_CoreSession_recordFile__SWIG_0) { { CoreSession *arg1 = (CoreSession *) 0 ; @@ -11253,6 +11352,7 @@ static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*) 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_t *|input_callback_state *", 0, 0, (void*)"freeswitch::input_callback_state_t", 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_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_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_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0}; @@ -11282,6 +11382,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_char, &_swigt__p_input_callback_state, &_swigt__p_session_flag_t, + &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, &_swigt__p_switch_core_session_t, @@ -11311,6 +11412,7 @@ static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -11340,6 +11442,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_char, _swigc__p_input_callback_state, _swigc__p_session_flag_t, + _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, _swigc__p_switch_core_session_t, @@ -11446,6 +11549,8 @@ static swig_command_info swig_commands[] = { {"freeswitchc::CoreSession_cb_state_get", _wrap_CoreSession_cb_state_get}, {"freeswitchc::CoreSession_hook_state_set", _wrap_CoreSession_hook_state_set}, {"freeswitchc::CoreSession_hook_state_get", _wrap_CoreSession_hook_state_get}, +{"freeswitchc::CoreSession_cause_set", _wrap_CoreSession_cause_set}, +{"freeswitchc::CoreSession_cause_get", _wrap_CoreSession_cause_get}, {"freeswitchc::CoreSession_uuid_set", _wrap_CoreSession_uuid_set}, {"freeswitchc::CoreSession_uuid_get", _wrap_CoreSession_uuid_get}, {"freeswitchc::CoreSession_tts_name_set", _wrap_CoreSession_tts_name_set}, @@ -11462,6 +11567,7 @@ static swig_command_info swig_commands[] = { {"freeswitchc::CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result}, {"freeswitchc::CoreSession_say", _wrap_CoreSession_say}, {"freeswitchc::CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase}, +{"freeswitchc::CoreSession_hangupCause", _wrap_CoreSession_hangupCause}, {"freeswitchc::CoreSession_recordFile", _wrap_CoreSession_recordFile}, {"freeswitchc::CoreSession_setCallerData", _wrap_CoreSession_setCallerData}, {"freeswitchc::CoreSession_originate", _wrap_CoreSession_originate}, @@ -11820,17 +11926,17 @@ XS(SWIG_init) { SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu"); SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API"); SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t"); - /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; - /*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { + /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK))); SvREADONLY_on(sv); diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index 329ee8d7dd..81428084a4 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -247,6 +247,9 @@ class CoreSession(_object): __swig_setmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_set __swig_getmethods__["hook_state"] = _freeswitch.CoreSession_hook_state_get if _newclass:hook_state = _swig_property(_freeswitch.CoreSession_hook_state_get, _freeswitch.CoreSession_hook_state_set) + __swig_setmethods__["cause"] = _freeswitch.CoreSession_cause_set + __swig_getmethods__["cause"] = _freeswitch.CoreSession_cause_get + if _newclass:cause = _swig_property(_freeswitch.CoreSession_cause_get, _freeswitch.CoreSession_cause_set) __swig_setmethods__["uuid"] = _freeswitch.CoreSession_uuid_set __swig_getmethods__["uuid"] = _freeswitch.CoreSession_uuid_get if _newclass:uuid = _swig_property(_freeswitch.CoreSession_uuid_get, _freeswitch.CoreSession_uuid_set) @@ -266,6 +269,7 @@ class CoreSession(_object): def process_callback_result(*args): return _freeswitch.CoreSession_process_callback_result(*args) def say(*args): return _freeswitch.CoreSession_say(*args) def sayPhrase(*args): return _freeswitch.CoreSession_sayPhrase(*args) + def hangupCause(*args): return _freeswitch.CoreSession_hangupCause(*args) def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args) def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args) def originate(*args): return _freeswitch.CoreSession_originate(*args) diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 31fc816196..0fdb08cf53 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -2506,23 +2506,24 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_char swig_types[8] #define SWIGTYPE_p_input_callback_state swig_types[9] #define SWIGTYPE_p_session_flag_t swig_types[10] -#define SWIGTYPE_p_switch_channel_state_t swig_types[11] -#define SWIGTYPE_p_switch_channel_t swig_types[12] -#define SWIGTYPE_p_switch_core_session_t swig_types[13] -#define SWIGTYPE_p_switch_event_node_t swig_types[14] -#define SWIGTYPE_p_switch_event_t swig_types[15] -#define SWIGTYPE_p_switch_event_types_t swig_types[16] -#define SWIGTYPE_p_switch_input_args_t swig_types[17] -#define SWIGTYPE_p_switch_input_type_t swig_types[18] -#define SWIGTYPE_p_switch_priority_t swig_types[19] -#define SWIGTYPE_p_switch_queue_t swig_types[20] -#define SWIGTYPE_p_switch_state_handler_table_t swig_types[21] -#define SWIGTYPE_p_switch_status_t swig_types[22] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[23] -#define SWIGTYPE_p_uint32_t swig_types[24] -#define SWIGTYPE_p_void swig_types[25] -static swig_type_info *swig_types[27]; -static swig_module_info swig_module = {swig_types, 26, 0, 0, 0, 0}; +#define SWIGTYPE_p_switch_call_cause_t swig_types[11] +#define SWIGTYPE_p_switch_channel_state_t swig_types[12] +#define SWIGTYPE_p_switch_channel_t swig_types[13] +#define SWIGTYPE_p_switch_core_session_t swig_types[14] +#define SWIGTYPE_p_switch_event_node_t swig_types[15] +#define SWIGTYPE_p_switch_event_t swig_types[16] +#define SWIGTYPE_p_switch_event_types_t swig_types[17] +#define SWIGTYPE_p_switch_input_args_t swig_types[18] +#define SWIGTYPE_p_switch_input_type_t swig_types[19] +#define SWIGTYPE_p_switch_priority_t swig_types[20] +#define SWIGTYPE_p_switch_queue_t swig_types[21] +#define SWIGTYPE_p_switch_state_handler_table_t swig_types[22] +#define SWIGTYPE_p_switch_status_t swig_types[23] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[24] +#define SWIGTYPE_p_uint32_t swig_types[25] +#define SWIGTYPE_p_void swig_types[26] +static swig_type_info *swig_types[28]; +static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) @@ -5983,6 +5984,67 @@ fail: } +SWIGINTERN PyObject *_wrap_CoreSession_cause_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_cause_set",&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_cause_set" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + { + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_switch_call_cause_t, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_cause_set" "', argument " "2"" of type '" "switch_call_cause_t""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CoreSession_cause_set" "', argument " "2"" of type '" "switch_call_cause_t""'"); + } else { + switch_call_cause_t * temp = reinterpret_cast< switch_call_cause_t * >(argp2); + arg2 = *temp; + if (SWIG_IsNewObj(res2)) delete temp; + } + } + if (arg1) (arg1)->cause = arg2; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CoreSession_cause_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + CoreSession *arg1 = (CoreSession *) 0 ; + switch_call_cause_t result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_cause_get",&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_cause_get" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + result = ((arg1)->cause); + resultobj = SWIG_NewPointerObj((new switch_call_cause_t(static_cast< const switch_call_cause_t& >(result))), SWIGTYPE_p_switch_call_cause_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_uuid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; @@ -6769,6 +6831,28 @@ fail: } +SWIGINTERN PyObject *_wrap_CoreSession_hangupCause(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_hangupCause",&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_hangupCause" "', argument " "1"" of type '" "CoreSession *""'"); + } + arg1 = reinterpret_cast< CoreSession * >(argp1); + result = (char *)(arg1)->hangupCause(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *_wrap_CoreSession_recordFile__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; CoreSession *arg1 = (CoreSession *) 0 ; @@ -10251,6 +10335,8 @@ static PyMethodDef SwigMethods[] = { { (char *)"CoreSession_cb_state_get", _wrap_CoreSession_cb_state_get, METH_VARARGS, NULL}, { (char *)"CoreSession_hook_state_set", _wrap_CoreSession_hook_state_set, METH_VARARGS, NULL}, { (char *)"CoreSession_hook_state_get", _wrap_CoreSession_hook_state_get, METH_VARARGS, NULL}, + { (char *)"CoreSession_cause_set", _wrap_CoreSession_cause_set, METH_VARARGS, NULL}, + { (char *)"CoreSession_cause_get", _wrap_CoreSession_cause_get, METH_VARARGS, NULL}, { (char *)"CoreSession_uuid_set", _wrap_CoreSession_uuid_set, METH_VARARGS, NULL}, { (char *)"CoreSession_uuid_get", _wrap_CoreSession_uuid_get, METH_VARARGS, NULL}, { (char *)"CoreSession_tts_name_set", _wrap_CoreSession_tts_name_set, METH_VARARGS, NULL}, @@ -10267,6 +10353,7 @@ static PyMethodDef SwigMethods[] = { { (char *)"CoreSession_process_callback_result", _wrap_CoreSession_process_callback_result, METH_VARARGS, NULL}, { (char *)"CoreSession_say", _wrap_CoreSession_say, METH_VARARGS, NULL}, { (char *)"CoreSession_sayPhrase", _wrap_CoreSession_sayPhrase, METH_VARARGS, NULL}, + { (char *)"CoreSession_hangupCause", _wrap_CoreSession_hangupCause, METH_VARARGS, NULL}, { (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL}, { (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL}, { (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL}, @@ -10348,6 +10435,7 @@ static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*) 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_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_switch_call_cause_t = {"_p_switch_call_cause_t", "switch_call_cause_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_t = {"_p_switch_channel_t", "switch_channel_t *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_switch_core_session_t = {"_p_switch_core_session_t", "switch_core_session_t *", 0, 0, (void*)0, 0}; @@ -10376,6 +10464,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_char, &_swigt__p_input_callback_state, &_swigt__p_session_flag_t, + &_swigt__p_switch_call_cause_t, &_swigt__p_switch_channel_state_t, &_swigt__p_switch_channel_t, &_swigt__p_switch_core_session_t, @@ -10404,6 +10493,7 @@ static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_input_callback_state[] = { {&_swigt__p_input_callback_state, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_session_flag_t[] = { {&_swigt__p_session_flag_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_switch_call_cause_t[] = { {&_swigt__p_switch_call_cause_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_state_t[] = { {&_swigt__p_switch_channel_state_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_channel_t[] = { {&_swigt__p_switch_channel_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_switch_core_session_t[] = { {&_swigt__p_switch_core_session_t, 0, 0, 0},{0, 0, 0, 0}}; @@ -10432,6 +10522,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_char, _swigc__p_input_callback_state, _swigc__p_session_flag_t, + _swigc__p_switch_call_cause_t, _swigc__p_switch_channel_state_t, _swigc__p_switch_channel_t, _swigc__p_switch_core_session_t, diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index b6c2f68128..c83d2ece8b 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -487,7 +487,6 @@ SWITCH_DECLARE_CONSTRUCTOR CoreSession::CoreSession(char *nuuid, CoreSession *a_ channel = switch_core_session_get_channel(session); allocated = 1; } else { - switch_call_cause_t cause; if (switch_ivr_originate(a_leg ? a_leg->session : NULL, &session, &cause, nuuid, 60, NULL, NULL, NULL, NULL, NULL, SOF_NONE) == SWITCH_STATUS_SUCCESS) { channel = switch_core_session_get_channel(session); @@ -932,11 +931,15 @@ SWITCH_DECLARE(void) CoreSession::destroy(void) } +SWITCH_DECLARE(const char *) CoreSession::hangupCause() +{ + return switch_channel_cause2str(cause); +} + SWITCH_DECLARE(int) CoreSession::originate(CoreSession *a_leg_session, char *dest, int timeout, switch_state_handler_table_t *handlers) { switch_core_session_t *aleg_core_session = NULL; - switch_call_cause_t cause; this_check(0);