Merge branch 'master' of ssh://git.freeswitch.org/freeswitch

This commit is contained in:
Marc Olivier Chouinard 2010-09-14 15:29:51 -04:00
commit 51df54ece3
17 changed files with 1778 additions and 94 deletions

View File

@ -267,7 +267,7 @@ src/include/switch_swigable_cpp.h: $(switch_srcdir)/src/include/switch_cpp.h
##
## Applications
##
bin_PROGRAMS = freeswitch fs_cli fs_ivrd
bin_PROGRAMS = freeswitch fs_cli fs_ivrd tone2wav
##
## fs_cli ()
@ -281,6 +281,14 @@ fs_cli_CFLAGS += -DHAVE_EDITLINE -I$(switch_srcdir)/libs/libedit/src
fs_cli_LDADD = libs/libedit/src/.libs/libedit.a
endif
##
## tone2wav ()
##
tone2wav_SOURCES = src/tone2wav.c
tone2wav_CFLAGS = $(AM_CFLAGS)
tone2wav_LDFLAGS = $(AM_LDFLAGS) -lm
tone2wav_LDADD = libfreeswitch.la
##
## fs_ivrd ()
##

View File

@ -263,7 +263,7 @@
<action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
<!--<action application="export" data="nolocal:sip_secure_media=${user_data(${dialed_extension}@${domain_name} var sip_secure_media)}"/>-->
<action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
<action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
<action application="bridge" data="{sip_invite_domain=$${domain}}user/${dialed_extension}@${domain_name}"/>
<action application="answer"/>
<action application="sleep" data="1000"/>
<action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>

View File

@ -267,7 +267,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone
ts->samples * 2);
}
}
return ts->samples;
return ts->samples / ts->channels;
}
TELETONE_API(int) teletone_run(teletone_generation_session_t *ts, const char *cmd)

View File

@ -302,7 +302,7 @@ TELETONE_API(int) teletone_mux_tones(teletone_generation_session_t *ts, teletone
ts->samples * 2);
}
}
return ts->samples;
return ts->samples / ts->channels;
}
/* don't ask */

View File

@ -92,7 +92,7 @@ SWITCH_BEGIN_EXTERN_C
\brief Initilize the module backend and load all the modules
\return SWITCH_STATUS_SUCCESS when complete
*/
SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(void);
SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autoload);
/*!
\brief Shutdown the module backend and call the shutdown routine in all loaded modules

View File

@ -255,7 +255,8 @@ typedef enum {
SCF_USE_CLOCK_RT = (1 << 10),
SCF_VERBOSE_EVENTS = (1 << 11),
SCF_USE_WIN32_MONOTONIC = (1 << 12),
SCF_AUTO_SCHEMAS = (1 << 13)
SCF_AUTO_SCHEMAS = (1 << 13),
SCF_MINIMAL = (1 << 14)
} switch_core_flag_enum_t;
typedef uint32_t switch_core_flag_t;

View File

@ -3172,7 +3172,7 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
switch_event_destroy(&vars);
if (status == SWITCH_STATUS_SUCCESS) {
if ((vm_cc = switch_channel_get_variable(channel, "vm_cc"))) {
char *cmd = switch_core_session_sprintf(session, "%s %s %s %s %s@%s %s",
char *cmd = switch_core_session_sprintf(session, "%s %s %s '%s' %s@%s %s",
vm_cc, file_path, caller_id_number, caller_id_name, id, domain_name, read_flags);
if (voicemail_inject(cmd, session) == SWITCH_STATUS_SUCCESS) {

View File

@ -3590,11 +3590,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
if (sofia_test_pflag(tech_pvt->profile, PFLAG_DISABLE_HOLD) ||
((val = switch_channel_get_variable(tech_pvt->channel, "sip_disable_hold")) && switch_true(val))) {
sendonly = 0;
}
} else {
if (!tech_pvt->hold_laps) {
tech_pvt->hold_laps++;
sofia_glue_toggle_hold(tech_pvt, sendonly);
if (!tech_pvt->hold_laps) {
tech_pvt->hold_laps++;
sofia_glue_toggle_hold(tech_pvt, sendonly);
}
}
for (m = sdp->sdp_media; m; m = m->m_next) {

View File

@ -1442,7 +1442,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
op = switch_event_get_header(helper->event, "Caller-Callee-ID-Number");
}
if (!op) {
if (zstr(op)) {
op = switch_event_get_header(helper->event, "Caller-Destination-Number");
}
@ -1452,7 +1452,7 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
if (!strcmp(astate, "early")) {
if (zstr(op)) {
switch_snprintf(status_line, sizeof(status_line), "%s %s", what, status);
switch_snprintf(status_line, sizeof(status_line), "%sing", what);
} else {
switch_snprintf(status_line, sizeof(status_line), "%s %s", what, op);
}
@ -2043,7 +2043,11 @@ void sofia_presence_handle_sip_i_subscribe(int status,
from_host = "n/a";
}
exp_delta = profile->force_subscription_expires ? profile->force_subscription_expires : (sip->sip_expires ? sip->sip_expires->ex_delta : 3600);
if ((exp_delta = sip->sip_expires ? sip->sip_expires->ex_delta : 3600)) {
if (profile->force_subscription_expires) {
exp_delta = profile->force_subscription_expires;
}
}
if (exp_delta) {
exp_abs = (long) switch_epoch_time_now(NULL) + exp_delta;

View File

@ -193,7 +193,10 @@ char * SWIG_csharp_string_callback(const char * str) {
%include switch_core_db.h
%include switch_regex.h
%include switch_core.h
//%include switch_loadable_module.h // todo: Sort out some linking issues
%ignore switch_module_runtime;
%ignore switch_module_load;
%ignore switch_module_shutdown;
%include switch_loadable_module.h // note: Above three ignore lines sort out some linking issues
%include switch_console.h // Has unsupported varargs functions
%include switch_utils.h
%include switch_caller.h

View File

@ -10097,6 +10097,838 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_session_in_thread(void * jarg1) {
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_set(void * jarg1, char * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (char *)jarg2;
{
if (arg2) {
arg1->module_name = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->module_name, (const char *)arg2);
} else {
arg1->module_name = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_loadable_module_interface_module_name_get(void * jarg1) {
char * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
char *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (char *) ((arg1)->module_name);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_endpoint_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_endpoint_interface_t *arg2 = (switch_endpoint_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_endpoint_interface_t *)jarg2;
if (arg1) (arg1)->endpoint_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_endpoint_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_endpoint_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_endpoint_interface_t *) ((arg1)->endpoint_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_timer_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_timer_interface_t *arg2 = (switch_timer_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_timer_interface_t *)jarg2;
if (arg1) (arg1)->timer_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_timer_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_timer_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_timer_interface_t *) ((arg1)->timer_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_dialplan_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_dialplan_interface_t *arg2 = (switch_dialplan_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_dialplan_interface_t *)jarg2;
if (arg1) (arg1)->dialplan_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_dialplan_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_dialplan_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_dialplan_interface_t *) ((arg1)->dialplan_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_codec_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_codec_interface_t *arg2 = (switch_codec_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_codec_interface_t *)jarg2;
if (arg1) (arg1)->codec_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_codec_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_codec_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_codec_interface_t *) ((arg1)->codec_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_application_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_application_interface_t *arg2 = (switch_application_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_application_interface_t *)jarg2;
if (arg1) (arg1)->application_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_application_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_application_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_application_interface_t *) ((arg1)->application_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_api_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_api_interface_t *arg2 = (switch_api_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_api_interface_t *)jarg2;
if (arg1) (arg1)->api_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_api_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_api_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_api_interface_t *) ((arg1)->api_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_file_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_file_interface_t *arg2 = (switch_file_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_file_interface_t *)jarg2;
if (arg1) (arg1)->file_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_file_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_file_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_file_interface_t *) ((arg1)->file_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_speech_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_speech_interface_t *arg2 = (switch_speech_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_speech_interface_t *)jarg2;
if (arg1) (arg1)->speech_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_speech_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_speech_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_speech_interface_t *) ((arg1)->speech_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_directory_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_directory_interface_t *arg2 = (switch_directory_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_directory_interface_t *)jarg2;
if (arg1) (arg1)->directory_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_directory_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_directory_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_directory_interface_t *) ((arg1)->directory_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_chat_interface_t *arg2 = (switch_chat_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_chat_interface_t *)jarg2;
if (arg1) (arg1)->chat_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_chat_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_chat_interface_t *) ((arg1)->chat_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_say_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_say_interface_t *arg2 = (switch_say_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_say_interface_t *)jarg2;
if (arg1) (arg1)->say_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_say_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_say_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_say_interface_t *) ((arg1)->say_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_asr_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_asr_interface_t *arg2 = (switch_asr_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_asr_interface_t *)jarg2;
if (arg1) (arg1)->asr_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_asr_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_asr_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_asr_interface_t *) ((arg1)->asr_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_management_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_management_interface_t *arg2 = (switch_management_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_management_interface_t *)jarg2;
if (arg1) (arg1)->management_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_management_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_management_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_management_interface_t *) ((arg1)->management_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_limit_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_limit_interface_t *arg2 = (switch_limit_interface_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_limit_interface_t *)jarg2;
if (arg1) (arg1)->limit_interface = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_limit_interface_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_limit_interface_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_limit_interface_t *) ((arg1)->limit_interface);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_rwlock_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_thread_rwlock_t *arg2 = (switch_thread_rwlock_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_thread_rwlock_t *)jarg2;
if (arg1) (arg1)->rwlock = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_rwlock_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_thread_rwlock_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_thread_rwlock_t *) ((arg1)->rwlock);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_refs_set(void * jarg1, int jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
int arg2 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (int)jarg2;
if (arg1) (arg1)->refs = arg2;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_interface_refs_get(void * jarg1) {
int jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
int result;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (int) ((arg1)->refs);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_pool_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_memory_pool_t *arg2 = (switch_memory_pool_t *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
arg2 = (switch_memory_pool_t *)jarg2;
if (arg1) (arg1)->pool = arg2;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_pool_get(void * jarg1) {
void * jresult ;
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_memory_pool_t *result = 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
result = (switch_memory_pool_t *) ((arg1)->pool);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_loadable_module_interface() {
void * jresult ;
switch_loadable_module_interface *result = 0 ;
result = (switch_loadable_module_interface *)new switch_loadable_module_interface();
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_loadable_module_interface(void * jarg1) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
arg1 = (switch_loadable_module_interface *)jarg1;
delete arg1;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_init() {
int jresult ;
switch_status_t result;
result = (switch_status_t)switch_loadable_module_init();
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_shutdown() {
switch_loadable_module_shutdown();
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_endpoint_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_endpoint_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_endpoint_interface_t *)switch_loadable_module_get_endpoint_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_codec_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_codec_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_codec_interface_t *)switch_loadable_module_get_codec_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_dialplan_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_dialplan_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_dialplan_interface_t *)switch_loadable_module_get_dialplan_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_enumerate_available(char * jarg1, void * jarg2, void * jarg3) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_modulename_callback_func_t arg2 = (switch_modulename_callback_func_t) 0 ;
void *arg3 = (void *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (switch_modulename_callback_func_t)jarg2;
arg3 = (void *)jarg3;
result = (switch_status_t)switch_loadable_module_enumerate_available((char const *)arg1,arg2,arg3);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_enumerate_loaded(void * jarg1, void * jarg2) {
int jresult ;
switch_modulename_callback_func_t arg1 = (switch_modulename_callback_func_t) 0 ;
void *arg2 = (void *) 0 ;
switch_status_t result;
arg1 = (switch_modulename_callback_func_t)jarg1;
arg2 = (void *)jarg2;
result = (switch_status_t)switch_loadable_module_enumerate_loaded(arg1,arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_build_dynamic(char * jarg1, void * jarg2, void * jarg3, void * jarg4, int jarg5) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_module_load_t arg2 = (switch_module_load_t) 0 ;
switch_module_runtime_t arg3 = (switch_module_runtime_t) 0 ;
switch_module_shutdown_t arg4 = (switch_module_shutdown_t) 0 ;
switch_bool_t arg5 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (switch_module_load_t)jarg2;
arg3 = (switch_module_runtime_t)jarg3;
arg4 = (switch_module_shutdown_t)jarg4;
arg5 = (switch_bool_t)jarg5;
result = (switch_status_t)switch_loadable_module_build_dynamic(arg1,arg2,arg3,arg4,arg5);
jresult = result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_timer_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_timer_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_timer_interface_t *)switch_loadable_module_get_timer_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_application_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_application_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_application_interface_t *)switch_loadable_module_get_application_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_api_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_api_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_api_interface_t *)switch_loadable_module_get_api_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_file_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_file_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_file_interface_t *)switch_loadable_module_get_file_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_speech_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_speech_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_speech_interface_t *)switch_loadable_module_get_speech_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_asr_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_asr_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_asr_interface_t *)switch_loadable_module_get_asr_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_directory_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_directory_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_directory_interface_t *)switch_loadable_module_get_directory_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_chat_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_chat_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_chat_interface_t *)switch_loadable_module_get_chat_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_say_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_say_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_say_interface_t *)switch_loadable_module_get_say_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_management_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_management_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_management_interface_t *)switch_loadable_module_get_management_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_limit_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
switch_limit_interface_t *result = 0 ;
arg1 = (char *)jarg1;
result = (switch_limit_interface_t *)switch_loadable_module_get_limit_interface((char const *)arg1);
jresult = (void *)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_get_codecs(void * jarg1, int jarg2) {
int jresult ;
switch_codec_implementation_t **arg1 = (switch_codec_implementation_t **) 0 ;
int arg2 ;
int result;
arg1 = (switch_codec_implementation_t **)jarg1;
arg2 = (int)jarg2;
result = (int)switch_loadable_module_get_codecs((switch_codec_implementation const **)arg1,arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_get_codecs_sorted(void * jarg1, int jarg2, void * jarg3, int jarg4) {
int jresult ;
switch_codec_implementation_t **arg1 = (switch_codec_implementation_t **) 0 ;
int arg2 ;
char **arg3 = (char **) 0 ;
int arg4 ;
int result;
arg1 = (switch_codec_implementation_t **)jarg1;
arg2 = (int)jarg2;
arg3 = (char **)jarg3;
arg4 = (int)jarg4;
result = (int)switch_loadable_module_get_codecs_sorted((switch_codec_implementation const **)arg1,arg2,arg3,arg4);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_api_execute(char * jarg1, char * jarg2, void * jarg3, void * jarg4) {
int jresult ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
switch_core_session_t *arg3 = (switch_core_session_t *) 0 ;
switch_stream_handle_t *arg4 = (switch_stream_handle_t *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (char *)jarg2;
arg3 = (switch_core_session_t *)jarg3;
arg4 = (switch_stream_handle_t *)jarg4;
result = (switch_status_t)switch_api_execute((char const *)arg1,(char const *)arg2,arg3,arg4);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_load_module(char * jarg1, char * jarg2, int jarg3, void * jarg4) {
int jresult ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
switch_bool_t arg3 ;
char **arg4 = (char **) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (char *)jarg2;
arg3 = (switch_bool_t)jarg3;
arg4 = (char **)jarg4;
result = (switch_status_t)switch_loadable_module_load_module(arg1,arg2,arg3,(char const **)arg4);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_exists(char * jarg1) {
int jresult ;
char *arg1 = (char *) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
result = (switch_status_t)switch_loadable_module_exists((char const *)arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_loadable_module_unload_module(char * jarg1, char * jarg2, int jarg3, void * jarg4) {
int jresult ;
char *arg1 = (char *) 0 ;
char *arg2 = (char *) 0 ;
switch_bool_t arg3 ;
char **arg4 = (char **) 0 ;
switch_status_t result;
arg1 = (char *)jarg1;
arg2 = (char *)jarg2;
arg3 = (switch_bool_t)jarg3;
arg4 = (char **)jarg4;
result = (switch_status_t)switch_loadable_module_unload_module(arg1,arg2,arg3,(char const **)arg4);
jresult = result;
return jresult;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_core_codec_next_id() {
unsigned long jresult ;
uint32_t result;
result = (uint32_t)switch_core_codec_next_id();
jresult = (unsigned long)result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_check_interval(unsigned long jarg1, unsigned long jarg2) {
int jresult ;
uint32_t arg1 ;
uint32_t arg2 ;
int result;
arg1 = (uint32_t)jarg1;
arg2 = (uint32_t)jarg2;
result = (int)switch_check_interval(arg1,arg2);
jresult = result;
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_codec_add_implementation(void * jarg1, void * jarg2, int jarg3, unsigned char jarg4, char * jarg5, char * jarg6, unsigned long jarg7, unsigned long jarg8, int jarg9, int jarg10, unsigned long jarg11, unsigned long jarg12, unsigned long jarg13, unsigned char jarg14, int jarg15, void * jarg16, void * jarg17, void * jarg18, void * jarg19) {
switch_memory_pool_t *arg1 = (switch_memory_pool_t *) 0 ;
switch_codec_interface_t *arg2 = (switch_codec_interface_t *) 0 ;
switch_codec_type_t arg3 ;
switch_payload_t arg4 ;
char *arg5 = (char *) 0 ;
char *arg6 = (char *) 0 ;
uint32_t arg7 ;
uint32_t arg8 ;
int arg9 ;
int arg10 ;
uint32_t arg11 ;
uint32_t arg12 ;
uint32_t arg13 ;
uint8_t arg14 ;
int arg15 ;
switch_core_codec_init_func_t arg16 = (switch_core_codec_init_func_t) 0 ;
switch_core_codec_encode_func_t arg17 = (switch_core_codec_encode_func_t) 0 ;
switch_core_codec_decode_func_t arg18 = (switch_core_codec_decode_func_t) 0 ;
switch_core_codec_destroy_func_t arg19 = (switch_core_codec_destroy_func_t) 0 ;
arg1 = (switch_memory_pool_t *)jarg1;
arg2 = (switch_codec_interface_t *)jarg2;
arg3 = (switch_codec_type_t)jarg3;
arg4 = (switch_payload_t)jarg4;
arg5 = (char *)jarg5;
arg6 = (char *)jarg6;
arg7 = (uint32_t)jarg7;
arg8 = (uint32_t)jarg8;
arg9 = (int)jarg9;
arg10 = (int)jarg10;
arg11 = (uint32_t)jarg11;
arg12 = (uint32_t)jarg12;
arg13 = (uint32_t)jarg13;
arg14 = (uint8_t)jarg14;
arg15 = (int)jarg15;
arg16 = (switch_core_codec_init_func_t)jarg16;
arg17 = (switch_core_codec_encode_func_t)jarg17;
arg18 = (switch_core_codec_decode_func_t)jarg18;
arg19 = (switch_core_codec_destroy_func_t)jarg19;
switch_core_codec_add_implementation(arg1,arg2,arg3,arg4,(char const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19);
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_codec_ready(void * jarg1) {
int jresult ;
switch_codec_t *arg1 = (switch_codec_t *) 0 ;
switch_bool_t result;
arg1 = (switch_codec_t *)jarg1;
result = (switch_bool_t)switch_core_codec_ready(arg1);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_CMD_CHUNK_LEN_get() {
int jresult ;
int result;

View File

@ -2078,14 +2078,14 @@ public class freeswitch {
return ret;
}
public static SWIGTYPE_p_switch_loadable_module_interface switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t pool, string name) {
public static switch_loadable_module_interface switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t pool, string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_module_interface(SWIGTYPE_p_apr_pool_t.getCPtr(pool), name);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
public static SWIGTYPE_p_void switch_loadable_module_create_interface(SWIGTYPE_p_switch_loadable_module_interface mod, switch_module_interface_name_t iname) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_interface(SWIGTYPE_p_switch_loadable_module_interface.getCPtr(mod), (int)iname);
public static SWIGTYPE_p_void switch_loadable_module_create_interface(switch_loadable_module_interface mod, switch_module_interface_name_t iname) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_create_interface(switch_loadable_module_interface.getCPtr(mod), (int)iname);
SWIGTYPE_p_void ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_void(cPtr, false);
return ret;
}
@ -2309,6 +2309,163 @@ public class freeswitch {
return ret;
}
public static switch_status_t switch_loadable_module_init() {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_init();
return ret;
}
public static void switch_loadable_module_shutdown() {
freeswitchPINVOKE.switch_loadable_module_shutdown();
}
public static switch_endpoint_interface switch_loadable_module_get_endpoint_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_endpoint_interface(name);
switch_endpoint_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_endpoint_interface(cPtr, false);
return ret;
}
public static switch_codec_interface switch_loadable_module_get_codec_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_codec_interface(name);
switch_codec_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_interface(cPtr, false);
return ret;
}
public static switch_dialplan_interface switch_loadable_module_get_dialplan_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_dialplan_interface(name);
switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false);
return ret;
}
public static switch_status_t switch_loadable_module_enumerate_available(string dir_path, SWIGTYPE_p_f_p_void_p_q_const__char__int callback, SWIGTYPE_p_void user_data) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_enumerate_available(dir_path, SWIGTYPE_p_f_p_void_p_q_const__char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data));
return ret;
}
public static switch_status_t switch_loadable_module_enumerate_loaded(SWIGTYPE_p_f_p_void_p_q_const__char__int callback, SWIGTYPE_p_void user_data) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_enumerate_loaded(SWIGTYPE_p_f_p_void_p_q_const__char__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(user_data));
return ret;
}
public static switch_status_t switch_loadable_module_build_dynamic(string filename, SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t switch_module_load, SWIGTYPE_p_f_void__switch_status_t switch_module_runtime, SWIGTYPE_p_f_void__switch_status_t switch_module_shutdown, switch_bool_t runtime) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_build_dynamic(filename, SWIGTYPE_p_f_p_p_switch_loadable_module_interface_p_apr_pool_t__switch_status_t.getCPtr(switch_module_load), SWIGTYPE_p_f_void__switch_status_t.getCPtr(switch_module_runtime), SWIGTYPE_p_f_void__switch_status_t.getCPtr(switch_module_shutdown), (int)runtime);
return ret;
}
public static switch_timer_interface switch_loadable_module_get_timer_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_timer_interface(name);
switch_timer_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_timer_interface(cPtr, false);
return ret;
}
public static switch_application_interface switch_loadable_module_get_application_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_application_interface(name);
switch_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_application_interface(cPtr, false);
return ret;
}
public static switch_api_interface switch_loadable_module_get_api_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_api_interface(name);
switch_api_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_api_interface(cPtr, false);
return ret;
}
public static switch_file_interface switch_loadable_module_get_file_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_file_interface(name);
switch_file_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_file_interface(cPtr, false);
return ret;
}
public static switch_speech_interface switch_loadable_module_get_speech_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_speech_interface(name);
switch_speech_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_speech_interface(cPtr, false);
return ret;
}
public static switch_asr_interface switch_loadable_module_get_asr_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_asr_interface(name);
switch_asr_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_asr_interface(cPtr, false);
return ret;
}
public static switch_directory_interface switch_loadable_module_get_directory_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_directory_interface(name);
switch_directory_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_directory_interface(cPtr, false);
return ret;
}
public static switch_chat_interface switch_loadable_module_get_chat_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_chat_interface(name);
switch_chat_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_interface(cPtr, false);
return ret;
}
public static switch_say_interface switch_loadable_module_get_say_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_say_interface(name);
switch_say_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_say_interface(cPtr, false);
return ret;
}
public static switch_management_interface switch_loadable_module_get_management_interface(string relative_oid) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_management_interface(relative_oid);
switch_management_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_management_interface(cPtr, false);
return ret;
}
public static switch_limit_interface switch_loadable_module_get_limit_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_limit_interface(name);
switch_limit_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_limit_interface(cPtr, false);
return ret;
}
public static int switch_loadable_module_get_codecs(SWIGTYPE_p_p_switch_codec_implementation array, int arraylen) {
int ret = freeswitchPINVOKE.switch_loadable_module_get_codecs(SWIGTYPE_p_p_switch_codec_implementation.getCPtr(array), arraylen);
return ret;
}
public static int switch_loadable_module_get_codecs_sorted(SWIGTYPE_p_p_switch_codec_implementation array, int arraylen, ref string prefs, int preflen) {
int ret = freeswitchPINVOKE.switch_loadable_module_get_codecs_sorted(SWIGTYPE_p_p_switch_codec_implementation.getCPtr(array), arraylen, ref prefs, preflen);
return ret;
}
public static switch_status_t switch_api_execute(string cmd, string arg, SWIGTYPE_p_switch_core_session session, switch_stream_handle stream) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_api_execute(cmd, arg, SWIGTYPE_p_switch_core_session.getCPtr(session), switch_stream_handle.getCPtr(stream));
return ret;
}
public static switch_status_t switch_loadable_module_load_module(string dir, string fname, switch_bool_t runtime, ref string err) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_load_module(dir, fname, (int)runtime, ref err);
return ret;
}
public static switch_status_t switch_loadable_module_exists(string mod) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_exists(mod);
return ret;
}
public static switch_status_t switch_loadable_module_unload_module(string dir, string fname, switch_bool_t force, ref string err) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_loadable_module_unload_module(dir, fname, (int)force, ref err);
return ret;
}
public static uint switch_core_codec_next_id() {
uint ret = freeswitchPINVOKE.switch_core_codec_next_id();
return ret;
}
public static int switch_check_interval(uint rate, uint ptime) {
int ret = freeswitchPINVOKE.switch_check_interval(rate, ptime);
return ret;
}
public static void switch_core_codec_add_implementation(SWIGTYPE_p_apr_pool_t pool, switch_codec_interface codec_interface, switch_codec_type_t codec_type, byte ianacode, string iananame, string fmtp, uint samples_per_second, uint actual_samples_per_second, int bits_per_second, int microseconds_per_packet, uint samples_per_packet, uint decoded_bytes_per_packet, uint encoded_bytes_per_packet, byte number_of_channels, int codec_frames_per_packet, SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t init, SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t encode, SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t decode, SWIGTYPE_p_f_p_switch_codec__switch_status_t destroy) {
freeswitchPINVOKE.switch_core_codec_add_implementation(SWIGTYPE_p_apr_pool_t.getCPtr(pool), switch_codec_interface.getCPtr(codec_interface), (int)codec_type, ianacode, iananame, fmtp, samples_per_second, actual_samples_per_second, bits_per_second, microseconds_per_packet, samples_per_packet, decoded_bytes_per_packet, encoded_bytes_per_packet, number_of_channels, codec_frames_per_packet, SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t.getCPtr(init), SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t.getCPtr(encode), SWIGTYPE_p_f_p_switch_codec_p_switch_codec_p_void_unsigned_long_unsigned_long_p_void_p_unsigned_long_p_unsigned_long_p_unsigned_int__switch_status_t.getCPtr(decode), SWIGTYPE_p_f_p_switch_codec__switch_status_t.getCPtr(destroy));
}
public static switch_bool_t switch_core_codec_ready(switch_codec codec) {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_codec_ready(switch_codec.getCPtr(codec));
return ret;
}
public static void switch_console_loop() {
freeswitchPINVOKE.switch_console_loop();
}
@ -7710,6 +7867,207 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_session_in_thread")]
public static extern int switch_core_session_in_thread(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_set")]
public static extern void switch_loadable_module_interface_module_name_set(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_module_name_get")]
public static extern string switch_loadable_module_interface_module_name_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_endpoint_interface_set")]
public static extern void switch_loadable_module_interface_endpoint_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_endpoint_interface_get")]
public static extern IntPtr switch_loadable_module_interface_endpoint_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_timer_interface_set")]
public static extern void switch_loadable_module_interface_timer_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_timer_interface_get")]
public static extern IntPtr switch_loadable_module_interface_timer_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_dialplan_interface_set")]
public static extern void switch_loadable_module_interface_dialplan_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_dialplan_interface_get")]
public static extern IntPtr switch_loadable_module_interface_dialplan_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_codec_interface_set")]
public static extern void switch_loadable_module_interface_codec_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_codec_interface_get")]
public static extern IntPtr switch_loadable_module_interface_codec_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_application_interface_set")]
public static extern void switch_loadable_module_interface_application_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_application_interface_get")]
public static extern IntPtr switch_loadable_module_interface_application_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_api_interface_set")]
public static extern void switch_loadable_module_interface_api_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_api_interface_get")]
public static extern IntPtr switch_loadable_module_interface_api_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_file_interface_set")]
public static extern void switch_loadable_module_interface_file_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_file_interface_get")]
public static extern IntPtr switch_loadable_module_interface_file_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_speech_interface_set")]
public static extern void switch_loadable_module_interface_speech_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_speech_interface_get")]
public static extern IntPtr switch_loadable_module_interface_speech_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_directory_interface_set")]
public static extern void switch_loadable_module_interface_directory_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_directory_interface_get")]
public static extern IntPtr switch_loadable_module_interface_directory_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_interface_set")]
public static extern void switch_loadable_module_interface_chat_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_interface_get")]
public static extern IntPtr switch_loadable_module_interface_chat_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_say_interface_set")]
public static extern void switch_loadable_module_interface_say_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_say_interface_get")]
public static extern IntPtr switch_loadable_module_interface_say_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_asr_interface_set")]
public static extern void switch_loadable_module_interface_asr_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_asr_interface_get")]
public static extern IntPtr switch_loadable_module_interface_asr_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_management_interface_set")]
public static extern void switch_loadable_module_interface_management_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_management_interface_get")]
public static extern IntPtr switch_loadable_module_interface_management_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_limit_interface_set")]
public static extern void switch_loadable_module_interface_limit_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_limit_interface_get")]
public static extern IntPtr switch_loadable_module_interface_limit_interface_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_rwlock_set")]
public static extern void switch_loadable_module_interface_rwlock_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_rwlock_get")]
public static extern IntPtr switch_loadable_module_interface_rwlock_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_refs_set")]
public static extern void switch_loadable_module_interface_refs_set(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_refs_get")]
public static extern int switch_loadable_module_interface_refs_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_pool_set")]
public static extern void switch_loadable_module_interface_pool_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_pool_get")]
public static extern IntPtr switch_loadable_module_interface_pool_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_loadable_module_interface")]
public static extern IntPtr new_switch_loadable_module_interface();
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_loadable_module_interface")]
public static extern void delete_switch_loadable_module_interface(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_init")]
public static extern int switch_loadable_module_init();
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_shutdown")]
public static extern void switch_loadable_module_shutdown();
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_endpoint_interface")]
public static extern IntPtr switch_loadable_module_get_endpoint_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codec_interface")]
public static extern IntPtr switch_loadable_module_get_codec_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_dialplan_interface")]
public static extern IntPtr switch_loadable_module_get_dialplan_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_enumerate_available")]
public static extern int switch_loadable_module_enumerate_available(string jarg1, HandleRef jarg2, HandleRef jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_enumerate_loaded")]
public static extern int switch_loadable_module_enumerate_loaded(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_build_dynamic")]
public static extern int switch_loadable_module_build_dynamic(string jarg1, HandleRef jarg2, HandleRef jarg3, HandleRef jarg4, int jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_timer_interface")]
public static extern IntPtr switch_loadable_module_get_timer_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_application_interface")]
public static extern IntPtr switch_loadable_module_get_application_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_api_interface")]
public static extern IntPtr switch_loadable_module_get_api_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_file_interface")]
public static extern IntPtr switch_loadable_module_get_file_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_speech_interface")]
public static extern IntPtr switch_loadable_module_get_speech_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_asr_interface")]
public static extern IntPtr switch_loadable_module_get_asr_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_directory_interface")]
public static extern IntPtr switch_loadable_module_get_directory_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_chat_interface")]
public static extern IntPtr switch_loadable_module_get_chat_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_say_interface")]
public static extern IntPtr switch_loadable_module_get_say_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_management_interface")]
public static extern IntPtr switch_loadable_module_get_management_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_limit_interface")]
public static extern IntPtr switch_loadable_module_get_limit_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codecs")]
public static extern int switch_loadable_module_get_codecs(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_codecs_sorted")]
public static extern int switch_loadable_module_get_codecs_sorted(HandleRef jarg1, int jarg2, ref string jarg3, int jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_api_execute")]
public static extern int switch_api_execute(string jarg1, string jarg2, HandleRef jarg3, HandleRef jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_load_module")]
public static extern int switch_loadable_module_load_module(string jarg1, string jarg2, int jarg3, ref string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_exists")]
public static extern int switch_loadable_module_exists(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_unload_module")]
public static extern int switch_loadable_module_unload_module(string jarg1, string jarg2, int jarg3, ref string jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_next_id")]
public static extern uint switch_core_codec_next_id();
[DllImport("mod_managed", EntryPoint="CSharp_switch_check_interval")]
public static extern int switch_check_interval(uint jarg1, uint jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_add_implementation")]
public static extern void switch_core_codec_add_implementation(HandleRef jarg1, HandleRef jarg2, int jarg3, byte jarg4, string jarg5, string jarg6, uint jarg7, uint jarg8, int jarg9, int jarg10, uint jarg11, uint jarg12, uint jarg13, byte jarg14, int jarg15, HandleRef jarg16, HandleRef jarg17, HandleRef jarg18, HandleRef jarg19);
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_codec_ready")]
public static extern int switch_core_codec_ready(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_CMD_CHUNK_LEN_get")]
public static extern int SWITCH_CMD_CHUNK_LEN_get();
@ -15527,6 +15885,36 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_void_p_q_const__char__int {
private HandleRef swigCPtr;
internal SWIGTYPE_p_f_p_void_p_q_const__char__int(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
protected SWIGTYPE_p_f_p_void_p_q_const__char__int() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
internal static HandleRef getCPtr(SWIGTYPE_p_f_p_void_p_q_const__char__int obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_f_p_void__void {
private HandleRef swigCPtr;
@ -16007,6 +16395,36 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_p_switch_codec_implementation {
private HandleRef swigCPtr;
internal SWIGTYPE_p_p_switch_codec_implementation(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
protected SWIGTYPE_p_p_switch_codec_implementation() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_codec_implementation obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_p_switch_console_callback_match {
private HandleRef swigCPtr;
@ -17207,36 +17625,6 @@ namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_switch_loadable_module_interface {
private HandleRef swigCPtr;
internal SWIGTYPE_p_switch_loadable_module_interface(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
protected SWIGTYPE_p_switch_loadable_module_interface() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
internal static HandleRef getCPtr(SWIGTYPE_p_switch_loadable_module_interface obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class SWIGTYPE_p_switch_media_bug {
private HandleRef swigCPtr;
@ -18021,13 +18409,13 @@ public class switch_api_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_api_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_api_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_api_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -18203,13 +18591,13 @@ public class switch_application_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_application_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_application_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_application_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -18701,13 +19089,13 @@ public class switch_asr_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_asr_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_asr_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_asr_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -20691,13 +21079,13 @@ public class switch_chat_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_chat_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_chat_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_chat_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -21268,13 +21656,13 @@ public class switch_codec_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_codec_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_codec_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_codec_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -22477,13 +22865,13 @@ public class switch_dialplan_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_dialplan_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_dialplan_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_dialplan_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -22931,13 +23319,13 @@ public class switch_directory_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_directory_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_directory_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_directory_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -23180,13 +23568,13 @@ public class switch_endpoint_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_endpoint_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_endpoint_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_endpoint_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -24253,13 +24641,13 @@ public class switch_file_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_file_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_file_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_file_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -26101,13 +26489,13 @@ public class switch_limit_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_limit_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_limit_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_limit_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -26241,6 +26629,251 @@ public class switch_loadable_module_function_table_t : IDisposable {
namespace FreeSWITCH.Native {
using System;
using System.Runtime.InteropServices;
public class switch_loadable_module_interface : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
internal switch_loadable_module_interface(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
internal static HandleRef getCPtr(switch_loadable_module_interface obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
~switch_loadable_module_interface() {
Dispose();
}
public virtual void Dispose() {
lock(this) {
if (swigCPtr.Handle != IntPtr.Zero) {
if (swigCMemOwn) {
swigCMemOwn = false;
freeswitchPINVOKE.delete_switch_loadable_module_interface(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
GC.SuppressFinalize(this);
}
}
public string module_name {
set {
freeswitchPINVOKE.switch_loadable_module_interface_module_name_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_loadable_module_interface_module_name_get(swigCPtr);
return ret;
}
}
public switch_endpoint_interface endpoint_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_endpoint_interface_set(swigCPtr, switch_endpoint_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_endpoint_interface_get(swigCPtr);
switch_endpoint_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_endpoint_interface(cPtr, false);
return ret;
}
}
public switch_timer_interface timer_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_timer_interface_set(swigCPtr, switch_timer_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_timer_interface_get(swigCPtr);
switch_timer_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_timer_interface(cPtr, false);
return ret;
}
}
public switch_dialplan_interface dialplan_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_dialplan_interface_set(swigCPtr, switch_dialplan_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_dialplan_interface_get(swigCPtr);
switch_dialplan_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_dialplan_interface(cPtr, false);
return ret;
}
}
public switch_codec_interface codec_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_codec_interface_set(swigCPtr, switch_codec_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_codec_interface_get(swigCPtr);
switch_codec_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_codec_interface(cPtr, false);
return ret;
}
}
public switch_application_interface application_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_application_interface_set(swigCPtr, switch_application_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_application_interface_get(swigCPtr);
switch_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_application_interface(cPtr, false);
return ret;
}
}
public switch_api_interface api_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_api_interface_set(swigCPtr, switch_api_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_api_interface_get(swigCPtr);
switch_api_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_api_interface(cPtr, false);
return ret;
}
}
public switch_file_interface file_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_file_interface_set(swigCPtr, switch_file_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_file_interface_get(swigCPtr);
switch_file_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_file_interface(cPtr, false);
return ret;
}
}
public switch_speech_interface speech_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_speech_interface_set(swigCPtr, switch_speech_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_speech_interface_get(swigCPtr);
switch_speech_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_speech_interface(cPtr, false);
return ret;
}
}
public switch_directory_interface directory_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_directory_interface_set(swigCPtr, switch_directory_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_directory_interface_get(swigCPtr);
switch_directory_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_directory_interface(cPtr, false);
return ret;
}
}
public switch_chat_interface chat_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_chat_interface_set(swigCPtr, switch_chat_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_chat_interface_get(swigCPtr);
switch_chat_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_interface(cPtr, false);
return ret;
}
}
public switch_say_interface say_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_say_interface_set(swigCPtr, switch_say_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_say_interface_get(swigCPtr);
switch_say_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_say_interface(cPtr, false);
return ret;
}
}
public switch_asr_interface asr_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_asr_interface_set(swigCPtr, switch_asr_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_asr_interface_get(swigCPtr);
switch_asr_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_asr_interface(cPtr, false);
return ret;
}
}
public switch_management_interface management_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_management_interface_set(swigCPtr, switch_management_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_management_interface_get(swigCPtr);
switch_management_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_management_interface(cPtr, false);
return ret;
}
}
public switch_limit_interface limit_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_limit_interface_set(swigCPtr, switch_limit_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_limit_interface_get(swigCPtr);
switch_limit_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_limit_interface(cPtr, false);
return ret;
}
}
public SWIGTYPE_p_switch_thread_rwlock_t rwlock {
set {
freeswitchPINVOKE.switch_loadable_module_interface_rwlock_set(swigCPtr, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_rwlock_get(swigCPtr);
SWIGTYPE_p_switch_thread_rwlock_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_thread_rwlock_t(cPtr, false);
return ret;
}
}
public int refs {
set {
freeswitchPINVOKE.switch_loadable_module_interface_refs_set(swigCPtr, value);
}
get {
int ret = freeswitchPINVOKE.switch_loadable_module_interface_refs_get(swigCPtr);
return ret;
}
}
public SWIGTYPE_p_apr_pool_t pool {
set {
freeswitchPINVOKE.switch_loadable_module_interface_pool_set(swigCPtr, SWIGTYPE_p_apr_pool_t.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_pool_get(swigCPtr);
SWIGTYPE_p_apr_pool_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_apr_pool_t(cPtr, false);
return ret;
}
}
public switch_loadable_module_interface() : this(freeswitchPINVOKE.new_switch_loadable_module_interface(), true) {
}
}
}
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.0
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
namespace FreeSWITCH.Native {
public enum switch_log_level_t {
SWITCH_LOG_DEBUG10 = 110,
SWITCH_LOG_DEBUG9 = 109,
@ -26518,13 +27151,13 @@ public class switch_management_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_management_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_management_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_management_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -27586,13 +28219,13 @@ public class switch_say_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_say_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_say_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_say_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -28273,13 +28906,13 @@ public class switch_speech_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_speech_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_speech_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_speech_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}
@ -29286,13 +29919,13 @@ public class switch_timer_interface : IDisposable {
}
}
public SWIGTYPE_p_switch_loadable_module_interface parent {
public switch_loadable_module_interface parent {
set {
freeswitchPINVOKE.switch_timer_interface_parent_set(swigCPtr, SWIGTYPE_p_switch_loadable_module_interface.getCPtr(value));
freeswitchPINVOKE.switch_timer_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
}
get {
IntPtr cPtr = freeswitchPINVOKE.switch_timer_interface_parent_get(swigCPtr);
SWIGTYPE_p_switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_loadable_module_interface(cPtr, false);
switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
return ret;
}
}

View File

@ -1315,6 +1315,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
switch_log_init(runtime.memory_pool, runtime.colorize_console);
if (flags & SCF_MINIMAL) return SWITCH_STATUS_SUCCESS;
runtime.tipping_point = 5000;
runtime.timer_affinity = -1;
@ -1594,7 +1596,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_init_and_modload(switch_core_flag_t
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Bringing up environment.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Loading Modules.\n");
if (switch_loadable_module_init() != SWITCH_STATUS_SUCCESS) {
if (switch_loadable_module_init(SWITCH_TRUE) != SWITCH_STATUS_SUCCESS) {
*err = "Cannot load modules";
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Error: %s\n", *err);
return SWITCH_STATUS_GENERR;
@ -1902,6 +1904,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_destroy(void)
switch_scheduler_task_thread_stop();
switch_rtp_shutdown();
if (switch_test_flag((&runtime), SCF_USE_AUTO_NAT)) {
switch_nat_shutdown();
}

View File

@ -1218,7 +1218,7 @@ static void switch_loadable_module_path_init()
}
#endif
SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
SWITCH_DECLARE(switch_status_t) switch_loadable_module_init(switch_bool_t autoload)
{
apr_finfo_t finfo = { 0 };
@ -1268,6 +1268,8 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
switch_core_hash_init_nocase(&loadable_modules.dialplan_hash, loadable_modules.pool);
switch_mutex_init(&loadable_modules.mutex, SWITCH_MUTEX_NESTED, loadable_modules.pool);
if (!autoload) return SWITCH_STATUS_SUCCESS;
switch_loadable_module_load_module("", "CORE_SOFTTIMER_MODULE", SWITCH_FALSE, &err);
switch_loadable_module_load_module("", "CORE_PCM_MODULE", SWITCH_FALSE, &err);

View File

@ -690,7 +690,7 @@ SWITCH_DECLARE(void) switch_nat_late_init(void)
{
if (nat_globals_perm.running == 1) {
switch_scheduler_add_task(switch_epoch_time_now(NULL) + NAT_REFRESH_INTERVAL, switch_nat_republish_sched, "nat_republish", "core", 0, NULL,
SSHF_NONE);
SSHF_OWN_THREAD);
}
}

View File

@ -662,6 +662,10 @@ SWITCH_DECLARE(void) switch_rtp_shutdown(void)
const void *var;
void *val;
if (!global_init) {
return;
}
switch_mutex_lock(port_lock);
for (hi = switch_hash_first(NULL, alloc_hash); hi; hi = switch_hash_next(hi)) {

193
src/tone2wav.c Normal file
View File

@ -0,0 +1,193 @@
/*
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
* Copyright (C) 2005-2010, Anthony Minessale II <anthm@freeswitch.org>
*
* 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
* Anthony Minessale II <anthm@freeswitch.org>
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Anthony Minessale II <anthm@freeswitch.org>
* Michael Jerris <mike@jerris.com>
* Pawel Pierscionek <pawel@voiceworks.pl>
* Bret McDanel <trixter AT 0xdecafbad.com>
*
*
* tone2wav.c -- Generate a .wav from teletone spec
*
*/
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif
#ifndef WIN32
#ifdef HAVE_SETRLIMIT
#include <sys/resource.h>
#endif
#endif
#include <switch.h>
#include <switch_version.h>
/* Picky compiler */
#ifdef __ICC
#pragma warning (disable:167)
#endif
static int teletone_handler(teletone_generation_session_t *ts, teletone_tone_map_t *map)
{
switch_file_handle_t *fh = (switch_file_handle_t *) ts->user_data;
int wrote;
switch_size_t len;
wrote = teletone_mux_tones(ts, map);
len = wrote;
if (switch_core_file_write(fh, ts->buffer, &len) != SWITCH_STATUS_SUCCESS) {
return -1;
}
return 0;
}
#define fail() r = 255; goto end
/* the main application entry point */
int main(int argc, char *argv[])
{
teletone_generation_session_t ts;
int file_flags = SWITCH_FILE_FLAG_WRITE | SWITCH_FILE_DATA_SHORT;
int r = 0;
int rate = 8000;
char *file = NULL, *script = NULL;
switch_file_handle_t fh = { 0 };
const char *err = NULL;
switch_bool_t verbose = SWITCH_FALSE;
int i = 0, c = 1, help = 0;
for(i = 1; i < argc; i++) {
if (!strstr(argv[i], "-")) break;
if (!strcmp(argv[i], "-v")) {
verbose = SWITCH_TRUE;
}
if (!strcmp(argv[i], "-s")) {
c = 2;
}
if (!strcmp(argv[i], "-h")) {
help = 1;
}
if (!strncmp(argv[i], "-R", 2)) {
char *p = argv[i] + 2;
if (p) {
int tmp = atoi(p);
if (tmp > 0) {
rate = tmp;
}
}
}
}
if (argc - i != 2 || help) {
char *app = NULL;
if (!help) printf("Invalid input!\n");
if ((app = strrchr(argv[0], '/'))) {
app++;
} else {
app = argv[0];
}
printf("USAGE: %s [options] <file> <tones>\n", app);
printf("================================================================================\n");
printf("Options:\n"
"-s\t\tStereo\n"
"-h\t\tHelp\n"
"-R<rate>\tSet Rate (8000,16000,32000,48000) etc.\n"
"-v\t\tVerbose Logging\n"
"<file>\t\tAny file supported by libsndfile\n"
"<tones>\t\tA valid teletone script http://wiki.freeswitch.org/wiki/TGML"
"\n\n\n"
);
return 255;
}
file = argv[i];
script = argv[i+1];
if (switch_core_init(SCF_MINIMAL, verbose, &err) != SWITCH_STATUS_SUCCESS) {
printf("Cannot init core [%s]\n", err);
fail();
}
switch_loadable_module_init(SWITCH_FALSE);
if (switch_loadable_module_load_module((char *) SWITCH_GLOBAL_dirs.mod_dir, (char *) "mod_sndfile", SWITCH_TRUE, &err) != SWITCH_STATUS_SUCCESS) {
printf("Cannot init mod_sndfile [%s]\n", err);
fail();
}
if (switch_core_file_open(&fh, file, c, rate, file_flags, NULL) != SWITCH_STATUS_SUCCESS) {
printf("Cannot open file %s\n", file);
fail();
}
teletone_init_session(&ts, 0, teletone_handler, &fh);
ts.rate = rate;
ts.channels = c;
ts.duration = 250 * (rate / 1000 / c);
ts.wait = 50 * (rate / 1000 / c);
if (verbose) {
ts.debug = 10;
ts.debug_stream = stdout;
}
teletone_run(&ts, script);
teletone_destroy_session(&ts);
switch_core_file_close(&fh);
printf("File: %s generated.....\nPlease support:\n\nFreeSWITCH http://www.freeswitch.org\nClueCon http://www.cluecon.com\n", file);
end:
switch_core_destroy();
return r;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4:
*/