mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 17:38:59 +00:00
spring cleaning
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4795 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -80,7 +80,7 @@ int fs_loadable_module_shutdown(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int fs_console_loop(void)
|
||||
int fs_console_loop(void)
|
||||
{
|
||||
switch_console_loop();
|
||||
return 0;
|
||||
@@ -88,17 +88,17 @@ int fs_console_loop(void)
|
||||
|
||||
void fs_consol_log(char *level_str, char *msg)
|
||||
{
|
||||
switch_log_level_t level = SWITCH_LOG_DEBUG;
|
||||
if (level_str) {
|
||||
level = switch_log_str2level(level_str);
|
||||
switch_log_level_t level = SWITCH_LOG_DEBUG;
|
||||
if (level_str) {
|
||||
level = switch_log_str2level(level_str);
|
||||
}
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, level, msg);
|
||||
}
|
||||
|
||||
|
||||
void fs_consol_clean(char *msg)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
|
||||
}
|
||||
|
||||
switch_core_session_t *fs_core_session_locate(char *uuid)
|
||||
@@ -157,71 +157,58 @@ void fs_channel_set_state(switch_core_session_t *session, char *state)
|
||||
IVR Routines! You can do IVR in PHP NOW!
|
||||
*/
|
||||
|
||||
int fs_ivr_play_file(switch_core_session_t *session,
|
||||
switch_file_handle_t *fh,
|
||||
char *file,
|
||||
switch_input_args_t *args)
|
||||
int fs_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args)
|
||||
{
|
||||
switch_status_t status;
|
||||
|
||||
|
||||
status = switch_ivr_play_file(session, fh, file, args);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
int fs_switch_ivr_record_file(switch_core_session_t *session,
|
||||
switch_file_handle_t *fh,
|
||||
char *file,
|
||||
switch_input_args_t *args,
|
||||
unsigned int limit
|
||||
)
|
||||
{
|
||||
switch_file_handle_t *fh, char *file, switch_input_args_t *args, unsigned int limit)
|
||||
{
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_ivr_record_file(session, fh, file, args, limit);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
|
||||
status = switch_ivr_record_file(session, fh, file, args, limit);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
int fs_switch_ivr_sleep(switch_core_session_t *session,
|
||||
uint32_t ms)
|
||||
int fs_switch_ivr_sleep(switch_core_session_t *session, uint32_t ms)
|
||||
{
|
||||
switch_status_t status;
|
||||
status = switch_ivr_sleep(session, ms);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
int fs_ivr_play_file2(switch_core_session_t *session,
|
||||
char *file)
|
||||
|
||||
int fs_ivr_play_file2(switch_core_session_t *session, char *file)
|
||||
{
|
||||
switch_status_t status;
|
||||
|
||||
|
||||
status = switch_ivr_play_file(session, NULL, file, NULL);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
int fs_switch_ivr_collect_digits_callback (switch_core_session_t *session,
|
||||
switch_input_args_t *args,
|
||||
unsigned int timeout)
|
||||
int fs_switch_ivr_collect_digits_callback(switch_core_session_t *session,
|
||||
switch_input_args_t *args, unsigned int timeout)
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_ivr_collect_digits_callback(session, args, timeout);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
status = switch_ivr_collect_digits_callback(session, args, timeout);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
int fs_switch_ivr_collect_digits_count (switch_core_session_t *session,
|
||||
char *buf,
|
||||
unsigned int buflen,
|
||||
unsigned int maxdigits,
|
||||
const char *terminators,
|
||||
char *terminator,
|
||||
unsigned int timeout)
|
||||
int fs_switch_ivr_collect_digits_count(switch_core_session_t *session,
|
||||
char *buf,
|
||||
unsigned int buflen,
|
||||
unsigned int maxdigits,
|
||||
const char *terminators, char *terminator, unsigned int timeout)
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_ivr_collect_digits_count(session, buf, buflen, maxdigits, terminators, terminator, timeout);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
status = switch_ivr_collect_digits_count(session, buf, buflen, maxdigits, terminators, terminator, timeout);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
/*int fs_switch_ivr_multi_threaded_bridge (switch_core_session_t *session,
|
||||
@@ -237,61 +224,54 @@ int fs_switch_ivr_collect_digits_count (switch_core_session_t *session,
|
||||
}
|
||||
*/
|
||||
|
||||
int fs_switch_ivr_originate (switch_core_session_t *session,
|
||||
switch_core_session_t **bleg,
|
||||
char * bridgeto,
|
||||
uint32_t timelimit_sec)
|
||||
int fs_switch_ivr_originate(switch_core_session_t *session,
|
||||
switch_core_session_t **bleg, char *bridgeto, uint32_t timelimit_sec)
|
||||
/*const switch_state_handler_table_t *table,
|
||||
char * cid_name_override,
|
||||
char * cid_num_override,
|
||||
switch_caller_profile_t *caller_profile_override) */
|
||||
{
|
||||
|
||||
switch_channel_t *caller_channel;
|
||||
switch_core_session_t *peer_session;
|
||||
unsigned int timelimit = 60;
|
||||
char *var;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||
switch_channel_t *caller_channel;
|
||||
switch_core_session_t *peer_session;
|
||||
unsigned int timelimit = 60;
|
||||
char *var;
|
||||
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||
|
||||
caller_channel = switch_core_session_get_channel(session);
|
||||
assert(caller_channel != NULL);
|
||||
caller_channel = switch_core_session_get_channel(session);
|
||||
assert(caller_channel != NULL);
|
||||
|
||||
if ((var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
|
||||
timelimit = atoi(var);
|
||||
}
|
||||
|
||||
if (switch_ivr_originate(session, &peer_session, &cause, bridgeto, timelimit, NULL, NULL, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
|
||||
switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
|
||||
return;
|
||||
} else {
|
||||
switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
|
||||
}
|
||||
if ((var = switch_channel_get_variable(caller_channel, "call_timeout"))) {
|
||||
timelimit = atoi(var);
|
||||
}
|
||||
|
||||
if (switch_ivr_originate(session, &peer_session, &cause, bridgeto, timelimit, NULL, NULL, NULL, NULL) !=
|
||||
SWITCH_STATUS_SUCCESS) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create Outgoing Channel!\n");
|
||||
switch_channel_hangup(caller_channel, SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL);
|
||||
return;
|
||||
} else {
|
||||
switch_ivr_multi_threaded_bridge(session, peer_session, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int fs_switch_ivr_session_transfer(switch_core_session_t *session,
|
||||
char *extension,
|
||||
char *dialplan,
|
||||
char *context)
|
||||
int fs_switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context)
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_ivr_session_transfer(session,extension,dialplan,context);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
status = switch_ivr_session_transfer(session, extension, dialplan, context);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
int fs_switch_ivr_speak_text (switch_core_session_t *session,
|
||||
char *tts_name,
|
||||
char *voice_name,
|
||||
uint32_t rate,
|
||||
char *text)
|
||||
int fs_switch_ivr_speak_text(switch_core_session_t *session,
|
||||
char *tts_name, char *voice_name, uint32_t rate, char *text)
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_ivr_speak_text(session,tts_name,voice_name,rate,text,NULL);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
status = switch_ivr_speak_text(session, tts_name, voice_name, rate, text, NULL);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +281,7 @@ int fs_switch_ivr_speak_text (switch_core_session_t *session,
|
||||
|
||||
*/
|
||||
|
||||
char* fs_switch_channel_get_variable(switch_channel_t *channel, char *varname)
|
||||
char *fs_switch_channel_get_variable(switch_channel_t *channel, char *varname)
|
||||
{
|
||||
return switch_channel_get_variable(channel, varname);
|
||||
}
|
||||
@@ -309,11 +289,11 @@ char* fs_switch_channel_get_variable(switch_channel_t *channel, char *varname)
|
||||
|
||||
int fs_switch_channel_set_variable(switch_channel_t *channel, char *varname, char *value)
|
||||
{
|
||||
switch_status_t status;
|
||||
switch_status_t status;
|
||||
|
||||
status = switch_channel_set_variable(channel, varname, value);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
status = switch_channel_set_variable(channel, varname, value);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
/* For Emacs:
|
||||
* Local Variables:
|
||||
|
Reference in New Issue
Block a user