Freeswitch-trunk
Threads by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
March 2009
- 16 participants
- 508 discussions
[commit] r12730 - in freeswitch/trunk/src: . include mod/languages/mod_lua mod/languages/mod_managed mod/languages/mod_managed/managed mod/languages/mod_perl mod/languages/mod_python
by FreeSWITCH SVN 24 Mar '09
by FreeSWITCH SVN 24 Mar '09
24 Mar '09
Author: anthm
Date: Tue Mar 24 10:30:08 2009
New Revision: 12730
Log:
fix hanguphook order of operations vs destroy method issue in c++ code
Modified:
freeswitch/trunk/src/include/switch_cpp.h
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h
freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx
freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp
freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h
freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h
freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
freeswitch/trunk/src/switch_cpp.cpp
Modified: freeswitch/trunk/src/include/switch_cpp.h
==============================================================================
--- freeswitch/trunk/src/include/switch_cpp.h (original)
+++ freeswitch/trunk/src/include/switch_cpp.h Tue Mar 24 10:30:08 2009
@@ -264,7 +264,7 @@
SWITCH_DECLARE(int) originate(CoreSession * a_leg_session, char *dest, int timeout = 60);
- SWITCH_DECLARE(void) destroy(void);
+ SWITCH_DECLARE(virtual void) destroy(void);
/** \brief set a DTMF callback function
*
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp Tue Mar 24 10:30:08 2009
@@ -21,8 +21,14 @@
hh = mark = 0;
}
static switch_status_t lua_hanguphook(switch_core_session_t *session_hungup);
-Session::~Session()
+
+
+void Session::destroy(void)
{
+
+ if (!allocated) {
+ return;
+ }
if (session) {
if (!channel) {
@@ -30,8 +36,6 @@
}
switch_channel_set_private(channel, "CoreSession", NULL);
switch_core_event_hook_remove_state_change(session, lua_hanguphook);
- session = NULL;
- channel = NULL;
}
switch_safe_free(hangup_func_str);
@@ -39,8 +43,13 @@
switch_safe_free(cb_function);
switch_safe_free(cb_arg);
- init_vars();
-
+ CoreSession::destroy();
+}
+
+
+Session::~Session()
+{
+ destroy();
}
bool Session::begin_allow_threads()
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.h Tue Mar 24 10:30:08 2009
@@ -23,6 +23,7 @@
Session(char *uuid, CoreSession *a_leg = NULL);
Session(switch_core_session_t *session);
~Session();
+ virtual void destroy(void);
virtual bool begin_allow_threads();
virtual bool end_allow_threads();
@@ -40,6 +41,7 @@
char *hangup_func_str;
char *hangup_func_arg;
void setLUA(lua_State *state);
+
};
}
#endif
Modified: freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/mod_lua_wrap.cpp Tue Mar 24 10:30:08 2009
@@ -7388,6 +7388,30 @@
}
+static int _wrap_Session_destroy(lua_State* L) {
+ int SWIG_arg = -1;
+ LUA::Session *arg1 = (LUA::Session *) 0 ;
+
+ SWIG_check_num_args("destroy",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("destroy",1,"LUA::Session *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_LUA__Session,0))){
+ SWIG_fail_ptr("Session_destroy",1,SWIGTYPE_p_LUA__Session);
+ }
+
+ (arg1)->destroy();
+ SWIG_arg=0;
+
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_Session_begin_allow_threads(lua_State* L) {
int SWIG_arg = -1;
LUA::Session *arg1 = (LUA::Session *) 0 ;
@@ -8086,6 +8110,7 @@
delete arg1;
}
static swig_lua_method swig_LUA_Session_methods[] = {
+ {"destroy", _wrap_Session_destroy},
{"begin_allow_threads", _wrap_Session_begin_allow_threads},
{"end_allow_threads", _wrap_Session_end_allow_threads},
{"check_hangup_hook", _wrap_Session_check_hangup_hook},
Modified: freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx (original)
+++ freeswitch/trunk/src/mod/languages/mod_managed/freeswitch_wrap.cxx Tue Mar 24 10:30:08 2009
@@ -1444,6 +1444,17 @@
}
+SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE_get() {
+ char * jresult ;
+ char *result = 0 ;
+
+ result = (char *) "transfer_after_bridge";
+
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
SWIGEXPORT char * SWIGSTDCALL CSharp_SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE_get() {
char * jresult ;
char *result = 0 ;
@@ -13113,6 +13124,64 @@
}
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_samples_in_set(void * jarg1, void * jarg2) {
+ switch_file_handle *arg1 = (switch_file_handle *) 0 ;
+ switch_size_t arg2 ;
+ switch_size_t *argp2 ;
+
+ arg1 = (switch_file_handle *)jarg1;
+ argp2 = (switch_size_t *)jarg2;
+ if (!argp2) {
+ SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0);
+ return ;
+ }
+ arg2 = *argp2;
+ if (arg1) (arg1)->samples_in = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_file_handle_samples_in_get(void * jarg1) {
+ void * jresult ;
+ switch_file_handle *arg1 = (switch_file_handle *) 0 ;
+ switch_size_t result;
+
+ arg1 = (switch_file_handle *)jarg1;
+ result = ((arg1)->samples_in);
+ jresult = new switch_size_t((switch_size_t &)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_samples_out_set(void * jarg1, void * jarg2) {
+ switch_file_handle *arg1 = (switch_file_handle *) 0 ;
+ switch_size_t arg2 ;
+ switch_size_t *argp2 ;
+
+ arg1 = (switch_file_handle *)jarg1;
+ argp2 = (switch_size_t *)jarg2;
+ if (!argp2) {
+ SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0);
+ return ;
+ }
+ arg2 = *argp2;
+ if (arg1) (arg1)->samples_out = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_file_handle_samples_out_get(void * jarg1) {
+ void * jresult ;
+ switch_file_handle *arg1 = (switch_file_handle *) 0 ;
+ switch_size_t result;
+
+ arg1 = (switch_file_handle *)jarg1;
+ result = ((arg1)->samples_out);
+ jresult = new switch_size_t((switch_size_t &)result);
+ return jresult;
+}
+
+
SWIGEXPORT void SWIGSTDCALL CSharp_switch_file_handle_vol_set(void * jarg1, int jarg2) {
switch_file_handle *arg1 = (switch_file_handle *) 0 ;
int32_t arg2 ;
@@ -22245,6 +22314,18 @@
}
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_process_import(void * jarg1, void * jarg2, char * jarg3) {
+ switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
+ switch_channel_t *arg2 = (switch_channel_t *) 0 ;
+ char *arg3 = (char *) 0 ;
+
+ arg1 = (switch_core_session_t *)jarg1;
+ arg2 = (switch_channel_t *)jarg2;
+ arg3 = (char *)jarg3;
+ switch_process_import(arg1,arg2,(char const *)arg3);
+}
+
+
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() {
int jresult ;
int result;
Modified: freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs (original)
+++ freeswitch/trunk/src/mod/languages/mod_managed/managed/swig.cs Tue Mar 24 10:30:08 2009
@@ -249,7 +249,7 @@
return ret;
}
- public void destroy() {
+ public virtual void destroy() {
freeswitchPINVOKE.CoreSession_destroy(swigCPtr);
}
@@ -3382,6 +3382,10 @@
return ret;
}
+ public static void switch_process_import(SWIGTYPE_p_switch_core_session session, SWIGTYPE_p_switch_channel peer_channel, string varname) {
+ freeswitchPINVOKE.switch_process_import(SWIGTYPE_p_switch_core_session.getCPtr(session), SWIGTYPE_p_switch_channel.getCPtr(peer_channel), varname);
+ }
+
public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen));
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
@@ -4181,6 +4185,7 @@
public static readonly string SWITCH_LOCAL_VIDEO_PORT_VARIABLE = freeswitchPINVOKE.SWITCH_LOCAL_VIDEO_PORT_VARIABLE_get();
public static readonly string SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE_get();
public static readonly string SWITCH_PARK_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_PARK_AFTER_BRIDGE_VARIABLE_get();
+ public static readonly string SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE = freeswitchPINVOKE.SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE_get();
public static readonly string SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE = freeswitchPINVOKE.SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE_get();
public static readonly string SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE = freeswitchPINVOKE.SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE_get();
public static readonly string SWITCH_MAX_FORWARDS_VARIABLE = freeswitchPINVOKE.SWITCH_MAX_FORWARDS_VARIABLE_get();
@@ -4754,6 +4759,9 @@
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_PARK_AFTER_BRIDGE_VARIABLE_get")]
public static extern string SWITCH_PARK_AFTER_BRIDGE_VARIABLE_get();
+ [DllImport("mod_managed", EntryPoint="CSharp_SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE_get")]
+ public static extern string SWITCH_TRANSFER_AFTER_BRIDGE_VARIABLE_get();
+
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE_get")]
public static extern string SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE_get();
@@ -7520,6 +7528,18 @@
[DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_offset_pos_get")]
public static extern uint switch_file_handle_offset_pos_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_samples_in_set")]
+ public static extern void switch_file_handle_samples_in_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_samples_in_get")]
+ public static extern IntPtr switch_file_handle_samples_in_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_samples_out_set")]
+ public static extern void switch_file_handle_samples_out_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_samples_out_get")]
+ public static extern IntPtr switch_file_handle_samples_out_get(HandleRef jarg1);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_file_handle_vol_set")]
public static extern void switch_file_handle_vol_set(HandleRef jarg1, int jarg2);
@@ -9632,6 +9652,9 @@
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_sound_test")]
public static extern int switch_ivr_sound_test(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_process_import")]
+ public static extern void switch_process_import(HandleRef jarg1, HandleRef jarg2, string jarg3);
+
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")]
public static extern int SWITCH_RTP_MAX_BUF_LEN_get();
@@ -20488,6 +20511,30 @@
}
}
+ public SWIGTYPE_p_switch_size_t samples_in {
+ set {
+ freeswitchPINVOKE.switch_file_handle_samples_in_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value));
+ if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+ }
+ get {
+ SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_file_handle_samples_in_get(swigCPtr), true);
+ if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+
+ public SWIGTYPE_p_switch_size_t samples_out {
+ set {
+ freeswitchPINVOKE.switch_file_handle_samples_out_set(swigCPtr, SWIGTYPE_p_switch_size_t.getCPtr(value));
+ if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+ }
+ get {
+ SWIGTYPE_p_switch_size_t ret = new SWIGTYPE_p_switch_size_t(freeswitchPINVOKE.switch_file_handle_samples_out_get(swigCPtr), true);
+ if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+ }
+
public int vol {
set {
freeswitchPINVOKE.switch_file_handle_vol_set(swigCPtr, value);
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch.pm Tue Mar 24 10:30:08 2009
@@ -478,6 +478,7 @@
}
}
+*destroy = *freeswitchc::Session_destroy;
*begin_allow_threads = *freeswitchc::Session_begin_allow_threads;
*end_allow_threads = *freeswitchc::Session_end_allow_threads;
*check_hangup_hook = *freeswitchc::Session_check_hangup_hook;
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.cpp Tue Mar 24 10:30:08 2009
@@ -44,18 +44,33 @@
}
}
static switch_status_t perl_hanguphook(switch_core_session_t *session_hungup);
-Session::~Session()
+
+void Session::destroy(void)
{
- switch_safe_free(cb_function);
- switch_safe_free(cb_arg);
+
+ if (!allocated) {
+ return;
+ }
- if (session && hangup_func_str) {
+ if (session) {
+ if (!channel) {
+ channel = switch_core_session_get_channel(session);
+ }
+ switch_channel_set_private(channel, "CoreSession", NULL);
switch_core_event_hook_remove_state_change(session, perl_hanguphook);
}
+ switch_safe_free(cb_function);
+ switch_safe_free(cb_arg);
switch_safe_free(hangup_func_str);
- switch_safe_free(hangup_func_arg);
+ switch_safe_free(hangup_func_arg);
+
+ CoreSession::destroy();
+}
+Session::~Session()
+{
+ destroy();
}
bool Session::begin_allow_threads()
Modified: freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/freeswitch_perl.h Tue Mar 24 10:30:08 2009
@@ -31,7 +31,8 @@
Session(char *uuid, CoreSession *a_leg = NULL);
Session(switch_core_session_t *session);
~Session();
-
+
+ virtual void destroy(void);
virtual bool begin_allow_threads();
virtual bool end_allow_threads();
virtual void check_hangup_hook();
Modified: freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_perl/mod_perl_wrap.cpp Tue Mar 24 10:30:08 2009
@@ -9942,6 +9942,33 @@
}
+XS(_wrap_Session_destroy) {
+ {
+ PERL::Session *arg1 = (PERL::Session *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Session_destroy(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_PERL__Session, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroy" "', argument " "1"" of type '" "PERL::Session *""'");
+ }
+ arg1 = reinterpret_cast< PERL::Session * >(argp1);
+ (arg1)->destroy();
+
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_Session_begin_allow_threads) {
{
PERL::Session *arg1 = (PERL::Session *) 0 ;
@@ -11217,6 +11244,7 @@
{"freeswitchc::dtmf_callback", _wrap_dtmf_callback},
{"freeswitchc::new_Session", _wrap_new_Session},
{"freeswitchc::delete_Session", _wrap_delete_Session},
+{"freeswitchc::Session_destroy", _wrap_Session_destroy},
{"freeswitchc::Session_begin_allow_threads", _wrap_Session_begin_allow_threads},
{"freeswitchc::Session_end_allow_threads", _wrap_Session_end_allow_threads},
{"freeswitchc::Session_check_hangup_hook", _wrap_Session_check_hangup_hook},
@@ -11534,17 +11562,17 @@
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);
Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch.py Tue Mar 24 10:30:08 2009
@@ -324,6 +324,7 @@
def begin_allow_threads(*args): return _freeswitch.Session_begin_allow_threads(*args)
def end_allow_threads(*args): return _freeswitch.Session_end_allow_threads(*args)
def check_hangup_hook(*args): return _freeswitch.Session_check_hangup_hook(*args)
+ def destroy(*args): return _freeswitch.Session_destroy(*args)
def run_dtmf_callback(*args): return _freeswitch.Session_run_dtmf_callback(*args)
def setInputCallback(*args): return _freeswitch.Session_setInputCallback(*args)
def unsetInputCallback(*args): return _freeswitch.Session_unsetInputCallback(*args)
Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.cpp Tue Mar 24 10:30:08 2009
@@ -21,16 +21,25 @@
}
static switch_status_t python_hanguphook(switch_core_session_t *session_hungup);
-Session::~Session()
+void Session::destroy(void)
{
- if (hangup_func) {
- if (session) {
- switch_core_event_hook_remove_state_change(session, python_hanguphook);
+ if (!allocated) {
+ return;
+ }
+
+ if (session) {
+ if (!channel) {
+ channel = switch_core_session_get_channel(session);
}
- Py_DECREF(hangup_func);
- hangup_func = NULL;
+ switch_channel_set_private(channel, "CoreSession", NULL);
+ switch_core_event_hook_remove_state_change(session, python_hanguphook);
}
+
+ if (hangup_func) {
+ Py_DECREF(hangup_func);
+ hangup_func = NULL;
+ }
if (hangup_func_arg) {
Py_DECREF(hangup_func_arg);
@@ -49,7 +58,14 @@
if (Self) {
Py_DECREF(Self);
- }
+ }
+
+ CoreSession::destroy();
+}
+
+Session::~Session()
+{
+ destroy();
}
bool Session::begin_allow_threads()
Modified: freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/freeswitch_python.h Tue Mar 24 10:30:08 2009
@@ -27,6 +27,7 @@
virtual bool begin_allow_threads();
virtual bool end_allow_threads();
virtual void check_hangup_hook();
+ virtual void destroy(void);
virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype);
void setInputCallback(PyObject *cbfunc, PyObject *funcargs = NULL);
Modified: freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_python/mod_python_wrap.cpp Tue Mar 24 10:30:08 2009
@@ -9442,6 +9442,27 @@
}
+SWIGINTERN PyObject *_wrap_Session_destroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Session_destroy",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PYTHON__Session, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Session_destroy" "', argument " "1"" of type '" "PYTHON::Session *""'");
+ }
+ arg1 = reinterpret_cast< PYTHON::Session * >(argp1);
+ (arg1)->destroy();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_Session_run_dtmf_callback(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
PYTHON::Session *arg1 = (PYTHON::Session *) 0 ;
@@ -10114,6 +10135,7 @@
{ (char *)"Session_begin_allow_threads", _wrap_Session_begin_allow_threads, METH_VARARGS, NULL},
{ (char *)"Session_end_allow_threads", _wrap_Session_end_allow_threads, METH_VARARGS, NULL},
{ (char *)"Session_check_hangup_hook", _wrap_Session_check_hangup_hook, METH_VARARGS, NULL},
+ { (char *)"Session_destroy", _wrap_Session_destroy, METH_VARARGS, NULL},
{ (char *)"Session_run_dtmf_callback", _wrap_Session_run_dtmf_callback, METH_VARARGS, NULL},
{ (char *)"Session_setInputCallback", _wrap_Session_setInputCallback, METH_VARARGS, NULL},
{ (char *)"Session_unsetInputCallback", _wrap_Session_unsetInputCallback, METH_VARARGS, NULL},
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Tue Mar 24 10:30:08 2009
@@ -887,6 +887,10 @@
SWITCH_DECLARE(void) CoreSession::destroy(void)
{
this_check_void();
+
+ if (!allocated) {
+ return;
+ }
switch_safe_free(xml_cdr_text);
switch_safe_free(uuid);
@@ -903,7 +907,7 @@
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "destroy/unlink session from object\n");
-
+
if (switch_channel_up(channel) && switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
@@ -912,7 +916,7 @@
channel = NULL;
}
- allocated = 0;
+ init_vars();
}
1
0
Author: brian
Date: Tue Mar 24 10:00:44 2009
New Revision: 12729
Log:
ESL-9
Modified:
freeswitch/trunk/libs/esl/python/single_command.py
Modified: freeswitch/trunk/libs/esl/python/single_command.py
==============================================================================
--- freeswitch/trunk/libs/esl/python/single_command.py (original)
+++ freeswitch/trunk/libs/esl/python/single_command.py Tue Mar 24 10:00:44 2009
@@ -2,21 +2,42 @@
import string
import sys
+from optparse import OptionParser
from ESL import *
-con = ESLconnection("localhost","8021","ClueCon")
-#are we connected?
-
-if con.connected:
-
- #get argument passed to script
- command = string.join(sys.argv[1:])
-
- #run command
- e=con.sendRecv("api "+ command)
- print e.getBody()
-
-else:
-
- print "Not Connected"
-
+def main(argv):
+
+ try:
+
+ parser = OptionParser()
+ parser.add_option("-a", "--auth", dest="auth", default="ClueCon",
+ help="ESL password")
+ parser.add_option("-s", "--server", dest="server", default="127.0.0.1",
+ help="FreeSWITCH server IP address")
+ parser.add_option("-p", "--port", dest="port", default="8021",
+ help="FreeSWITCH server event socket port")
+ parser.add_option("-c", "--command", dest="command",
+ help="command to run, surround mutli word commands in \"\'s")
+
+ (options, args) = parser.parse_args()
+
+
+ con = ESLconnection(options.server, options.port, options.auth)
+ #are we connected?
+
+ if con.connected:
+ #run command
+ e=con.sendRecv("api "+ options.command)
+ print e.getBody()
+
+ else:
+
+ print "Not Connected"
+ sys.exit(2)
+
+ except:
+
+ print parser.get_usage()
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
\ No newline at end of file
1
0
[commit] r12728 - in freeswitch/trunk/src: . mod/formats/mod_sndfile mod/languages/mod_lua
by FreeSWITCH SVN 24 Mar '09
by FreeSWITCH SVN 24 Mar '09
24 Mar '09
Author: anthm
Date: Tue Mar 24 09:54:13 2009
New Revision: 12728
Log:
FSCORE-341
Modified:
freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
freeswitch/trunk/src/switch_core_file.c
freeswitch/trunk/src/switch_cpp.cpp
Modified: freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c
==============================================================================
--- freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c (original)
+++ freeswitch/trunk/src/mod/formats/mod_sndfile/mod_sndfile.c Tue Mar 24 09:54:13 2009
@@ -103,7 +103,8 @@
context->sfinfo.channels = handle->channels;
context->sfinfo.samplerate = handle->samplerate;
if (handle->samplerate == 8000 || handle->samplerate == 16000 ||
- handle->samplerate == 24000 || handle->samplerate == 32000 || handle->samplerate == 48000) {
+ handle->samplerate == 24000 || handle->samplerate == 32000 || handle->samplerate == 48000 ||
+ handle->samplerate == 11025 || handle->samplerate == 22050 || handle->samplerate == 44100) {
context->sfinfo.format |= SF_FORMAT_PCM_16;
}
Modified: freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp (original)
+++ freeswitch/trunk/src/mod/languages/mod_lua/freeswitch_lua.cpp Tue Mar 24 09:54:13 2009
@@ -24,20 +24,23 @@
Session::~Session()
{
- if (channel) {
- switch_channel_set_private(channel, "CoreSession", NULL);
- }
-
- if (hangup_func_str) {
- if (session) {
- switch_core_event_hook_remove_state_change(session, lua_hanguphook);
+ if (session) {
+ if (!channel) {
+ channel = switch_core_session_get_channel(session);
}
- switch_safe_free(hangup_func_str);
+ switch_channel_set_private(channel, "CoreSession", NULL);
+ switch_core_event_hook_remove_state_change(session, lua_hanguphook);
+ session = NULL;
+ channel = NULL;
}
+ switch_safe_free(hangup_func_str);
switch_safe_free(hangup_func_arg);
switch_safe_free(cb_function);
switch_safe_free(cb_arg);
+
+ init_vars();
+
}
bool Session::begin_allow_threads()
Modified: freeswitch/trunk/src/switch_core_file.c
==============================================================================
--- freeswitch/trunk/src/switch_core_file.c (original)
+++ freeswitch/trunk/src/switch_core_file.c Tue Mar 24 09:54:13 2009
@@ -290,10 +290,10 @@
fh->dbuf = switch_core_alloc(fh->memory_pool, fh->dbuflen);
}
switch_assert(fh->resampler->to_len <= fh->dbuflen);
- memcpy(fh->dbuf, fh->resampler->to, fh->resampler->to_len);
+ memcpy(fh->dbuf, fh->resampler->to, fh->resampler->to_len * 2);
data = fh->dbuf;
} else {
- memcpy(data, fh->resampler->to, fh->resampler->to_len);
+ memcpy(data, fh->resampler->to, fh->resampler->to_len * 2);
}
*len = fh->resampler->to_len / fh->channels;
Modified: freeswitch/trunk/src/switch_cpp.cpp
==============================================================================
--- freeswitch/trunk/src/switch_cpp.cpp (original)
+++ freeswitch/trunk/src/switch_cpp.cpp Tue Mar 24 09:54:13 2009
@@ -888,22 +888,28 @@
{
this_check_void();
- if (channel) {
- switch_channel_set_private(channel, "CoreSession", NULL);
- }
-
switch_safe_free(xml_cdr_text);
switch_safe_free(uuid);
switch_safe_free(tts_name);
switch_safe_free(voice_name);
if (session) {
+ if (!channel) {
+ channel = switch_core_session_get_channel(session);
+ }
+
+ if (channel) {
+ switch_channel_set_private(channel, "CoreSession", NULL);
+ }
+
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "destroy/unlink session from object\n");
- if (switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
+
+ if (switch_channel_up(channel) && switch_test_flag(this, S_HUP) && !switch_channel_test_flag(channel, CF_TRANSFER)) {
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
}
switch_core_session_rwunlock(session);
session = NULL;
+ channel = NULL;
}
allocated = 0;
1
0
24 Mar '09
Author: silik0n
Date: Tue Mar 24 03:43:19 2009
New Revision: 12727
Log:
you dont need my RFC1918 address in your configs
Modified:
freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php
freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSDirectory.php
Modified: freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php (original)
+++ freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php Tue Mar 24 03:43:19 2009
@@ -45,7 +45,7 @@
public function __construct(){
$dbtype='mysql'; /* Set the Database type */
// $db_hostname = 'localhost'; /* Database Server hostname */
- $db_hostname = '192.168.1.140'; /* Database Server hostname */
+ $db_hostname = '127.0.0.1'; /* Database Server hostname */
$db_port = '3306'; /* Database Server Port */
$db_username = 'root'; /* Database Server username */
$db_password = 'password'; /* Database Server password */
Modified: freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSDirectory.php
==============================================================================
--- freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSDirectory.php (original)
+++ freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSDirectory.php Tue Mar 24 03:43:19 2009
@@ -45,7 +45,7 @@
public function __construct(){
$dbtype='mysql'; /* Set the Database type */
// $db_hostname = 'localhost'; /* Database Server hostname */
- $db_hostname = '192.168.1.140'; /* Database Server hostname */
+ $db_hostname = '127.0.0.1'; /* Database Server hostname */
$db_port = '3306'; /* Database Server Port */
$db_username = 'root'; /* Database Server username */
$db_password = 'password'; /* Database Server password */
1
0
24 Mar '09
Author: silik0n
Date: Tue Mar 24 03:41:09 2009
New Revision: 12726
Log:
ok lets add a few more things in here for IVR stuff
Added:
freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php
freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php (contents, props changed)
freeswitch/trunk/scripts/contrib/swk/php/xml_curl/fs_curl.php
- copied, changed from r12725, /freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php
Added: freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/swk/php/xml_curl/FSConfig.php Tue Mar 24 03:41:09 2009
@@ -0,0 +1,74 @@
+<?php
+
+/*
+ * FreeSWITCH AMF-PHP ESL Client Library
+ * Copyright (C) 2009, Ken Rice <krice(a)tollfreegateway.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * Ken Rice <krice(a)tollfreegateway.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Ken Rice <krice(a)tollfreegateway.com>
+ *
+ * freeswitch.php -- Initial Class file for XML_CURL responses for Codename: SHIPMENT
+ *
+ ***************************************************************************************************
+ *
+ * This Requires the FreeSWITCH ESL Extension to be installed properly on your system.
+ *
+ */
+
+// require_once "ESL.php";
+
+class FSConfig {
+ // var $esl;
+
+ var $dbh;
+
+ public function __construct(){
+ $dbtype='mysql'; /* Set the Database type */
+ // $db_hostname = 'localhost'; /* Database Server hostname */
+ $db_hostname = '192.168.1.140'; /* Database Server hostname */
+ $db_port = '3306'; /* Database Server Port */
+ $db_username = 'root'; /* Database Server username */
+ $db_password = 'password'; /* Database Server password */
+ $db_database = 'shipment'; /* DataBase Name */
+ if ($dbtype == 'mysql') {
+ $pdo_flags = array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,);
+ }
+ $this->dbh = new PDO("$dbtype:host=$db_hostname;port=$db_port;dbname=$db_database", $db_username, $db_password, $pdo_flags);
+
+ }
+
+ /*** IVR Methods Methods ***/
+ public function getConfigMenus(){
+ $query = sprintf("select * from menus");
+ $stmt = $this->dbh->query($query);
+ $results = $stmt->fetchAll();
+ return $results;
+ }
+
+ public function getConfigMenuOptions($menu_uid) {
+ $query = sprintf("select * from menu_entries where menu_uid = %s", $menu_uid);
+ $stmt = $this->dbh->query($query);
+ $results = $stmt->fetchAll();
+ return $results;
+ }
+}
Added: freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php Tue Mar 24 03:41:09 2009
@@ -0,0 +1 @@
+link fs_curl.php
\ No newline at end of file
Copied: freeswitch/trunk/scripts/contrib/swk/php/xml_curl/fs_curl.php (from r12725, /freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php)
==============================================================================
--- /freeswitch/trunk/scripts/contrib/swk/php/xml_curl/directory.php (original)
+++ freeswitch/trunk/scripts/contrib/swk/php/xml_curl/fs_curl.php Tue Mar 24 03:41:09 2009
@@ -1,6 +1,7 @@
<?
require_once "FSDirectory.php";
+require_once "FSConfig.php";
header ("content-type: text/xml");
@@ -9,9 +10,8 @@
$$key = $value;
}
-$fsd = new FSDirectory();
-/* Uncomment and edit for debugging */
+/* Uncomment and edit for debugging directory*/
/*
$section = "directory";
$tag_name= "domain";
@@ -20,64 +20,111 @@
$user="1000";
*/
-if ($section == "directory" && $tag_name == "domain" && $key_name == "name" && $user != "" ) {
- $db_domain = $fsd->getDirDomainbyName($key_value);
-} else {
- printf("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"freeswitch/xml\">\n<section name=\"result\">\n".
- "<result status=\"not found\" />\n</section>\n</document>");
- die();
-}
-
-
+/* Uncomment and edit for debugging directory*/
+/*
+$section = "configuration";
+$tag_name= "configuration";
+$key_name ="name";
+$key_value="ivr.conf";
+*/
+/* section=configuration&tag_name=configuration&key_name=name&key_value=ivr.conf&Event-Name=REQUEST_PARAMS */
-$db_domain_settings = $fsd->getDirDomain($db_domain['uid']);
+if ($section == "configuration" && $tag_name == "configuration" && $key_name == "name" && $key_value == "ivr.conf" ) {
+
+ $fsc = new FSConfig();
+
+ printf(" <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
+ printf(" <document type=\"freeswitch/xml\">\n");
+ printf(" <section name=\"configuration\" description=\"Codename: Shipment IVR\">\n");
+ printf(" <configuration name=\"ivr.conf\" description=\"IVR menus\">\n");
+ printf(" <menus>\n");
+
+ $db_menus = $fsc->getConfigMenus();
+ foreach ($db_menus as $db_menu) {
+ printf(" <menu name=\"%s\"\n".
+ " greet-long=\"%s\"\n".
+ " greet-short=\"%s\"\n".
+ " invalid-sound=\"%s\"\n".
+ " exit-sound=\"%s\"\n".
+ " timeout=\"%s\"\n".
+ " inter-digit-timeout=\"%s\"\n".
+ " max-failures=\"%s\"\n".
+ " max-timeouts=\"%s\"\n".
+ " digit-len=\"%s\">\n",
+ $db_menu['name'], $db_menu['greet_long'], $db_menu['greet_short'], $db_menu['invalid_sound'],
+ $db_menu['exit_sound'], $db_menu['timeout'], $db_menu['inter_digit_timeout'], $db_menu['max_failures'],
+ $db_menu['max_timeouts'], $db_menu['digit_len']);
+
+ $db_menuopts = $fsc->getConfigMenuOptions($db_menu['uid']);
+
+ foreach ($db_menuopts as $db_menuopt) {
+ printf(" <entry action=\"%s\" digits=\"%s\" param=\"%s\"/>\n",
+ $db_menuopt['action'], $db_menuopt['digits'], $db_menuopt['param']);
+ }
+
+ printf(" </menu>\n");
+ }
+ printf(" </menus>\n");
+ printf(" </configuration>\n");
+ printf(" </section>\n");
+ printf(" </document>\n");
+} else if ($section == "directory" && $tag_name == "domain" && $key_name == "name" && $user != "" ) {
-$db_user = $fsd->getDirUsersByDomainUidByUsername($db_domain['uid'], $user);
-$db_user_settings = $fsd->getDirUser($db_user['uid']);
-$db_groups = $fsd->getDirGroupsByDomianUidByUserUid($db_domain['uid'], $db_user['uid']);
-
-printf(" <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
-printf(" <document type=\"freeswitch/xml\">\n");
-printf(" <section name=\"directory\" description=\"Codename: Shipment Directory\">\n");
-printf(" <domain name=\"%s\">\n", $db_domain['name']);
-printf(" <params>\n");
-foreach($db_domain_settings['params'] as $db_params) {
- printf(" <param name=\"%s\" value=\"%s\"/>\n", $db_params['name'], $db_params['value']);
-}
-printf(" </params>\n");
-printf(" <variables>\n");
-foreach($db_domain_settings['variables'] as $db_variables) {
- printf(" <variable name=\"%s\" value=\"%s\"/>\n", $db_variables['name'], $db_variables['value']);
-}
-printf(" </variables>\n");
-printf(" <groups>\n");
-printf(" <group name=\"default\">\n");
-printf(" <users>\n");
-printf(" <user id=\"%s\" mailbox=\"%s\">\n", $db_user['username'], $db_user['mailbox']);
-printf(" <params>\n");
-foreach($db_user_settings['params'] as $db_params) {
- printf(" <param name=\"%s\" value=\"%s\"/>\n", $db_params['name'], $db_params['value']);
-}
-printf(" </params>\n");
-printf(" <variables>\n");
-foreach($db_user_settings['variables'] as $db_variables) {
- printf(" <variable name=\"%s\" value=\"%s\"/>\n", $db_variables['name'], $db_variables['value']);
-}
-printf(" </variables>\n");
-printf(" </user>\n");
-printf(" </users>\n");
-printf(" </group>\n");
-foreach($db_groups as $db_group){
- printf(" <group name=\"%s\">\n", $db_group['groupName']);
+ $fsd = new FSDirectory();
+ $db_domain = $fsd->getDirDomainbyName($key_value);
+ $db_domain_settings = $fsd->getDirDomain($db_domain['uid']);
+ $db_user = $fsd->getDirUsersByDomainUidByUsername($db_domain['uid'], $user);
+ $db_user_settings = $fsd->getDirUser($db_user['uid']);
+ $db_groups = $fsd->getDirGroupsByDomianUidByUserUid($db_domain['uid'], $db_user['uid']);
+
+ printf(" <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
+ printf(" <document type=\"freeswitch/xml\">\n");
+ printf(" <section name=\"directory\" description=\"Codename: Shipment Directory\">\n");
+ printf(" <domain name=\"%s\">\n", $db_domain['name']);
+ printf(" <params>\n");
+ foreach($db_domain_settings['params'] as $db_params) {
+ printf(" <param name=\"%s\" value=\"%s\"/>\n", $db_params['name'], $db_params['value']);
+ }
+ printf(" </params>\n");
+ printf(" <variables>\n");
+ foreach($db_domain_settings['variables'] as $db_variables) {
+ printf(" <variable name=\"%s\" value=\"%s\"/>\n", $db_variables['name'], $db_variables['value']);
+ }
+ printf(" </variables>\n");
+ printf(" <groups>\n");
+ printf(" <group name=\"default\">\n");
printf(" <users>\n");
- printf(" <user id=\"%s\" type=\"pointer\"/>\n", $user);
+ printf(" <user id=\"%s\" mailbox=\"%s\">\n", $db_user['username'], $db_user['mailbox']);
+ printf(" <params>\n");
+ foreach($db_user_settings['params'] as $db_params) {
+ printf(" <param name=\"%s\" value=\"%s\"/>\n", $db_params['name'], $db_params['value']);
+ }
+ printf(" </params>\n");
+ printf(" <variables>\n");
+ foreach($db_user_settings['variables'] as $db_variables) {
+ printf(" <variable name=\"%s\" value=\"%s\"/>\n", $db_variables['name'], $db_variables['value']);
+ }
+ printf(" </variables>\n");
+ printf(" </user>\n");
printf(" </users>\n");
printf(" </group>\n");
+ foreach($db_groups as $db_group){
+ printf(" <group name=\"%s\">\n", $db_group['groupName']);
+ printf(" <users>\n");
+ printf(" <user id=\"%s\" type=\"pointer\"/>\n", $user);
+ printf(" </users>\n");
+ printf(" </group>\n");
+ }
+
+ printf(" </groups>\n");
+ printf(" </domain>\n");
+ printf(" </section>\n");
+ printf(" </document>\n");
+
+} else {
+ printf("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"freeswitch/xml\">\n<section name=\"result\">\n".
+ "<result status=\"not found\" />\n</section>\n</document>");
+ die();
}
-
-printf(" </groups>\n");
-printf(" </domain>\n");
-printf(" </section>\n");
-printf(" </document>\n");
?>
1
0
Author: mcollins
Date: Mon Mar 23 17:55:56 2009
New Revision: 12725
Log:
Cosmetics
Modified:
freeswitch/trunk/libs/esl/fs_cli.c
Modified: freeswitch/trunk/libs/esl/fs_cli.c
==============================================================================
--- freeswitch/trunk/libs/esl/fs_cli.c (original)
+++ freeswitch/trunk/libs/esl/fs_cli.c Mon Mar 23 17:55:56 2009
@@ -180,7 +180,7 @@
printf(" -p, --password=FILENAME Password\n");
printf(" -x, --execute=command Execute Command and Exit\n");
printf(" -l, --loglevel=command Log Level\n");
- printf(" -q, --quiet Disable logging\n");
+ printf(" -q, --quiet Disable logging\n");
printf(" -d, --debug=level Debug Level (0 - 7)\n\n");
return 1;
}
1
0
[commit] r12724 - in freeswitch/trunk/libs/esl: . lua perl php python ruby src src/include
by FreeSWITCH SVN 23 Mar '09
by FreeSWITCH SVN 23 Mar '09
23 Mar '09
Author: anthm
Date: Mon Mar 23 14:55:02 2009
New Revision: 12724
Log:
add disconnect method and check in ivrd
Added:
freeswitch/trunk/libs/esl/ivrd.c
freeswitch/trunk/libs/esl/test.pl (contents, props changed)
Modified:
freeswitch/trunk/libs/esl/Makefile
freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
freeswitch/trunk/libs/esl/perl/ESL.pm
freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
freeswitch/trunk/libs/esl/php/ESL.php
freeswitch/trunk/libs/esl/php/esl_wrap.cpp
freeswitch/trunk/libs/esl/php/php_ESL.h
freeswitch/trunk/libs/esl/python/ESL.py
freeswitch/trunk/libs/esl/python/esl_wrap.cpp
freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp
freeswitch/trunk/libs/esl/src/esl_oop.cpp
freeswitch/trunk/libs/esl/src/include/esl_oop.h
Modified: freeswitch/trunk/libs/esl/Makefile
==============================================================================
--- freeswitch/trunk/libs/esl/Makefile (original)
+++ freeswitch/trunk/libs/esl/Makefile Mon Mar 23 14:55:02 2009
@@ -16,7 +16,7 @@
# comment the next line to disable c++ (no swig mods for you then)
OBJS += src/esl_oop.o
-all: $(MYLIB) fs_cli testclient testserver
+all: $(MYLIB) fs_cli testclient testserver ivrd
$(MYLIB): $(OBJS) $(HEADERS) $(SRC)
ar rcs $(MYLIB) $(OBJS)
@@ -25,6 +25,9 @@
testserver: $(MYLIB) testserver.c
$(CC) $(CC_CFLAGS) $(CFLAGS) testserver.c -o testserver $(LDFLAGS) $(LIBS)
+ivrd: $(MYLIB) ivrd.c
+ $(CC) $(CC_CFLAGS) $(CFLAGS) ivrd.c -o ivrd $(LDFLAGS) $(LIBS)
+
testclient: $(MYLIB) testclient.c
$(CC) $(CC_CFLAGS) $(CFLAGS) testclient.c -o testclient $(LDFLAGS) $(LIBS)
@@ -38,7 +41,7 @@
$(CXX) $(CXX_CFLAGS) $(CXXFLAGS) -c $< -o $@
clean:
- rm -f *.o src/*.o testclient testserver fs_cli libesl.a *~ src/*~ src/include/*~
+ rm -f *.o src/*.o testclient testserver ivrd fs_cli libesl.a *~ src/*~ src/include/*~
$(MAKE) -C perl clean
$(MAKE) -C php clean
$(MAKE) -C lua clean
Added: freeswitch/trunk/libs/esl/ivrd.c
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/ivrd.c Mon Mar 23 14:55:02 2009
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2009, Anthony Minessale II
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of the original author; nor the names of any contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <esl.h>
+
+static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struct sockaddr_in *addr)
+{
+ esl_handle_t handle = {{0}};
+ char path_buffer[1024] = { 0 };
+ const char *path;
+
+ if (fork()) {
+ close(client_sock);
+ return;
+ }
+
+ esl_attach_handle(&handle, client_sock, addr);
+
+ if (!(path = esl_event_get_header(handle.info_event, "variable_ivr_path"))) {
+ esl_log(ESL_LOG_ERROR, "Missing ivr_path param!\n");
+ return;
+ }
+
+ strncpy(path_buffer, path, sizeof(path_buffer) - 1);
+
+ /* hotwire the socket to STDIN/STDOUT */
+ dup2(client_sock, STDIN_FILENO);
+ dup2(client_sock, STDOUT_FILENO);
+
+ /* close the handle but leak the socket on purpose cos the child will need it open */
+ handle.sock = -1;
+ esl_disconnect(&handle);
+
+ /* DOH! we're still here! Close the socket. */
+
+ execl(path_buffer, path_buffer, NULL);
+ esl_log(ESL_LOG_ERROR, "Error %d\n", client_sock);
+ close(client_sock);
+
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ char *ip = NULL;
+ int port = 0;
+
+ for (i = 1; i + 1 < argc; ) {
+ if (!strcasecmp(argv[i], "-h")) {
+ ip = argv[++i];
+ } else if (!strcasecmp(argv[i], "-p")) {
+ port = atoi(argv[++i]);
+ } else {
+ i++;
+ }
+ }
+
+ if (!(ip && port)) {
+ fprintf(stderr, "Usage %s -h <host> -p <port>\n", argv[0]);
+ return -1;
+ }
+
+ esl_listen(ip, port, mycallback);
+
+ return 0;
+}
Modified: freeswitch/trunk/libs/esl/lua/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/lua/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/lua/esl_wrap.cpp Mon Mar 23 14:55:02 2009
@@ -1927,14 +1927,14 @@
SWIG_check_num_args("getHeader",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("getHeader",1,"ESLevent *");
- if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("getHeader",2,"char const *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLevent,0))){
SWIG_fail_ptr("ESLevent_getHeader",1,SWIGTYPE_p_ESLevent);
}
arg2 = (char *)lua_tostring(L, 2);
- result = (char *)(arg1)->getHeader(arg2);
+ result = (char *)(arg1)->getHeader((char const *)arg2);
SWIG_arg=0;
lua_pushstring(L,(const char*)result); SWIG_arg++;
return SWIG_arg;
@@ -2688,6 +2688,31 @@
}
+static int _wrap_ESLconnection_disconnect(lua_State* L) {
+ int SWIG_arg = -1;
+ ESLconnection *arg1 = (ESLconnection *) 0 ;
+ int result;
+
+ SWIG_check_num_args("disconnect",1,1)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("disconnect",1,"ESLconnection *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_ESLconnection,0))){
+ SWIG_fail_ptr("ESLconnection_disconnect",1,SWIGTYPE_p_ESLconnection);
+ }
+
+ result = (int)(arg1)->disconnect();
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static void swig_delete_ESLconnection(void *obj) {
ESLconnection *arg1 = (ESLconnection *) obj;
delete arg1;
@@ -2707,6 +2732,7 @@
{"execute", _wrap_ESLconnection_execute},
{"setBlockingExecute", _wrap_ESLconnection_setBlockingExecute},
{"setEventLock", _wrap_ESLconnection_setEventLock},
+ {"disconnect", _wrap_ESLconnection_disconnect},
{0,0}
};
static swig_lua_attribute swig_ESLconnection_attributes[] = {
Modified: freeswitch/trunk/libs/esl/perl/ESL.pm
==============================================================================
--- freeswitch/trunk/libs/esl/perl/ESL.pm (original)
+++ freeswitch/trunk/libs/esl/perl/ESL.pm Mon Mar 23 14:55:02 2009
@@ -142,6 +142,7 @@
*execute = *ESLc::ESLconnection_execute;
*setBlockingExecute = *ESLc::ESLconnection_setBlockingExecute;
*setEventLock = *ESLc::ESLconnection_setEventLock;
+*disconnect = *ESLc::ESLconnection_disconnect;
sub DISOWN {
my $self = shift;
my $ptr = tied(%$self);
Modified: freeswitch/trunk/libs/esl/perl/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/perl/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/perl/esl_wrap.cpp Mon Mar 23 14:55:02 2009
@@ -2304,10 +2304,10 @@
arg1 = reinterpret_cast< ESLevent * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
- result = (char *)(arg1)->getHeader(arg2);
+ result = (char *)(arg1)->getHeader((char const *)arg2);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
@@ -3330,6 +3330,34 @@
}
+XS(_wrap_ESLconnection_disconnect) {
+ {
+ ESLconnection *arg1 = (ESLconnection *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: ESLconnection_disconnect(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_disconnect" "', argument " "1"" of type '" "ESLconnection *""'");
+ }
+ arg1 = reinterpret_cast< ESLconnection * >(argp1);
+ result = (int)(arg1)->disconnect();
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_eslSetLogLevel) {
{
int arg1 ;
@@ -3435,6 +3463,7 @@
{"ESLc::ESLconnection_execute", _wrap_ESLconnection_execute},
{"ESLc::ESLconnection_setBlockingExecute", _wrap_ESLconnection_setBlockingExecute},
{"ESLc::ESLconnection_setEventLock", _wrap_ESLconnection_setEventLock},
+{"ESLc::ESLconnection_disconnect", _wrap_ESLconnection_disconnect},
{"ESLc::eslSetLogLevel", _wrap_eslSetLogLevel},
{0,0}
};
Modified: freeswitch/trunk/libs/esl/php/ESL.php
==============================================================================
--- freeswitch/trunk/libs/esl/php/ESL.php (original)
+++ freeswitch/trunk/libs/esl/php/ESL.php Mon Mar 23 14:55:02 2009
@@ -194,6 +194,10 @@
function setEventLock($val) {
return ESLconnection_setEventLock($this->_cPtr,$val);
}
+
+ function disconnect() {
+ return ESLconnection_disconnect($this->_cPtr);
+ }
}
Modified: freeswitch/trunk/libs/esl/php/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/php/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/php/esl_wrap.cpp Mon Mar 23 14:55:02 2009
@@ -1465,7 +1465,7 @@
arg2 = (char *) Z_STRVAL_PP(args[1]);
/*@SWIG@*/;
- result = (char *)(arg1)->getHeader(arg2);
+ result = (char *)(arg1)->getHeader((char const *)arg2);
{
if(!result) {
ZVAL_NULL(return_value);
@@ -2313,6 +2313,32 @@
}
+ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect) {
+ ESLconnection *arg1 = (ESLconnection *) 0 ;
+ int result;
+ zval **args[1];
+
+ SWIG_ResetError();
+ if(ZEND_NUM_ARGS() != 1 || zend_get_parameters_array_ex(1, args) != SUCCESS) {
+ WRONG_PARAM_COUNT;
+ }
+
+ {
+ if(SWIG_ConvertPtr(*args[0], (void **) &arg1, SWIGTYPE_p_ESLconnection, 0) < 0) {
+ SWIG_PHP_Error(E_ERROR, "Type error in argument 1 of ESLconnection_disconnect. Expected SWIGTYPE_p_ESLconnection");
+ }
+ }
+ if(!arg1) SWIG_PHP_Error(E_ERROR, "this pointer is NULL");
+ result = (int)(arg1)->disconnect();
+ {
+ ZVAL_LONG(return_value,result);
+ }
+ return;
+fail:
+ zend_error(SWIG_ErrorCode(),SWIG_ErrorMsg());
+}
+
+
ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel) {
int arg1 ;
zval **args[1];
@@ -2391,6 +2417,7 @@
SWIG_ZEND_NAMED_FE(eslconnection_execute,_wrap_ESLconnection_execute,NULL)
SWIG_ZEND_NAMED_FE(eslconnection_setblockingexecute,_wrap_ESLconnection_setBlockingExecute,NULL)
SWIG_ZEND_NAMED_FE(eslconnection_seteventlock,_wrap_ESLconnection_setEventLock,NULL)
+ SWIG_ZEND_NAMED_FE(eslconnection_disconnect,_wrap_ESLconnection_disconnect,NULL)
SWIG_ZEND_NAMED_FE(eslsetloglevel,_wrap_eslSetLogLevel,NULL)
{NULL, NULL, NULL}
};
Modified: freeswitch/trunk/libs/esl/php/php_ESL.h
==============================================================================
--- freeswitch/trunk/libs/esl/php/php_ESL.h (original)
+++ freeswitch/trunk/libs/esl/php/php_ESL.h Mon Mar 23 14:55:02 2009
@@ -64,5 +64,6 @@
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_execute);
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setBlockingExecute);
ZEND_NAMED_FUNCTION(_wrap_ESLconnection_setEventLock);
+ZEND_NAMED_FUNCTION(_wrap_ESLconnection_disconnect);
ZEND_NAMED_FUNCTION(_wrap_eslSetLogLevel);
#endif /* PHP_ESL_H */
Modified: freeswitch/trunk/libs/esl/python/ESL.py
==============================================================================
--- freeswitch/trunk/libs/esl/python/ESL.py (original)
+++ freeswitch/trunk/libs/esl/python/ESL.py Mon Mar 23 14:55:02 2009
@@ -91,6 +91,7 @@
def execute(*args): return apply(_ESL.ESLconnection_execute, args)
def setBlockingExecute(*args): return apply(_ESL.ESLconnection_setBlockingExecute, args)
def setEventLock(*args): return apply(_ESL.ESLconnection_setEventLock, args)
+ def disconnect(*args): return apply(_ESL.ESLconnection_disconnect, args)
ESLconnection_swigregister = _ESL.ESLconnection_swigregister
ESLconnection_swigregister(ESLconnection)
Modified: freeswitch/trunk/libs/esl/python/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/python/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/python/esl_wrap.cpp Mon Mar 23 14:55:02 2009
@@ -3298,10 +3298,10 @@
arg1 = reinterpret_cast< ESLevent * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char *""'");
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ESLevent_getHeader" "', argument " "2"" of type '" "char const *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
- result = (char *)(arg1)->getHeader(arg2);
+ result = (char *)(arg1)->getHeader((char const *)arg2);
resultobj = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
@@ -4173,6 +4173,28 @@
}
+SWIGINTERN PyObject *_wrap_ESLconnection_disconnect(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ ESLconnection *arg1 = (ESLconnection *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:ESLconnection_disconnect",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ESLconnection_disconnect" "', argument " "1"" of type '" "ESLconnection *""'");
+ }
+ arg1 = reinterpret_cast< ESLconnection * >(argp1);
+ result = (int)(arg1)->disconnect();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
SWIGINTERN PyObject *ESLconnection_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *obj;
if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
@@ -4237,6 +4259,7 @@
{ (char *)"ESLconnection_execute", _wrap_ESLconnection_execute, METH_VARARGS, NULL},
{ (char *)"ESLconnection_setBlockingExecute", _wrap_ESLconnection_setBlockingExecute, METH_VARARGS, NULL},
{ (char *)"ESLconnection_setEventLock", _wrap_ESLconnection_setEventLock, METH_VARARGS, NULL},
+ { (char *)"ESLconnection_disconnect", _wrap_ESLconnection_disconnect, METH_VARARGS, NULL},
{ (char *)"ESLconnection_swigregister", ESLconnection_swigregister, METH_VARARGS, NULL},
{ (char *)"eslSetLogLevel", _wrap_eslSetLogLevel, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
Modified: freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp (original)
+++ freeswitch/trunk/libs/esl/ruby/esl_wrap.cpp Mon Mar 23 14:55:02 2009
@@ -2414,10 +2414,10 @@
arg1 = reinterpret_cast< ESLevent * >(argp1);
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","getHeader", 2, argv[0] ));
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","getHeader", 2, argv[0] ));
}
arg2 = reinterpret_cast< char * >(buf2);
- result = (char *)(arg1)->getHeader(arg2);
+ result = (char *)(arg1)->getHeader((char const *)arg2);
vresult = SWIG_FromCharPtr((const char *)result);
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return vresult;
@@ -3306,6 +3306,30 @@
SWIGINTERN VALUE
+_wrap_ESLconnection_disconnect(int argc, VALUE *argv, VALUE self) {
+ ESLconnection *arg1 = (ESLconnection *) 0 ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ VALUE vresult = Qnil;
+
+ if ((argc < 0) || (argc > 0)) {
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+ }
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_ESLconnection, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "ESLconnection *","disconnect", 1, self ));
+ }
+ arg1 = reinterpret_cast< ESLconnection * >(argp1);
+ result = (int)(arg1)->disconnect();
+ vresult = SWIG_From_int(static_cast< int >(result));
+ return vresult;
+fail:
+ return Qnil;
+}
+
+
+SWIGINTERN VALUE
_wrap_eslSetLogLevel(int argc, VALUE *argv, VALUE self) {
int arg1 ;
int val1 ;
@@ -3658,6 +3682,7 @@
rb_define_method(cESLconnection.klass, "execute", VALUEFUNC(_wrap_ESLconnection_execute), -1);
rb_define_method(cESLconnection.klass, "setBlockingExecute", VALUEFUNC(_wrap_ESLconnection_setBlockingExecute), -1);
rb_define_method(cESLconnection.klass, "setEventLock", VALUEFUNC(_wrap_ESLconnection_setEventLock), -1);
+ rb_define_method(cESLconnection.klass, "disconnect", VALUEFUNC(_wrap_ESLconnection_disconnect), -1);
cESLconnection.mark = 0;
cESLconnection.destroy = (void (*)(void *)) free_ESLconnection;
cESLconnection.trackObjects = 0;
Modified: freeswitch/trunk/libs/esl/src/esl_oop.cpp
==============================================================================
--- freeswitch/trunk/libs/esl/src/esl_oop.cpp (original)
+++ freeswitch/trunk/libs/esl/src/esl_oop.cpp Mon Mar 23 14:55:02 2009
@@ -33,6 +33,15 @@
}
+int ESLconnection::disconnect()
+{
+ if (handle.connected) {
+ return esl_disconnect(&handle);
+ }
+
+ return 0;
+}
+
int ESLconnection::connected()
{
return handle.connected;
Modified: freeswitch/trunk/libs/esl/src/include/esl_oop.h
==============================================================================
--- freeswitch/trunk/libs/esl/src/include/esl_oop.h (original)
+++ freeswitch/trunk/libs/esl/src/include/esl_oop.h Mon Mar 23 14:55:02 2009
@@ -90,6 +90,7 @@
int execute(const char *app, const char *arg = NULL, const char *uuid = NULL);
int setBlockingExecute(const char *val);
int setEventLock(const char *val);
+ int disconnect(void);
};
void eslSetLogLevel(int level);
Added: freeswitch/trunk/libs/esl/test.pl
==============================================================================
--- (empty file)
+++ freeswitch/trunk/libs/esl/test.pl Mon Mar 23 14:55:02 2009
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+require ESL;
+use Data::Dumper;
+
+my $fd = fileno(STDIN);
+my $con = new ESL::ESLconnection($fd);
+my $info = $con->getInfo();
+
+select STDERR;
+
+print $info->serialize();
+
+my $uuid = $info->getHeader("unique-id");
+
+$con->execute("answer", "", $uuid);
+$con->execute("playback", "/ram/swimp.raw", $uuid);
+
+
+$con->disconnect();
+
+
1
0
[commit] r12723 - freeswitch/trunk/src/mod/event_handlers/mod_event_socket
by FreeSWITCH SVN 23 Mar '09
by FreeSWITCH SVN 23 Mar '09
23 Mar '09
Author: anthm
Date: Mon Mar 23 14:53:57 2009
New Revision: 12723
Log:
move connect command to always work on outbound socket not just the first time
Modified:
freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c (original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c Mon Mar 23 14:53:57 2009
@@ -1439,8 +1439,26 @@
}
if (!strncasecmp(cmd, "connect", 7)) {
- switch_snprintf(reply, reply_len, "+OK");
- goto done;
+ switch_event_t *call_event;
+ char *event_str;
+ switch_size_t len;
+ switch_event_create(&call_event, SWITCH_EVENT_CHANNEL_DATA);
+
+ switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event);
+ switch_channel_event_set_data(channel, call_event);
+ switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply");
+ switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n");
+ switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static");
+ switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Control", switch_test_flag(listener, LFLAG_FULL) ? "full" : "single-channel");
+
+ switch_event_serialize(call_event, &event_str, SWITCH_TRUE);
+ switch_assert(event_str);
+ len = strlen(event_str);
+ switch_socket_send(listener->sock, event_str, &len);
+ switch_safe_free(event_str);
+
+ //switch_snprintf(reply, reply_len, "+OK");
+ goto done_noreply;
} else if (!strncasecmp(cmd, "getvar", 6)) {
char *arg;
const char *val = "";
@@ -1966,10 +1984,8 @@
add_listener(listener);
if (session && switch_test_flag(listener, LFLAG_AUTHED)) {
- switch_event_t *ievent = NULL, *call_event;
- char *event_str;
-
-
+ switch_event_t *ievent = NULL;
+
switch_set_flag_locked(listener, LFLAG_SESSION);
status = read_packet(listener, &ievent, 25);
@@ -1978,35 +1994,14 @@
switch_clear_flag_locked(listener, LFLAG_RUNNING);
goto done;
}
-
- if (switch_event_create(&call_event, SWITCH_EVENT_CHANNEL_DATA) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
- switch_clear_flag_locked(listener, LFLAG_RUNNING);
- goto done;
- }
+
if (parse_command(listener, &ievent, reply, sizeof(reply)) != SWITCH_STATUS_SUCCESS) {
switch_clear_flag_locked(listener, LFLAG_RUNNING);
goto done;
}
- switch_caller_profile_event_set_data(switch_channel_get_caller_profile(channel), "Channel", call_event);
- switch_channel_event_set_data(channel, call_event);
- switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Content-Type", "command/reply");
- switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Reply-Text", "+OK\n");
- switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Socket-Mode", switch_test_flag(listener, LFLAG_ASYNC) ? "async" : "static");
- switch_event_add_header_string(call_event, SWITCH_STACK_BOTTOM, "Control", switch_test_flag(listener, LFLAG_FULL) ? "full" : "single-channel");
-
- switch_event_serialize(call_event, &event_str, SWITCH_TRUE);
- if (!event_str) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
- switch_clear_flag_locked(listener, LFLAG_RUNNING);
- goto done;
- }
- len = strlen(event_str);
- switch_socket_send(listener->sock, event_str, &len);
- switch_safe_free(event_str);
} else {
switch_snprintf(buf, sizeof(buf), "Content-Type: auth/request\n\n");
1
0
[commit] r12722 - in freeswitch/trunk/src: . include mod/applications/mod_fifo
by FreeSWITCH SVN 23 Mar '09
by FreeSWITCH SVN 23 Mar '09
23 Mar '09
Author: anthm
Date: Mon Mar 23 11:06:32 2009
New Revision: 12722
Log:
add import vars to fifo
Modified:
freeswitch/trunk/src/include/switch_ivr.h
freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
freeswitch/trunk/src/switch_ivr_originate.c
Modified: freeswitch/trunk/src/include/switch_ivr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_ivr.h (original)
+++ freeswitch/trunk/src/include/switch_ivr.h Mon Mar 23 11:06:32 2009
@@ -550,10 +550,10 @@
/******************************************************************************************************/
- struct switch_ivr_digit_stream_parser;
- typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t;
- struct switch_ivr_digit_stream;
- typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t;
+struct switch_ivr_digit_stream_parser;
+typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t;
+struct switch_ivr_digit_stream;
+typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t;
/*!
\brief Create a digit stream parser object
\param pool the pool to use for the new hash
@@ -639,25 +639,25 @@
* @{
*/
- typedef enum {
- SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
- SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
- SWITCH_IVR_MENU_FLAG_STACK = (1 << 2)
- } switch_ivr_menu_flags;
+typedef enum {
+ SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
+ SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
+ SWITCH_IVR_MENU_FLAG_STACK = (1 << 2)
+} switch_ivr_menu_flags;
/* Actions are either set in switch_ivr_menu_bind_function or returned by a callback */
- typedef enum {
- SWITCH_IVR_ACTION_DIE, /* Exit the menu. */
- SWITCH_IVR_ACTION_EXECMENU, /* Goto another menu in the stack. */
- SWITCH_IVR_ACTION_EXECAPP, /* Execute an application. */
- SWITCH_IVR_ACTION_PLAYSOUND, /* Play a sound. */
- SWITCH_IVR_ACTION_BACK, /* Go back 1 menu. */
- SWITCH_IVR_ACTION_TOMAIN, /* Go back to the top level menu. */
- SWITCH_IVR_ACTION_NOOP /* No operation */
- } switch_ivr_action_t;
- struct switch_ivr_menu;
- typedef switch_ivr_action_t switch_ivr_menu_action_function_t (struct switch_ivr_menu *, char *, char *, size_t, void *);
- typedef struct switch_ivr_menu switch_ivr_menu_t;
- typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
+typedef enum {
+ SWITCH_IVR_ACTION_DIE, /* Exit the menu. */
+ SWITCH_IVR_ACTION_EXECMENU, /* Goto another menu in the stack. */
+ SWITCH_IVR_ACTION_EXECAPP, /* Execute an application. */
+ SWITCH_IVR_ACTION_PLAYSOUND, /* Play a sound. */
+ SWITCH_IVR_ACTION_BACK, /* Go back 1 menu. */
+ SWITCH_IVR_ACTION_TOMAIN, /* Go back to the top level menu. */
+ SWITCH_IVR_ACTION_NOOP /* No operation */
+} switch_ivr_action_t;
+struct switch_ivr_menu;
+typedef switch_ivr_action_t switch_ivr_menu_action_function_t (struct switch_ivr_menu *, char *, char *, size_t, void *);
+typedef struct switch_ivr_menu switch_ivr_menu_t;
+typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
/******************************************************************************************************/
/*!
@@ -682,20 +682,20 @@
*\return SWITCH_STATUS_SUCCESS if the menu was created.
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t **new_menu,
- switch_ivr_menu_t *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,
- const char *tts_engine,
- const char *tts_voice,
- int confirm_attempts,
- int inter_timeout, int digit_len, int timeout, int max_failures,
- int max_timeouts, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t **new_menu,
+ switch_ivr_menu_t *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,
+ const char *tts_engine,
+ const char *tts_voice,
+ int confirm_attempts,
+ int inter_timeout, int digit_len, int timeout, int max_failures,
+ int max_timeouts, switch_memory_pool_t *pool);
/*!
*\brief switch_ivr_menu_bind_action: Bind a keystroke to an action.
@@ -705,8 +705,8 @@
*\param bind KeyStrokes to bind the action to.
*\return SWUTCH_STATUS_SUCCESS if the action was binded
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t *menu, switch_ivr_action_t ivr_action, const char *arg,
- const char *bind);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t *menu, switch_ivr_action_t ivr_action, const char *arg,
+ const char *bind);
/*!
@@ -720,8 +720,8 @@
*\note The function returns an switch_ivr_action_t enum of what you want to do. and looks to your buffer for args.
*\return SWUTCH_STATUS_SUCCESS if the function was binded
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t *menu,
- switch_ivr_menu_action_function_t *function, const char *arg, const char *bind);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t *menu,
+ switch_ivr_menu_action_function_t *function, const char *arg, const char *bind);
/*!
@@ -732,17 +732,17 @@
*\param obj A void pointer to an object you want to make avaliable to your callback functions that you may have binded with switch_ivr_menu_bind_function.
*\return SWITCH_STATUS_SUCCESS if all is well
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t *stack, char *name, void *obj);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t *stack, char *name, void *obj);
/*!
*\brief free a stack of menu objects.
*\param stack The top level menu you wish to destroy.
*\return SWITCH_STATUS_SUCCESS if the object was a top level menu and it was freed
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t *stack);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t *stack);
- struct switch_ivr_menu_xml_ctx;
- typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
+struct switch_ivr_menu_xml_ctx;
+typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
/*!
*\brief Build a menu stack from an xml source
*\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init
@@ -751,10 +751,10 @@
*\param xml_menu The xml Menu source of the menu to be created
*\return SWITCH_STATUS_SUCCESS if all is well
*/
- 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_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);
+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
@@ -762,46 +762,47 @@
*\param function The menu function callback that will be executed when menu digits are bound to this name
*\return SWITCH_STATUS_SUCCESS if all is well
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
- const char *name, switch_ivr_menu_action_function_t *function);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_menu_xml_ctx_t *xml_menu_ctx,
+ const char *name, switch_ivr_menu_action_function_t *function);
/*!
*\param xml_menu_ctx A pointer of a XML menu parser context to be created
*\param pool memory pool (NULL to create one)
*\return SWITCH_STATUS_SUCCESS if all is well
*/
- SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t **xml_menu_ctx, switch_memory_pool_t *pool);
+SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t **xml_menu_ctx, switch_memory_pool_t *pool);
- SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, const char *macro_name, const char *data, const char *lang,
- switch_input_args_t *args);
- SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
- SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, char *b_uuid, switch_size_t blen);
- SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
- SWITCH_DECLARE(void) switch_ivr_park_session(switch_core_session_t *session);
- SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t *session, switch_core_session_t *peer_session);
-
- SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
- uint32_t min_digits,
- uint32_t max_digits,
- const char *prompt_audio_file,
- const char *var_name,
- char *digit_buffer,
- switch_size_t digit_buffer_length, uint32_t timeout, const char *valid_terminators);
-
- SWITCH_DECLARE(switch_status_t) switch_ivr_bind_dtmf_meta_session(switch_core_session_t *session, uint32_t key,
- switch_bind_flag_t bind_flags, const char *app);
- SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session, uint32_t key);
- SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *session, const char *unhold_key, const char *moh_a, const char *moh_b);
- SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session, const char *tosay, const char *module_name, const char *say_type,
- const char *say_method, switch_input_args_t *args);
-
- SWITCH_DECLARE(switch_say_method_t) switch_ivr_get_say_method_by_name(const char *name);
- SWITCH_DECLARE(switch_say_type_t) switch_ivr_get_say_type_by_name(const char *name);
- SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data);
- SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, const char *macro_name, const char *data, const char *lang,
+ switch_input_args_t *args);
+SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
+SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, char *b_uuid, switch_size_t blen);
+SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
+SWITCH_DECLARE(void) switch_ivr_park_session(switch_core_session_t *session);
+SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t *session, switch_core_session_t *peer_session);
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_read(switch_core_session_t *session,
+ uint32_t min_digits,
+ uint32_t max_digits,
+ const char *prompt_audio_file,
+ const char *var_name,
+ char *digit_buffer,
+ switch_size_t digit_buffer_length, uint32_t timeout, const char *valid_terminators);
+
+SWITCH_DECLARE(switch_status_t) switch_ivr_bind_dtmf_meta_session(switch_core_session_t *session, uint32_t key,
+ switch_bind_flag_t bind_flags, const char *app);
+SWITCH_DECLARE(switch_status_t) switch_ivr_unbind_dtmf_meta_session(switch_core_session_t *session, uint32_t key);
+SWITCH_DECLARE(switch_status_t) switch_ivr_soft_hold(switch_core_session_t *session, const char *unhold_key, const char *moh_a, const char *moh_b);
+SWITCH_DECLARE(switch_status_t) switch_ivr_say(switch_core_session_t *session, const char *tosay, const char *module_name, const char *say_type,
+ const char *say_method, switch_input_args_t *args);
+
+SWITCH_DECLARE(switch_say_method_t) switch_ivr_get_say_method_by_name(const char *name);
+SWITCH_DECLARE(switch_say_type_t) switch_ivr_get_say_type_by_name(const char *name);
+SWITCH_DECLARE(switch_status_t) switch_ivr_set_user(switch_core_session_t *session, const char *data);
+SWITCH_DECLARE(switch_status_t) switch_ivr_sound_test(switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname);
/** @} */
- SWITCH_END_EXTERN_C
+SWITCH_END_EXTERN_C
#endif
/* For Emacs:
* Local Variables:
Modified: freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_fifo/mod_fifo.c Mon Mar 23 11:06:32 2009
@@ -1253,6 +1253,8 @@
switch_core_media_bug_resume(session);
switch_core_media_bug_resume(other_session);
+ switch_process_import(session, other_channel, "fifo_caller_consumer_import");
+ switch_process_import(other_session, channel, "fifo_consumer_caller_import");
switch_ivr_multi_threaded_bridge(session, other_session, on_dtmf, other_session, session);
switch_core_media_bug_pause(session);
switch_core_media_bug_pause(other_session);
Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c (original)
+++ freeswitch/trunk/src/switch_ivr_originate.c Mon Mar 23 11:06:32 2009
@@ -841,7 +841,7 @@
return (!caller_channel || switch_channel_ready(caller_channel)) ? status : SWITCH_STATUS_FALSE;
}
-static void process_import(switch_core_session_t *session, switch_channel_t *peer_channel)
+SWITCH_DECLARE(void) switch_process_import(switch_core_session_t *session, switch_channel_t *peer_channel, const char *varname)
{
const char *import, *val;
switch_channel_t *caller_channel;
@@ -849,7 +849,7 @@
switch_assert(session && peer_channel);
caller_channel = switch_core_session_get_channel(session);
- if ((import = switch_channel_get_variable(caller_channel, "import"))) {
+ if ((import = switch_channel_get_variable(caller_channel, varname))) {
char *mydata = switch_core_session_strdup(session, import);
int i, argc;
char *argv[64] = { 0 };
@@ -1956,7 +1956,7 @@
} else {
status = SWITCH_STATUS_FALSE;
if (caller_channel && peer_channel) {
- process_import(oglobals.session, peer_channel);
+ switch_process_import(oglobals.session, peer_channel, "import");
}
peer_channel = NULL;
goto done;
@@ -2007,7 +2007,7 @@
if (caller_channel) {
switch_channel_set_variable(caller_channel, "originate_disposition", "call accepted");
if (peer_channel) {
- process_import(oglobals.session, peer_channel);
+ switch_process_import(oglobals.session, peer_channel, "import");
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Originate Resulted in Success: [%s]\n", switch_channel_get_name(peer_channel));
1
0
23 Mar '09
Author: rupa
Date: Mon Mar 23 10:34:46 2009
New Revision: 12721
Log:
don't leak
Modified:
freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c Mon Mar 23 10:34:46 2009
@@ -563,6 +563,8 @@
/* format the custom_sql */
safe_sql = format_custom_sql(profile->custom_sql, cb_struct, digits_copy);
if (!safe_sql) {
+ switch_event_safe_destroy(&cb_struct->event);
+ switch_core_hash_destroy(&cb_struct->dedup_hash);
return SWITCH_STATUS_GENERR;
}
SWITCH_STANDARD_STREAM(sql_stream);
@@ -577,6 +579,7 @@
lookup_status = lcr_execute_sql_callback((char *)sql_stream.data, route_add_callback, cb_struct);
switch_safe_free(sql_stream.data);
+ switch_event_safe_destroy(&cb_struct->event);
switch_core_hash_destroy(&cb_struct->dedup_hash);
if (lookup_status) {
1
0