diff --git a/src/include/switch_cpp.h b/src/include/switch_cpp.h index a61777ae0d..08ec3a9614 100644 --- a/src/include/switch_cpp.h +++ b/src/include/switch_cpp.h @@ -64,6 +64,33 @@ Note that the first parameter to the new operator is implicitly handled by c++.. SWITCH_DECLARE(void) consoleLog(char *level_str, char *msg); SWITCH_DECLARE(void) consoleCleanLog(char *msg); +class CoreSession; + +class IVRMenu { + protected: + switch_ivr_menu_t *menu; + switch_memory_pool_t *pool; + public: + SWITCH_DECLARE_CONSTRUCTOR IVRMenu(IVRMenu *main, + const char *name, + const char *greeting_sound, + const char *short_greeting_sound, + const char *invalid_sound, + const char *exit_sound, + const char *confirm_macro, + const char *confirm_key, + int confirm_attempts, + int inter_timeout, + int digit_len, + int timeout, + int max_failures + ); + virtual SWITCH_DECLARE_CONSTRUCTOR ~IVRMenu(); + SWITCH_DECLARE(void) bindAction(char *action, const char *arg, const char *bind); + SWITCH_DECLARE(void) execute(CoreSession *session, const char *name); +}; + + class API { protected: char *last_data; diff --git a/src/include/switch_ivr.h b/src/include/switch_ivr.h index 104a49c5ea..cdaefd832f 100644 --- a/src/include/switch_ivr.h +++ b/src/include/switch_ivr.h @@ -717,6 +717,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t * s SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_xml_ctx_t * xml_menu_ctx, switch_ivr_menu_t ** menu_stack, switch_xml_t xml_menus, switch_xml_t xml_menu); +SWITCH_DECLARE(switch_status_t) switch_ivr_menu_str2action(const char *action_name, switch_ivr_action_t *action); + /*! *\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init *\param name The xml tag name to add to the parser engine 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 e34b599e98..f533392197 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 @@ -11,6 +11,10 @@ package org.freeswitch.swig; class freeswitchJNI { public final static native void consoleLog(String jarg1, String jarg2); public final static native void consoleCleanLog(String jarg1); + public final static native long new_IVRMenu(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4, String jarg5, String jarg6, String jarg7, String jarg8, int jarg9, int jarg10, int jarg11, int jarg12, int jarg13); + public final static native void delete_IVRMenu(long jarg1); + public final static native void IVRMenu_bindAction(long jarg1, IVRMenu jarg1_, String jarg2, String jarg3, String jarg4); + public final static native void IVRMenu_execute(long jarg1, IVRMenu jarg1_, long jarg2, CoreSession jarg2_, String jarg3); public final static native long new_API(); public final static native void delete_API(long jarg1); public final static native String API_execute(long jarg1, API jarg1_, String jarg2, String jarg3); diff --git a/src/mod/languages/mod_java/switch_swig_wrap.cpp b/src/mod/languages/mod_java/switch_swig_wrap.cpp index 2541b6f464..cfadbe356a 100644 --- a/src/mod/languages/mod_java/switch_swig_wrap.cpp +++ b/src/mod/languages/mod_java/switch_swig_wrap.cpp @@ -244,6 +244,144 @@ SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_consoleCleanLog(J } +SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1IVRMenu(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4, jstring jarg5, jstring jarg6, jstring jarg7, jstring jarg8, jint jarg9, jint jarg10, jint jarg11, jint jarg12, jint jarg13) { + jlong jresult = 0 ; + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + char *arg6 = (char *) 0 ; + char *arg7 = (char *) 0 ; + char *arg8 = (char *) 0 ; + int arg9 ; + int arg10 ; + int arg11 ; + int arg12 ; + int arg13 ; + IVRMenu *result = 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(IVRMenu **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return 0; + } + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return 0; + } + arg4 = 0; + if (jarg4) { + arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); + if (!arg4) return 0; + } + arg5 = 0; + if (jarg5) { + arg5 = (char *)jenv->GetStringUTFChars(jarg5, 0); + if (!arg5) return 0; + } + arg6 = 0; + if (jarg6) { + arg6 = (char *)jenv->GetStringUTFChars(jarg6, 0); + if (!arg6) return 0; + } + arg7 = 0; + if (jarg7) { + arg7 = (char *)jenv->GetStringUTFChars(jarg7, 0); + if (!arg7) return 0; + } + arg8 = 0; + if (jarg8) { + arg8 = (char *)jenv->GetStringUTFChars(jarg8, 0); + if (!arg8) return 0; + } + arg9 = (int)jarg9; + arg10 = (int)jarg10; + arg11 = (int)jarg11; + arg12 = (int)jarg12; + arg13 = (int)jarg13; + result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,arg11,arg12,arg13); + *(IVRMenu **)&jresult = result; + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); + if (arg5) jenv->ReleaseStringUTFChars(jarg5, (const char *)arg5); + if (arg6) jenv->ReleaseStringUTFChars(jarg6, (const char *)arg6); + if (arg7) jenv->ReleaseStringUTFChars(jarg7, (const char *)arg7); + if (arg8) jenv->ReleaseStringUTFChars(jarg8, (const char *)arg8); + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_delete_1IVRMenu(JNIEnv *jenv, jclass jcls, jlong jarg1) { + IVRMenu *arg1 = (IVRMenu *) 0 ; + + (void)jenv; + (void)jcls; + arg1 = *(IVRMenu **)&jarg1; + delete arg1; + +} + + +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_IVRMenu_1bindAction(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3, jstring jarg4) { + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + arg1 = *(IVRMenu **)&jarg1; + arg2 = 0; + if (jarg2) { + arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0); + if (!arg2) return ; + } + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return ; + } + arg4 = 0; + if (jarg4) { + arg4 = (char *)jenv->GetStringUTFChars(jarg4, 0); + if (!arg4) return ; + } + (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); + if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2); + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); + if (arg4) jenv->ReleaseStringUTFChars(jarg4, (const char *)arg4); +} + + +SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_IVRMenu_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3) { + IVRMenu *arg1 = (IVRMenu *) 0 ; + CoreSession *arg2 = (CoreSession *) 0 ; + char *arg3 = (char *) 0 ; + + (void)jenv; + (void)jcls; + (void)jarg1_; + (void)jarg2_; + arg1 = *(IVRMenu **)&jarg1; + arg2 = *(CoreSession **)&jarg2; + arg3 = 0; + if (jarg3) { + arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0); + if (!arg3) return ; + } + (arg1)->execute(arg2,(char const *)arg3); + if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3); +} + + SWIGEXPORT jlong JNICALL Java_org_freeswitch_swig_freeswitchJNI_new_1API(JNIEnv *jenv, jclass jcls) { jlong jresult = 0 ; API *result = 0 ; diff --git a/src/mod/languages/mod_lua/mod_lua_wrap.cpp b/src/mod/languages/mod_lua/mod_lua_wrap.cpp index ac1a011b84..35a7304855 100644 --- a/src/mod/languages/mod_lua/mod_lua_wrap.cpp +++ b/src/mod/languages/mod_lua/mod_lua_wrap.cpp @@ -1487,23 +1487,24 @@ SWIG_Lua_dostring(lua_State *L, const char* str) { #define SWIGTYPE_p_API swig_types[0] #define SWIGTYPE_p_CoreSession swig_types[1] #define SWIGTYPE_p_Event swig_types[2] -#define SWIGTYPE_p_Session swig_types[3] -#define SWIGTYPE_p_Stream swig_types[4] -#define SWIGTYPE_p_input_callback_state swig_types[5] -#define SWIGTYPE_p_lua_State swig_types[6] -#define SWIGTYPE_p_session_flag_t swig_types[7] -#define SWIGTYPE_p_switch_channel_state_t swig_types[8] -#define SWIGTYPE_p_switch_channel_t swig_types[9] -#define SWIGTYPE_p_switch_core_session_t swig_types[10] -#define SWIGTYPE_p_switch_event_t swig_types[11] -#define SWIGTYPE_p_switch_input_args_t swig_types[12] -#define SWIGTYPE_p_switch_input_type_t swig_types[13] -#define SWIGTYPE_p_switch_priority_t swig_types[14] -#define SWIGTYPE_p_switch_status_t swig_types[15] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[16] -#define SWIGTYPE_p_void swig_types[17] -static swig_type_info *swig_types[19]; -static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0}; +#define SWIGTYPE_p_IVRMenu swig_types[3] +#define SWIGTYPE_p_Session swig_types[4] +#define SWIGTYPE_p_Stream swig_types[5] +#define SWIGTYPE_p_input_callback_state swig_types[6] +#define SWIGTYPE_p_lua_State swig_types[7] +#define SWIGTYPE_p_session_flag_t swig_types[8] +#define SWIGTYPE_p_switch_channel_state_t swig_types[9] +#define SWIGTYPE_p_switch_channel_t swig_types[10] +#define SWIGTYPE_p_switch_core_session_t swig_types[11] +#define SWIGTYPE_p_switch_event_t swig_types[12] +#define SWIGTYPE_p_switch_input_args_t swig_types[13] +#define SWIGTYPE_p_switch_input_type_t swig_types[14] +#define SWIGTYPE_p_switch_priority_t swig_types[15] +#define SWIGTYPE_p_switch_status_t swig_types[16] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[17] +#define SWIGTYPE_p_void swig_types[18] +static swig_type_info *swig_types[20]; +static swig_module_info swig_module = {swig_types, 19, 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) @@ -1571,6 +1572,175 @@ fail: } +static int _wrap_new_IVRMenu(lua_State* L) { + int SWIG_arg = -1; + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + char *arg6 = (char *) 0 ; + char *arg7 = (char *) 0 ; + char *arg8 = (char *) 0 ; + int arg9 ; + int arg10 ; + int arg11 ; + int arg12 ; + int arg13 ; + IVRMenu *result = 0 ; + + SWIG_check_num_args("IVRMenu",13,13) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("IVRMenu",2,"char const *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("IVRMenu",3,"char const *"); + if(!lua_isstring(L,4)) SWIG_fail_arg("IVRMenu",4,"char const *"); + if(!lua_isstring(L,5)) SWIG_fail_arg("IVRMenu",5,"char const *"); + if(!lua_isstring(L,6)) SWIG_fail_arg("IVRMenu",6,"char const *"); + if(!lua_isstring(L,7)) SWIG_fail_arg("IVRMenu",7,"char const *"); + if(!lua_isstring(L,8)) SWIG_fail_arg("IVRMenu",8,"char const *"); + if(!lua_isnumber(L,9)) SWIG_fail_arg("IVRMenu",9,"int"); + if(!lua_isnumber(L,10)) SWIG_fail_arg("IVRMenu",10,"int"); + if(!lua_isnumber(L,11)) SWIG_fail_arg("IVRMenu",11,"int"); + if(!lua_isnumber(L,12)) SWIG_fail_arg("IVRMenu",12,"int"); + if(!lua_isnumber(L,13)) SWIG_fail_arg("IVRMenu",13,"int"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("new_IVRMenu",1,SWIGTYPE_p_IVRMenu); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); + arg4 = (char *)lua_tostring(L, 4); + arg5 = (char *)lua_tostring(L, 5); + arg6 = (char *)lua_tostring(L, 6); + arg7 = (char *)lua_tostring(L, 7); + arg8 = (char *)lua_tostring(L, 8); + arg9 = (int)lua_tonumber(L, 9); + arg10 = (int)lua_tonumber(L, 10); + arg11 = (int)lua_tonumber(L, 11); + arg12 = (int)lua_tonumber(L, 12); + arg13 = (int)lua_tonumber(L, 13); + result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,arg11,arg12,arg13); + SWIG_arg=0; + SWIG_NewPointerObj(L,result,SWIGTYPE_p_IVRMenu,1); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_delete_IVRMenu(lua_State* L) { + int SWIG_arg = -1; + IVRMenu *arg1 = (IVRMenu *) 0 ; + + SWIG_check_num_args("IVRMenu",1,1) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("IVRMenu",1,"IVRMenu *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("delete_IVRMenu",1,SWIGTYPE_p_IVRMenu); + } + + delete arg1; + + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_IVRMenu_bindAction(lua_State* L) { + int SWIG_arg = -1; + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + + SWIG_check_num_args("bindAction",4,4) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("bindAction",1,"IVRMenu *"); + if(!lua_isstring(L,2)) SWIG_fail_arg("bindAction",2,"char *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("bindAction",3,"char const *"); + if(!lua_isstring(L,4)) SWIG_fail_arg("bindAction",4,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("IVRMenu_bindAction",1,SWIGTYPE_p_IVRMenu); + } + + arg2 = (char *)lua_tostring(L, 2); + arg3 = (char *)lua_tostring(L, 3); + arg4 = (char *)lua_tostring(L, 4); + (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_IVRMenu_execute(lua_State* L) { + int SWIG_arg = -1; + IVRMenu *arg1 = (IVRMenu *) 0 ; + CoreSession *arg2 = (CoreSession *) 0 ; + char *arg3 = (char *) 0 ; + + SWIG_check_num_args("execute",3,3) + if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("execute",1,"IVRMenu *"); + if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("execute",2,"CoreSession *"); + if(!lua_isstring(L,3)) SWIG_fail_arg("execute",3,"char const *"); + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_IVRMenu,0))){ + SWIG_fail_ptr("IVRMenu_execute",1,SWIGTYPE_p_IVRMenu); + } + + + if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){ + SWIG_fail_ptr("IVRMenu_execute",2,SWIGTYPE_p_CoreSession); + } + + arg3 = (char *)lua_tostring(L, 3); + (arg1)->execute(arg2,(char const *)arg3); + SWIG_arg=0; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static void swig_delete_IVRMenu(void *obj) { +IVRMenu *arg1 = (IVRMenu *) obj; +delete arg1; +} +static swig_lua_method swig_IVRMenu_methods[] = { + {"bindAction", _wrap_IVRMenu_bindAction}, + {"execute", _wrap_IVRMenu_execute}, + {0,0} +}; +static swig_lua_attribute swig_IVRMenu_attributes[] = { + {0,0,0} +}; +static swig_lua_class *swig_IVRMenu_bases[] = {0}; +static const char *swig_IVRMenu_base_names[] = {0}; +static swig_lua_class _wrap_class_IVRMenu = { "IVRMenu", &SWIGTYPE_p_IVRMenu,_wrap_new_IVRMenu, swig_delete_IVRMenu, swig_IVRMenu_methods, swig_IVRMenu_attributes, swig_IVRMenu_bases, swig_IVRMenu_base_names }; + static int _wrap_new_API(lua_State* L) { int SWIG_arg = -1; API *result = 0 ; @@ -5474,6 +5644,7 @@ static void *_p_SessionTo_p_CoreSession(void *x, int *newmemory) { static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)&_wrap_class_API, 0}; static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)&_wrap_class_CoreSession, 0}; static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)&_wrap_class_Event, 0}; +static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)&_wrap_class_IVRMenu, 0}; static swig_type_info _swigt__p_Session = {"_p_Session", "Session *", 0, 0, (void*)&_wrap_class_Session, 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)&_wrap_class_Stream, 0}; 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}; @@ -5494,6 +5665,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_API, &_swigt__p_CoreSession, &_swigt__p_Event, + &_swigt__p_IVRMenu, &_swigt__p_Session, &_swigt__p_Stream, &_swigt__p_input_callback_state, @@ -5514,6 +5686,7 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_Session, _p_SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Session[] = { {&_swigt__p_Session, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 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}}; @@ -5534,6 +5707,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_API, _swigc__p_CoreSession, _swigc__p_Event, + _swigc__p_IVRMenu, _swigc__p_Session, _swigc__p_Stream, _swigc__p_input_callback_state, diff --git a/src/mod/languages/mod_perl/Makefile b/src/mod/languages/mod_perl/Makefile index 4d51d1df67..e640ee4da2 100644 --- a/src/mod/languages/mod_perl/Makefile +++ b/src/mod/languages/mod_perl/Makefile @@ -11,7 +11,7 @@ include $(BASE)/build/modmake.rules swigclean: clean - rm -f mod_perl_wrap.* + rm -f mod_perl_wrap.* freeswitch.so freeswitch.pm mod_perl_wrap.cpp: swig -static -shadow -perl5 -c++ -DMULTIPLICITY -I../../../../src/include -o mod_perl_wrap.cpp freeswitch.i diff --git a/src/mod/languages/mod_perl/freeswitch.pm b/src/mod/languages/mod_perl/freeswitch.pm index d734d7f37f..af4791517e 100644 --- a/src/mod/languages/mod_perl/freeswitch.pm +++ b/src/mod/languages/mod_perl/freeswitch.pm @@ -56,6 +56,45 @@ package freeswitch; *hanguphook = *freeswitchc::hanguphook; *dtmf_callback = *freeswitchc::dtmf_callback; +############# Class : freeswitch::IVRMenu ############## + +package freeswitch::IVRMenu; +use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); +@ISA = qw( freeswitch ); +%OWNER = (); +%ITERATORS = (); +sub new { + my $pkg = shift; + my $self = freeswitchc::new_IVRMenu(@_); + bless $self, $pkg if defined($self); +} + +sub DESTROY { + return unless $_[0]->isa('HASH'); + my $self = tied(%{$_[0]}); + return unless defined $self; + delete $ITERATORS{$self}; + if (exists $OWNER{$self}) { + freeswitchc::delete_IVRMenu($self); + delete $OWNER{$self}; + } +} + +*bindAction = *freeswitchc::IVRMenu_bindAction; +*execute = *freeswitchc::IVRMenu_execute; +sub DISOWN { + my $self = shift; + my $ptr = tied(%$self); + delete $OWNER{$ptr}; +} + +sub ACQUIRE { + my $self = shift; + my $ptr = tied(%$self); + $OWNER{$ptr} = 1; +} + + ############# Class : freeswitch::API ############## package freeswitch::API; diff --git a/src/mod/languages/mod_perl/mod_perl.c b/src/mod/languages/mod_perl/mod_perl.c index 51b59865a5..8b5c19252d 100644 --- a/src/mod/languages/mod_perl/mod_perl.c +++ b/src/mod/languages/mod_perl/mod_perl.c @@ -121,14 +121,16 @@ static int perl_parse_and_execute(PerlInterpreter *my_perl, char *input_code, ch } if (!error) { char *file = input_code; - + char *err; + if (!switch_is_file_path(file)) { - file = switch_mprintf("do '%s/%s';\n", SWITCH_GLOBAL_dirs.script_dir, file); + file = switch_mprintf("require '%s/%s';", SWITCH_GLOBAL_dirs.script_dir, file); switch_assert(file); } else { - file = switch_mprintf("do '%s';\n", file); + file = switch_mprintf("require '%s';", file); switch_assert(file); } + error = Perl_safe_eval(my_perl, file); switch_safe_free(file); } diff --git a/src/mod/languages/mod_perl/mod_perl_wrap.cpp b/src/mod/languages/mod_perl/mod_perl_wrap.cpp index 26b8a85f4b..d04a4f7acd 100644 --- a/src/mod/languages/mod_perl/mod_perl_wrap.cpp +++ b/src/mod/languages/mod_perl/mod_perl_wrap.cpp @@ -1449,24 +1449,25 @@ SWIG_Perl_SetModule(swig_module_info *module) { #define SWIGTYPE_p_API swig_types[0] #define SWIGTYPE_p_CoreSession swig_types[1] #define SWIGTYPE_p_Event swig_types[2] -#define SWIGTYPE_p_PerlInterpreter swig_types[3] -#define SWIGTYPE_p_Session swig_types[4] -#define SWIGTYPE_p_Stream swig_types[5] -#define SWIGTYPE_p_char swig_types[6] -#define SWIGTYPE_p_input_callback_state swig_types[7] -#define SWIGTYPE_p_session_flag_t swig_types[8] -#define SWIGTYPE_p_switch_channel_state_t swig_types[9] -#define SWIGTYPE_p_switch_channel_t swig_types[10] -#define SWIGTYPE_p_switch_core_session_t swig_types[11] -#define SWIGTYPE_p_switch_event_t swig_types[12] -#define SWIGTYPE_p_switch_input_args_t swig_types[13] -#define SWIGTYPE_p_switch_input_type_t swig_types[14] -#define SWIGTYPE_p_switch_priority_t swig_types[15] -#define SWIGTYPE_p_switch_status_t swig_types[16] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[17] -#define SWIGTYPE_p_void swig_types[18] -static swig_type_info *swig_types[20]; -static swig_module_info swig_module = {swig_types, 19, 0, 0, 0, 0}; +#define SWIGTYPE_p_IVRMenu swig_types[3] +#define SWIGTYPE_p_PerlInterpreter swig_types[4] +#define SWIGTYPE_p_Session swig_types[5] +#define SWIGTYPE_p_Stream swig_types[6] +#define SWIGTYPE_p_char swig_types[7] +#define SWIGTYPE_p_input_callback_state swig_types[8] +#define SWIGTYPE_p_session_flag_t swig_types[9] +#define SWIGTYPE_p_switch_channel_state_t swig_types[10] +#define SWIGTYPE_p_switch_channel_t swig_types[11] +#define SWIGTYPE_p_switch_core_session_t swig_types[12] +#define SWIGTYPE_p_switch_event_t swig_types[13] +#define SWIGTYPE_p_switch_input_args_t swig_types[14] +#define SWIGTYPE_p_switch_input_type_t swig_types[15] +#define SWIGTYPE_p_switch_priority_t swig_types[16] +#define SWIGTYPE_p_switch_status_t swig_types[17] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[18] +#define SWIGTYPE_p_void swig_types[19] +static swig_type_info *swig_types[21]; +static swig_module_info swig_module = {swig_types, 20, 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) @@ -1557,42 +1558,6 @@ SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc) -SWIGINTERNINLINE SV * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - SV *obj = sv_newmortal(); - if (carray) { - sv_setpvn(obj, carray, size); - } else { - sv_setsv(obj, &PL_sv_undef); - } - return obj; -} - - -SWIGINTERNINLINE SV * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - -SWIGINTERNINLINE SV * -SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) -{ - SV *obj = sv_newmortal(); - sv_setiv(obj, (IV) value); - return obj; -} - - -SWIGINTERNINLINE SV * -SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) -{ - return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); -} - - #include #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) @@ -1721,6 +1686,42 @@ SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val) } +SWIGINTERNINLINE SV * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + SV *obj = sv_newmortal(); + if (carray) { + sv_setpvn(obj, carray, size); + } else { + sv_setsv(obj, &PL_sv_undef); + } + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + +SWIGINTERNINLINE SV * +SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value) +{ + SV *obj = sv_newmortal(); + sv_setiv(obj, (IV) value); + return obj; +} + + +SWIGINTERNINLINE SV * +SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value) +{ + return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value); +} + + SWIGINTERNINLINE SV * SWIG_From_bool SWIG_PERL_DECL_ARGS_1(bool value) { @@ -1923,6 +1924,297 @@ XS(_wrap_consoleCleanLog) { } +XS(_wrap_new_IVRMenu) { + { + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + char *arg6 = (char *) 0 ; + char *arg7 = (char *) 0 ; + char *arg8 = (char *) 0 ; + int arg9 ; + int arg10 ; + int arg11 ; + int arg12 ; + int arg13 ; + IVRMenu *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int res5 ; + char *buf5 = 0 ; + int alloc5 = 0 ; + int res6 ; + char *buf6 = 0 ; + int alloc6 = 0 ; + int res7 ; + char *buf7 = 0 ; + int alloc7 = 0 ; + int res8 ; + char *buf8 = 0 ; + int alloc8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + int val12 ; + int ecode12 = 0 ; + int val13 ; + int ecode13 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 13) || (items > 13)) { + SWIG_croak("Usage: new_IVRMenu(main,name,greeting_sound,short_greeting_sound,invalid_sound,exit_sound,confirm_macro,confirm_key,confirm_attempts,inter_timeout,digit_len,timeout,max_failures);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IVRMenu" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IVRMenu" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_IVRMenu" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_IVRMenu" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_IVRMenu" "', argument " "5"" of type '" "char const *""'"); + } + arg5 = reinterpret_cast< char * >(buf5); + res6 = SWIG_AsCharPtrAndSize(ST(5), &buf6, NULL, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_IVRMenu" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = reinterpret_cast< char * >(buf6); + res7 = SWIG_AsCharPtrAndSize(ST(6), &buf7, NULL, &alloc7); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_IVRMenu" "', argument " "7"" of type '" "char const *""'"); + } + arg7 = reinterpret_cast< char * >(buf7); + res8 = SWIG_AsCharPtrAndSize(ST(7), &buf8, NULL, &alloc8); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_IVRMenu" "', argument " "8"" of type '" "char const *""'"); + } + arg8 = reinterpret_cast< char * >(buf8); + ecode9 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(8), &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_IVRMenu" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(9), &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_IVRMenu" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(10), &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "new_IVRMenu" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + ecode12 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(11), &val12); + if (!SWIG_IsOK(ecode12)) { + SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "new_IVRMenu" "', argument " "12"" of type '" "int""'"); + } + arg12 = static_cast< int >(val12); + ecode13 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(12), &val13); + if (!SWIG_IsOK(ecode13)) { + SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "new_IVRMenu" "', argument " "13"" of type '" "int""'"); + } + arg13 = static_cast< int >(val13); + result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,arg11,arg12,arg13); + ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IVRMenu, SWIG_OWNER | SWIG_SHADOW); argvi++ ; + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc7 == SWIG_NEWOBJ) delete[] buf7; + if (alloc8 == SWIG_NEWOBJ) delete[] buf8; + + + + + + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc7 == SWIG_NEWOBJ) delete[] buf7; + if (alloc8 == SWIG_NEWOBJ) delete[] buf8; + + + + + + SWIG_croak_null(); + } +} + + +XS(_wrap_delete_IVRMenu) { + { + IVRMenu *arg1 = (IVRMenu *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 1) || (items > 1)) { + SWIG_croak("Usage: delete_IVRMenu(self);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_IVRMenu, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVRMenu" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + delete arg1; + + + + XSRETURN(argvi); + fail: + + SWIG_croak_null(); + } +} + + +XS(_wrap_IVRMenu_bindAction) { + { + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 4) || (items > 4)) { + SWIG_croak("Usage: IVRMenu_bindAction(self,action,arg,bind);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVRMenu_bindAction" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IVRMenu_bindAction" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IVRMenu_bindAction" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IVRMenu_bindAction" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); + + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + XSRETURN(argvi); + fail: + + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + SWIG_croak_null(); + } +} + + +XS(_wrap_IVRMenu_execute) { + { + IVRMenu *arg1 = (IVRMenu *) 0 ; + CoreSession *arg2 = (CoreSession *) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int argvi = 0; + dXSARGS; + + if ((items < 3) || (items > 3)) { + SWIG_croak("Usage: IVRMenu_execute(self,session,name);"); + } + res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVRMenu_execute" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IVRMenu_execute" "', argument " "2"" of type '" "CoreSession *""'"); + } + arg2 = reinterpret_cast< CoreSession * >(argp2); + res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IVRMenu_execute" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + (arg1)->execute(arg2,(char const *)arg3); + + + + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + XSRETURN(argvi); + fail: + + + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + SWIG_croak_null(); + } +} + + XS(_wrap_new_API) { { API *result = 0 ; @@ -6964,6 +7256,7 @@ static void *_p_SessionTo_p_CoreSession(void *x, int *newmemory) { static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)"freeswitch::API", 0}; static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)"freeswitch::CoreSession", 0}; static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)"freeswitch::Event", 0}; +static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 0, 0, (void*)"freeswitch::IVRMenu", 0}; static swig_type_info _swigt__p_PerlInterpreter = {"_p_PerlInterpreter", "PerlInterpreter *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Session = {"_p_Session", "Session *", 0, 0, (void*)"freeswitch::Session", 0}; static swig_type_info _swigt__p_Stream = {"_p_Stream", "Stream *", 0, 0, (void*)"freeswitch::Stream", 0}; @@ -6985,6 +7278,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_API, &_swigt__p_CoreSession, &_swigt__p_Event, + &_swigt__p_IVRMenu, &_swigt__p_PerlInterpreter, &_swigt__p_Session, &_swigt__p_Stream, @@ -7006,6 +7300,7 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_Session, _p_SessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PerlInterpreter[] = { {&_swigt__p_PerlInterpreter, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Session[] = { {&_swigt__p_Session, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; @@ -7027,6 +7322,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_API, _swigc__p_CoreSession, _swigc__p_Event, + _swigc__p_IVRMenu, _swigc__p_PerlInterpreter, _swigc__p_Session, _swigc__p_Stream, @@ -7060,6 +7356,10 @@ static swig_variable_info swig_variables[] = { static swig_command_info swig_commands[] = { {"freeswitchc::consoleLog", _wrap_consoleLog}, {"freeswitchc::consoleCleanLog", _wrap_consoleCleanLog}, +{"freeswitchc::new_IVRMenu", _wrap_new_IVRMenu}, +{"freeswitchc::delete_IVRMenu", _wrap_delete_IVRMenu}, +{"freeswitchc::IVRMenu_bindAction", _wrap_IVRMenu_bindAction}, +{"freeswitchc::IVRMenu_execute", _wrap_IVRMenu_execute}, {"freeswitchc::new_API", _wrap_new_API}, {"freeswitchc::delete_API", _wrap_delete_API}, {"freeswitchc::API_execute", _wrap_API_execute}, @@ -7454,6 +7754,7 @@ XS(SWIG_init) { SvREADONLY_on(sv); } + 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/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { diff --git a/src/mod/languages/mod_python/freeswitch.py b/src/mod/languages/mod_python/freeswitch.py index d491d88d49..f0799dca0b 100644 --- a/src/mod/languages/mod_python/freeswitch.py +++ b/src/mod/languages/mod_python/freeswitch.py @@ -1,5 +1,5 @@ # 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. # This file is compatible with both classic and new-style classes. @@ -50,6 +50,23 @@ del types consoleLog = _freeswitch.consoleLog consoleCleanLog = _freeswitch.consoleCleanLog +class IVRMenu(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, IVRMenu, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, IVRMenu, name) + __repr__ = _swig_repr + def __init__(self, *args): + this = _freeswitch.new_IVRMenu(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _freeswitch.delete_IVRMenu + __del__ = lambda self : None; + def bindAction(*args): return _freeswitch.IVRMenu_bindAction(*args) + def execute(*args): return _freeswitch.IVRMenu_execute(*args) +IVRMenu_swigregister = _freeswitch.IVRMenu_swigregister +IVRMenu_swigregister(IVRMenu) + class API(_object): __swig_setmethods__ = {} __setattr__ = lambda self, name, value: _swig_setattr(self, API, name, value) @@ -152,7 +169,7 @@ class CoreSession(_object): __setattr__ = lambda self, name, value: _swig_setattr(self, CoreSession, name, value) __swig_getmethods__ = {} __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 __swig_destroy__ = _freeswitch.delete_CoreSession __del__ = lambda self : None; diff --git a/src/mod/languages/mod_python/mod_python_wrap.cpp b/src/mod/languages/mod_python/mod_python_wrap.cpp index 864b299f02..16ddde84a8 100644 --- a/src/mod/languages/mod_python/mod_python_wrap.cpp +++ b/src/mod/languages/mod_python/mod_python_wrap.cpp @@ -1,6 +1,6 @@ /* ---------------------------------------------------------------------------- * 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 * coding conventions designed to improve portability and efficiency. Do not make @@ -12,7 +12,7 @@ #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #ifdef __cplusplus -template class SwigValueWrapper { +template class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } @@ -25,6 +25,10 @@ public: private: SwigValueWrapper& operator=(const SwigValueWrapper& rhs); }; + +template T SwigValueInit() { + return T(); +} #endif /* ----------------------------------------------------------------------------- @@ -34,14 +38,14 @@ private: /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR -# if defined(__SUNPRO_CC) -# if (__SUNPRO_CC <= 0x560) -# define SWIGTEMPLATEDISAMBIGUATOR template -# else -# define SWIGTEMPLATEDISAMBIGUATOR -# endif +# if defined(__SUNPRO_CC) && (__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 # else -# define SWIGTEMPLATEDISAMBIGUATOR +# define SWIGTEMPLATEDISAMBIGUATOR # endif #endif @@ -124,6 +128,12 @@ private: # define _CRT_SECURE_NO_DEPRECATE #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 */ #include @@ -137,7 +147,7 @@ private: /* This should only be incremented when either the layout of swig_type_info changes, 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" */ #ifdef SWIG_TYPE_TABLE @@ -172,6 +182,7 @@ private: /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 @@ -312,10 +323,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) { extern "C" { #endif -typedef void *(*swig_converter_func)(void *); +typedef void *(*swig_converter_func)(void *, int *); 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 { const char *name; /* mangled 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; 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 */ SWIGRUNTIMEINLINE void * -SWIG_TypeCast(swig_cast_info *ty, void *ptr) { - return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + 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(value); } 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 */ 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 (!min && !max) { return 1; } else { 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; } } @@ -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"); return 0; } else { - register int l = PyTuple_GET_SIZE(args); + register Py_ssize_t l = PyTuple_GET_SIZE(args); if (l < min) { 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; } else if (l > max) { 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; } else { register int i; @@ -1427,7 +1438,7 @@ PySwigObject_dealloc(PyObject *v) { PySwigObject *sobj = (PySwigObject *) v; PyObject *next = sobj->next; - if (sobj->own) { + if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; @@ -1445,12 +1456,13 @@ PySwigObject_dealloc(PyObject *v) res = ((*meth)(mself, v)); } 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 + 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); PyObject_DEL(v); @@ -1608,9 +1620,11 @@ _PySwigObject_type(void) { (unaryfunc)0, /*nb_float*/ (unaryfunc)PySwigObject_oct, /*nb_oct*/ (unaryfunc)PySwigObject_hex, /*nb_hex*/ -#if PY_VERSION_HEX >= 0x02020000 - 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 +#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 */ +#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 */ #endif }; @@ -1953,7 +1967,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { - if (own) { + if (own == SWIG_POINTER_OWN) { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; @@ -1974,6 +1988,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int return SWIG_OK; } else { PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + if (own) + *own = 0; while (sobj) { void *vptr = sobj->ptr; if (ty) { @@ -1987,7 +2003,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int if (!tc) { sobj = (PySwigObject *)sobj->next; } 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; } } @@ -1997,7 +2021,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } if (sobj) { - if (own) *own = sobj->own; + if (own) + *own = *own | sobj->own; if (flags & SWIG_POINTER_DISOWN) { sobj->own = 0; } @@ -2062,8 +2087,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { } if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); - if (!tc) return SWIG_ERROR; - *ptr = SWIG_TypeCast(tc,vptr); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + } else { + return SWIG_ERROR; + } } else { *ptr = vptr; } @@ -2468,24 +2498,25 @@ SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) #define SWIGTYPE_p_API swig_types[0] #define SWIGTYPE_p_CoreSession swig_types[1] #define SWIGTYPE_p_Event swig_types[2] -#define SWIGTYPE_p_PySession swig_types[3] -#define SWIGTYPE_p_Stream swig_types[4] -#define SWIGTYPE_p_char swig_types[5] -#define SWIGTYPE_p_input_callback_state swig_types[6] -#define SWIGTYPE_p_session_flag_t swig_types[7] -#define SWIGTYPE_p_swap_state_t swig_types[8] -#define SWIGTYPE_p_switch_channel_state_t swig_types[9] -#define SWIGTYPE_p_switch_channel_t swig_types[10] -#define SWIGTYPE_p_switch_core_session_t swig_types[11] -#define SWIGTYPE_p_switch_event_t swig_types[12] -#define SWIGTYPE_p_switch_input_args_t swig_types[13] -#define SWIGTYPE_p_switch_input_type_t swig_types[14] -#define SWIGTYPE_p_switch_priority_t swig_types[15] -#define SWIGTYPE_p_switch_status_t swig_types[16] -#define SWIGTYPE_p_switch_stream_handle_t swig_types[17] -#define SWIGTYPE_p_void swig_types[18] -static swig_type_info *swig_types[20]; -static swig_module_info swig_module = {swig_types, 19, 0, 0, 0, 0}; +#define SWIGTYPE_p_IVRMenu swig_types[3] +#define SWIGTYPE_p_PySession swig_types[4] +#define SWIGTYPE_p_Stream swig_types[5] +#define SWIGTYPE_p_char swig_types[6] +#define SWIGTYPE_p_input_callback_state swig_types[7] +#define SWIGTYPE_p_session_flag_t swig_types[8] +#define SWIGTYPE_p_swap_state_t swig_types[9] +#define SWIGTYPE_p_switch_channel_state_t swig_types[10] +#define SWIGTYPE_p_switch_channel_t swig_types[11] +#define SWIGTYPE_p_switch_core_session_t swig_types[12] +#define SWIGTYPE_p_switch_event_t swig_types[13] +#define SWIGTYPE_p_switch_input_args_t swig_types[14] +#define SWIGTYPE_p_switch_input_type_t swig_types[15] +#define SWIGTYPE_p_switch_priority_t swig_types[16] +#define SWIGTYPE_p_switch_status_t swig_types[17] +#define SWIGTYPE_p_switch_stream_handle_t swig_types[18] +#define SWIGTYPE_p_void swig_types[19] +static swig_type_info *swig_types[21]; +static swig_module_info swig_module = {swig_types, 20, 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) @@ -2504,7 +2535,7 @@ static swig_module_info swig_module = {swig_types, 19, 0, 0, 0, 0}; #define SWIG_name "_freeswitch" -#define SWIGVERSION 0x010331 +#define SWIGVERSION 0x010335 #define SWIG_VERSION SWIGVERSION @@ -2532,7 +2563,9 @@ namespace swig { 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) @@ -2647,49 +2680,13 @@ SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtrAndSize(const char* carray, size_t size) -{ - if (carray) { - if (size > INT_MAX) { - swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); - return pchar_descriptor ? - SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); - } else { - return PyString_FromStringAndSize(carray, static_cast< int >(size)); - } - } else { - return SWIG_Py_Void(); - } -} - - -SWIGINTERNINLINE PyObject * -SWIG_FromCharPtr(const char *cptr) -{ - return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); -} - - - #define SWIG_From_long PyInt_FromLong - - -SWIGINTERNINLINE PyObject * -SWIG_From_int (int value) -{ - return SWIG_From_long (value); -} - - #include -#ifndef LLONG_MIN -# define LLONG_MIN LONG_LONG_MIN -#endif -#ifndef LLONG_MAX -# define LLONG_MAX LONG_LONG_MAX -#endif -#ifndef ULLONG_MAX -# define ULLONG_MAX ULONG_LONG_MAX +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif #endif @@ -2828,6 +2825,40 @@ SWIG_AsVal_int (PyObject * obj, int *val) } +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { + return PyString_FromStringAndSize(carray, static_cast< int >(size)); + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + + #define SWIG_From_long PyInt_FromLong + + +SWIGINTERNINLINE PyObject * +SWIG_From_int (int value) +{ + return SWIG_From_long (value); +} + + SWIGINTERNINLINE PyObject* SWIG_From_bool (bool value) { @@ -2913,18 +2944,11 @@ SWIG_From_unsigned_SS_int (unsigned int value) SWIGINTERN int SWIG_AsVal_bool (PyObject *obj, bool *val) { - if (obj == Py_True) { - if (val) *val = true; - 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; - } + int r = PyObject_IsTrue(obj); + if (r == -1) + return SWIG_ERROR; + if (val) *val = r ? true : false; + return SWIG_OK; } #ifdef __cplusplus @@ -2990,6 +3014,285 @@ fail: } +SWIGINTERN PyObject *_wrap_new_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + char *arg5 = (char *) 0 ; + char *arg6 = (char *) 0 ; + char *arg7 = (char *) 0 ; + char *arg8 = (char *) 0 ; + int arg9 ; + int arg10 ; + int arg11 ; + int arg12 ; + int arg13 ; + IVRMenu *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int res5 ; + char *buf5 = 0 ; + int alloc5 = 0 ; + int res6 ; + char *buf6 = 0 ; + int alloc6 = 0 ; + int res7 ; + char *buf7 = 0 ; + int alloc7 = 0 ; + int res8 ; + char *buf8 = 0 ; + int alloc8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + int val12 ; + int ecode12 = 0 ; + int val13 ; + int ecode13 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + PyObject * obj11 = 0 ; + PyObject * obj12 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOOO:new_IVRMenu",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IVRMenu" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_IVRMenu" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_IVRMenu" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_IVRMenu" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_IVRMenu" "', argument " "5"" of type '" "char const *""'"); + } + arg5 = reinterpret_cast< char * >(buf5); + res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_IVRMenu" "', argument " "6"" of type '" "char const *""'"); + } + arg6 = reinterpret_cast< char * >(buf6); + res7 = SWIG_AsCharPtrAndSize(obj6, &buf7, NULL, &alloc7); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_IVRMenu" "', argument " "7"" of type '" "char const *""'"); + } + arg7 = reinterpret_cast< char * >(buf7); + res8 = SWIG_AsCharPtrAndSize(obj7, &buf8, NULL, &alloc8); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "new_IVRMenu" "', argument " "8"" of type '" "char const *""'"); + } + arg8 = reinterpret_cast< char * >(buf8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_IVRMenu" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_IVRMenu" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "new_IVRMenu" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + ecode12 = SWIG_AsVal_int(obj11, &val12); + if (!SWIG_IsOK(ecode12)) { + SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "new_IVRMenu" "', argument " "12"" of type '" "int""'"); + } + arg12 = static_cast< int >(val12); + ecode13 = SWIG_AsVal_int(obj12, &val13); + if (!SWIG_IsOK(ecode13)) { + SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "new_IVRMenu" "', argument " "13"" of type '" "int""'"); + } + arg13 = static_cast< int >(val13); + result = (IVRMenu *)new IVRMenu(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5,(char const *)arg6,(char const *)arg7,(char const *)arg8,arg9,arg10,arg11,arg12,arg13); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_IVRMenu, SWIG_POINTER_NEW | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc7 == SWIG_NEWOBJ) delete[] buf7; + if (alloc8 == SWIG_NEWOBJ) delete[] buf8; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + if (alloc5 == SWIG_NEWOBJ) delete[] buf5; + if (alloc6 == SWIG_NEWOBJ) delete[] buf6; + if (alloc7 == SWIG_NEWOBJ) delete[] buf7; + if (alloc8 == SWIG_NEWOBJ) delete[] buf8; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_IVRMenu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IVRMenu *arg1 = (IVRMenu *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_IVRMenu",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IVRMenu, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IVRMenu" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IVRMenu_bindAction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IVRMenu *arg1 = (IVRMenu *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; + char *arg4 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:IVRMenu_bindAction",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVRMenu_bindAction" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IVRMenu_bindAction" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IVRMenu_bindAction" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IVRMenu_bindAction" "', argument " "4"" of type '" "char const *""'"); + } + arg4 = reinterpret_cast< char * >(buf4); + (arg1)->bindAction(arg2,(char const *)arg3,(char const *)arg4); + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + if (alloc4 == SWIG_NEWOBJ) delete[] buf4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_IVRMenu_execute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + IVRMenu *arg1 = (IVRMenu *) 0 ; + CoreSession *arg2 = (CoreSession *) 0 ; + char *arg3 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:IVRMenu_execute",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_IVRMenu, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IVRMenu_execute" "', argument " "1"" of type '" "IVRMenu *""'"); + } + arg1 = reinterpret_cast< IVRMenu * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CoreSession, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IVRMenu_execute" "', argument " "2"" of type '" "CoreSession *""'"); + } + arg2 = reinterpret_cast< CoreSession * >(argp2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IVRMenu_execute" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + (arg1)->execute(arg2,(char const *)arg3); + resultobj = SWIG_Py_Void(); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return NULL; +} + + +SWIGINTERN PyObject *IVRMenu_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_IVRMenu, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + SWIGINTERN PyObject *_wrap_new_API(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; API *result = 0 ; @@ -3107,7 +3410,7 @@ fail: SWIGINTERN PyObject *API_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -3363,7 +3666,7 @@ fail: SWIGINTERN PyObject *input_callback_state_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -3409,7 +3712,7 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 1); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -3427,7 +3730,10 @@ SWIGINTERN PyObject *_wrap_new_Stream(PyObject *self, PyObject *args) { } 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; } @@ -3511,7 +3817,7 @@ fail: SWIGINTERN PyObject *Stream_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -3804,7 +4110,7 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 2); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -3854,7 +4160,12 @@ SWIGINTERN PyObject *_wrap_new_Event(PyObject *self, PyObject *args) { } 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; } @@ -3943,7 +4254,7 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 2); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -3971,7 +4282,10 @@ SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *self, PyObject *args) { } 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; } @@ -4043,7 +4357,7 @@ SWIGINTERN PyObject *_wrap_Event_setPriority(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 2); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -4071,7 +4385,10 @@ SWIGINTERN PyObject *_wrap_Event_setPriority(PyObject *self, PyObject *args) { } 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; } @@ -4292,7 +4609,7 @@ fail: SWIGINTERN PyObject *Event_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -4749,7 +5066,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 2); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -4777,7 +5094,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_hangup(PyObject *self, PyObject *args) { } 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; } @@ -5131,7 +5451,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *self, PyObject *args int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 5); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -5225,7 +5545,12 @@ SWIGINTERN PyObject *_wrap_CoreSession_recordFile(PyObject *self, PyObject *args } 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; } @@ -5376,7 +5701,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *self, PyObject *args) int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 4); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -5424,7 +5749,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_originate(PyObject *self, PyObject *args) } 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; } @@ -5896,7 +6224,7 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *self, PyObject *args int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 3); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -5934,7 +6262,10 @@ SWIGINTERN PyObject *_wrap_CoreSession_streamFile(PyObject *self, PyObject *args } 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; } @@ -6299,7 +6630,7 @@ fail: SWIGINTERN PyObject *CoreSession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -6550,7 +6881,7 @@ SWIGINTERN PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) { int ii; if (!PyTuple_Check(args)) SWIG_fail; - argc = PyObject_Length(args); + argc = (int)PyObject_Length(args); for (ii = 0; (ii < argc) && (ii < 1); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } @@ -6576,7 +6907,11 @@ SWIGINTERN PyObject *_wrap_new_PySession(PyObject *self, PyObject *args) { } 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; } @@ -6809,7 +7144,7 @@ fail: SWIGINTERN PyObject *PySession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { 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)); return SWIG_Py_Void(); } @@ -6817,6 +7152,11 @@ SWIGINTERN PyObject *PySession_swigregister(PyObject *SWIGUNUSEDPARM(self), PyOb static PyMethodDef SwigMethods[] = { { (char *)"consoleLog", _wrap_consoleLog, METH_VARARGS, NULL}, { (char *)"consoleCleanLog", _wrap_consoleCleanLog, METH_VARARGS, NULL}, + { (char *)"new_IVRMenu", _wrap_new_IVRMenu, METH_VARARGS, NULL}, + { (char *)"delete_IVRMenu", _wrap_delete_IVRMenu, METH_VARARGS, NULL}, + { (char *)"IVRMenu_bindAction", _wrap_IVRMenu_bindAction, METH_VARARGS, NULL}, + { (char *)"IVRMenu_execute", _wrap_IVRMenu_execute, METH_VARARGS, NULL}, + { (char *)"IVRMenu_swigregister", IVRMenu_swigregister, METH_VARARGS, NULL}, { (char *)"new_API", _wrap_new_API, METH_VARARGS, NULL}, { (char *)"delete_API", _wrap_delete_API, METH_VARARGS, NULL}, { (char *)"API_execute", _wrap_API_execute, METH_VARARGS, NULL}, @@ -6922,16 +7262,17 @@ static PyMethodDef SwigMethods[] = { /* -------- 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)); } static swig_type_info _swigt__p_API = {"_p_API", "API *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_CoreSession = {"_p_CoreSession", "CoreSession *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_Event = {"_p_Event", "Event *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_IVRMenu = {"_p_IVRMenu", "IVRMenu *", 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_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_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}; @@ -6949,6 +7290,7 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_API, &_swigt__p_CoreSession, &_swigt__p_Event, + &_swigt__p_IVRMenu, &_swigt__p_PySession, &_swigt__p_Stream, &_swigt__p_char, @@ -6970,6 +7312,7 @@ static swig_type_info *swig_type_initial[] = { static swig_cast_info _swigc__p_API[] = { {&_swigt__p_API, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_CoreSession[] = { {&_swigt__p_CoreSession, 0, 0, 0}, {&_swigt__p_PySession, _p_PySessionTo_p_CoreSession, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Event[] = { {&_swigt__p_Event, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_IVRMenu[] = { {&_swigt__p_IVRMenu, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PySession[] = { {&_swigt__p_PySession, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_Stream[] = { {&_swigt__p_Stream, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; @@ -6991,6 +7334,7 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_API, _swigc__p_CoreSession, _swigc__p_Event, + _swigc__p_IVRMenu, _swigc__p_PySession, _swigc__p_Stream, _swigc__p_char, @@ -7075,7 +7419,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found; + int found, init; clientdata = clientdata; @@ -7085,6 +7429,9 @@ SWIG_InitializeModule(void *clientdata) { swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; + init = 1; + } else { + init = 0; } /* Try and load any already created modules */ @@ -7113,6 +7460,12 @@ SWIG_InitializeModule(void *clientdata) { 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 */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); diff --git a/src/switch_cpp.cpp b/src/switch_cpp.cpp index 97a531e4fb..266528867f 100644 --- a/src/switch_cpp.cpp +++ b/src/switch_cpp.cpp @@ -37,6 +37,59 @@ #pragma warning(disable:4127 4003) #endif + +SWITCH_DECLARE_CONSTRUCTOR IVRMenu::IVRMenu(IVRMenu *main, + const char *name, + const char *greeting_sound, + const char *short_greeting_sound, + const char *invalid_sound, + const char *exit_sound, + const char *confirm_macro, + const char *confirm_key, + int confirm_attempts, + int inter_timeout, + int digit_len, + int timeout, + int max_failures) +{ + menu = NULL; + switch_core_new_memory_pool(&pool); + switch_assert(pool); + if (switch_strlen_zero(name)) { + name = "no name"; + } + + switch_ivr_menu_init(&menu, main ? main->menu : NULL, name, greeting_sound, short_greeting_sound, invalid_sound, + exit_sound, confirm_macro, confirm_key, confirm_attempts, inter_timeout, digit_len, timeout, max_failures, pool); + + +} + +SWITCH_DECLARE_CONSTRUCTOR IVRMenu::~IVRMenu() +{ + if (menu) { + switch_ivr_menu_stack_free(menu); + } + switch_core_destroy_memory_pool(&pool); +} + +SWITCH_DECLARE(void) IVRMenu::bindAction(char *action, const char *arg, const char *bind) +{ + switch_ivr_action_t ivr_action = SWITCH_IVR_ACTION_NOOP; + + if (switch_ivr_menu_str2action(action, &ivr_action) == SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bind %s to %s(%s)\n", bind, action, arg); + switch_ivr_menu_bind_action(menu, ivr_action, arg, bind); + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid action %s\n", action); + } +} + +SWITCH_DECLARE(void) IVRMenu::execute(CoreSession *session, const char *name) +{ + switch_ivr_menu_execute(session->session, menu, (char *)name, NULL); +} + SWITCH_DECLARE_CONSTRUCTOR API::API() { last_data = NULL; diff --git a/src/switch_ivr_menu.c b/src/switch_ivr_menu.c index 5716fe2502..1ffc187471 100644 --- a/src/switch_ivr_menu.c +++ b/src/switch_ivr_menu.c @@ -601,6 +601,27 @@ static struct iam_s { }; +SWITCH_DECLARE(switch_status_t) switch_ivr_menu_str2action(const char *action_name, switch_ivr_action_t *action) +{ + int i; + + if (!switch_strlen_zero(action_name)) { + for(i = 0;;i++) { + if (!iam[i].name) { + break; + } + + if (!strcasecmp(iam[i].name, action_name)) { + *action = iam[i].action; + return SWITCH_STATUS_SUCCESS; + } + } + } + + return SWITCH_STATUS_FALSE; +} + + static switch_bool_t is_valid_action(const char *action) { int i;