RTS API Documentation
1.10.11
|
Modules | |
IVR Menu Library | |
Typedefs | |
typedef struct switch_ivr_digit_stream_parser | switch_ivr_digit_stream_parser_t |
typedef struct switch_ivr_digit_stream | switch_ivr_digit_stream_t |
Functions | |
switch_status_t | switch_ivr_deactivate_unicast (switch_core_session_t *session) |
switch_status_t | switch_ivr_activate_unicast (switch_core_session_t *session, char *local_ip, switch_port_t local_port, char *remote_ip, switch_port_t remote_port, char *transport, char *flags) |
switch_status_t | switch_ivr_generate_json_cdr (switch_core_session_t *session, cJSON **json_cdr, switch_bool_t urlencode) |
Generate an JSON CDR report. More... | |
switch_status_t | switch_ivr_generate_xml_cdr (switch_core_session_t *session, switch_xml_t *xml_cdr) |
Generate an XML CDR report. More... | |
int | switch_ivr_set_xml_profile_data (switch_xml_t xml, switch_caller_profile_t *caller_profile, int off) |
int | switch_ivr_set_xml_chan_vars (switch_xml_t xml, switch_channel_t *channel, int off) |
switch_status_t | switch_ivr_parse_event (_In_ switch_core_session_t *session, _In_ switch_event_t *event) |
Parse command from an event. More... | |
switch_status_t | switch_ivr_parse_all_events (switch_core_session_t *session) |
Parse all commands from an event. More... | |
switch_status_t | switch_ivr_parse_next_event (switch_core_session_t *session) |
switch_status_t | switch_ivr_parse_all_messages (switch_core_session_t *session) |
switch_status_t | switch_ivr_parse_all_signal_data (switch_core_session_t *session) |
switch_status_t | switch_ivr_parse_signal_data (switch_core_session_t *session, switch_bool_t all, switch_bool_t only_session_thread) |
switch_status_t | switch_ivr_parse_next_signal_data (switch_core_session_t *session) |
switch_status_t | switch_ivr_process_indications (switch_core_session_t *session, switch_core_session_message_t *message) |
switch_status_t | switch_ivr_sleep (switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args) |
Wait for time to pass for a specified number of milliseconds. More... | |
switch_status_t | switch_ivr_park (switch_core_session_t *session, switch_input_args_t *args) |
switch_status_t | switch_ivr_collect_digits_callback (switch_core_session_t *session, switch_input_args_t *args, uint32_t digit_timeout, uint32_t abs_timeout) |
Wait for DTMF digits calling a pluggable callback function when digits are collected. More... | |
switch_status_t | switch_ivr_collect_digits_count (switch_core_session_t *session, char *buf, switch_size_t buflen, switch_size_t maxdigits, const char *terminators, char *terminator, uint32_t first_timeout, uint32_t digit_timeout, uint32_t abs_timeout) |
Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up. More... | |
switch_status_t | switch_ivr_play_and_detect_speech (switch_core_session_t *session, const char *file, const char *mod_name, const char *grammar, char **result, uint32_t input_timeout, switch_input_args_t *args) |
play a file to the session while doing speech recognition. More... | |
switch_status_t | switch_ivr_detect_speech_init (switch_core_session_t *session, const char *mod_name, const char *dest, switch_asr_handle_t *ah) |
Initialize background Speech detection on a session, so that parameters can be set, and grammars loaded. After calling this function, it is possible to call switch_ivr_set_param_detect_speech() to set recognition parameters. Calling switch_ivr_detect_speech_load_grammar() starts the speech recognition. More... | |
switch_status_t | switch_ivr_detect_speech (switch_core_session_t *session, const char *mod_name, const char *grammar, const char *name, const char *dest, switch_asr_handle_t *ah) |
Engage background Speech detection on a session. More... | |
switch_status_t | switch_ivr_stop_detect_speech (switch_core_session_t *session) |
Stop background Speech detection on a session. More... | |
switch_status_t | switch_ivr_pause_detect_speech (switch_core_session_t *session) |
Pause background Speech detection on a session. More... | |
switch_status_t | switch_ivr_resume_detect_speech (switch_core_session_t *session) |
Resume background Speech detection on a session. More... | |
switch_status_t | switch_ivr_detect_speech_load_grammar (switch_core_session_t *session, const char *grammar, const char *name) |
Load a grammar on a background speech detection handle. More... | |
switch_status_t | switch_ivr_detect_speech_unload_grammar (switch_core_session_t *session, const char *name) |
Unload a grammar on a background speech detection handle. More... | |
switch_status_t | switch_ivr_detect_speech_enable_grammar (switch_core_session_t *session, const char *name) |
Enable a grammar on a background speech detection handle. More... | |
switch_status_t | switch_ivr_detect_speech_disable_grammar (switch_core_session_t *session, const char *name) |
Disable a grammar on a background speech detection handle. More... | |
switch_status_t | switch_ivr_detect_speech_disable_all_grammars (switch_core_session_t *session) |
Disable all grammars on a background speech detection handle. More... | |
switch_status_t | switch_ivr_set_param_detect_speech (switch_core_session_t *session, const char *name, const char *val) |
switch_status_t | switch_ivr_detect_speech_start_input_timers (switch_core_session_t *session) |
Start input timers on a background speech detection handle. More... | |
switch_status_t | switch_ivr_record_session (switch_core_session_t *session, const char *file, uint32_t limit, switch_file_handle_t *fh) |
Record a session to disk. More... | |
switch_status_t | switch_ivr_record_session_event (switch_core_session_t *session, const char *file, uint32_t limit, switch_file_handle_t *fh, switch_event_t *variables) |
switch_status_t | switch_ivr_transfer_recordings (switch_core_session_t *orig_session, switch_core_session_t *new_session) |
switch_status_t | switch_ivr_eavesdrop_pop_eavesdropper (switch_core_session_t *session, switch_core_session_t **sessionp) |
switch_status_t | switch_ivr_eavesdrop_exec_all (switch_core_session_t *session, const char *app, const char *arg) |
switch_status_t | switch_ivr_eavesdrop_update_display (switch_core_session_t *session, const char *name, const char *number) |
switch_status_t | switch_ivr_eavesdrop_session (switch_core_session_t *session, const char *uuid, const char *require_group, switch_eavesdrop_flag_t flags) |
Eavesdrop on a another session. More... | |
switch_status_t | switch_ivr_displace_session (switch_core_session_t *session, const char *file, uint32_t limit, const char *flags) |
displace the media for a session with the audio from a file More... | |
switch_status_t | switch_ivr_stop_displace_session (switch_core_session_t *session, const char *file) |
Stop displacing a session. More... | |
switch_status_t | switch_ivr_stop_record_session (switch_core_session_t *session, const char *file) |
Stop Recording a session. More... | |
switch_status_t | switch_ivr_session_audio (switch_core_session_t *session, const char *cmd, const char *direction, int level) |
switch_status_t | switch_ivr_stop_session_audio (switch_core_session_t *session) |
switch_status_t | switch_ivr_inband_dtmf_session (switch_core_session_t *session) |
Start looking for DTMF inband. More... | |
switch_status_t | switch_ivr_stop_inband_dtmf_session (switch_core_session_t *session) |
Stop looking for DTMF inband. More... | |
switch_status_t | switch_ivr_inband_dtmf_generate_session (switch_core_session_t *session, switch_bool_t read_stream) |
Start generating DTMF inband. More... | |
switch_status_t | switch_ivr_stop_inband_dtmf_generate_session (switch_core_session_t *session) |
Stop generating DTMF inband. More... | |
switch_status_t | switch_ivr_session_echo (switch_core_session_t *session, switch_input_args_t *args) |
| |
switch_status_t | switch_ivr_stop_tone_detect_session (switch_core_session_t *session) |
Stop looking for TONES. More... | |
switch_status_t | switch_ivr_tone_detect_session (switch_core_session_t *session, const char *key, const char *tone_spec, const char *flags, time_t timeout, int hits, const char *app, const char *data, switch_tone_detect_callback_t callback) |
Start looking for TONES. More... | |
switch_status_t | switch_ivr_play_file (switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args) |
play a file from the disk to the session More... | |
switch_status_t | switch_ivr_detect_audio (switch_core_session_t *session, uint32_t thresh, uint32_t audio_hits, uint32_t timeout_ms, const char *file) |
switch_status_t | switch_ivr_detect_silence (switch_core_session_t *session, uint32_t thresh, uint32_t silence_hits, uint32_t timeout_ms, const char *file) |
switch_status_t | switch_ivr_wait_for_silence (switch_core_session_t *session, uint32_t thresh, uint32_t silence_hits, uint32_t listen_hits, uint32_t timeout_ms, const char *file) |
switch_status_t | switch_ivr_gentones (switch_core_session_t *session, const char *script, int32_t loops, switch_input_args_t *args) |
switch_status_t | switch_ivr_record_file (_In_ switch_core_session_t *session, _In_ switch_file_handle_t *fh, _In_z_ const char *file, _In_opt_ switch_input_args_t *args, _In_ uint32_t limit) |
record a file from the session to a file More... | |
switch_status_t | switch_ivr_record_file_event (_In_ switch_core_session_t *session, _In_ switch_file_handle_t *fh, _In_z_ const char *file, _In_opt_ switch_input_args_t *args, _In_ uint32_t limit, switch_event_t *vars) |
record a file from the session to a file More... | |
switch_status_t | switch_play_and_get_digits (switch_core_session_t *session, uint32_t min_digits, uint32_t max_digits, uint32_t max_tries, uint32_t timeout, const char *valid_terminators, const char *audio_file, const char *bad_input_audio_file, const char *var_name, char *digit_buffer, uint32_t digit_buffer_length, const char *digits_regex, uint32_t digit_timeout, const char *transfer_on_failure) |
Play a sound and gather digits with the number of retries specified if the user doesn't give digits in the set time. More... | |
switch_status_t | switch_ivr_speak_text_handle (switch_core_session_t *session, switch_speech_handle_t *sh, switch_codec_t *codec, switch_timer_t *timer, const char *text, switch_input_args_t *args) |
void | switch_ivr_clear_speech_cache (switch_core_session_t *session) |
switch_status_t | switch_ivr_speak_text (switch_core_session_t *session, const char *tts_name, const char *voice_name, const char *text, switch_input_args_t *args) |
Speak given text with given tts engine. More... | |
switch_status_t | switch_ivr_originate (switch_core_session_t *session, switch_core_session_t **bleg, switch_call_cause_t *cause, const char *bridgeto, uint32_t timelimit_sec, const switch_state_handler_table_t *table, const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override, switch_event_t *ovars, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause, switch_dial_handle_t *dh) |
Make an outgoing call. More... | |
switch_status_t | switch_ivr_enterprise_originate (switch_core_session_t *session, switch_core_session_t **bleg, switch_call_cause_t *cause, const char *bridgeto, uint32_t timelimit_sec, const switch_state_handler_table_t *table, const char *cid_name_override, const char *cid_num_override, switch_caller_profile_t *caller_profile_override, switch_event_t *ovars, switch_originate_flag_t flags, switch_call_cause_t *cancel_cause, switch_dial_handle_list_t *hl) |
void | switch_ivr_bridge_display (switch_core_session_t *session, switch_core_session_t *peer_session) |
switch_status_t | switch_ivr_multi_threaded_bridge (_In_ switch_core_session_t *session, _In_ switch_core_session_t *peer_session, switch_input_callback_function_t dtmf_callback, void *session_data, void *peer_session_data) |
Bridge Audio from one session to another. More... | |
switch_status_t | switch_ivr_bridge_bleg (switch_core_session_t *session, switch_core_session_t *peer_session, uint32_t max_wait_ms) |
Bridge leaving b-leg in the control of another thread. Call from b-leg first then call switch_ivr_multi_threaded_bridge on a-leg and b-leg. More... | |
switch_status_t | switch_ivr_signal_bridge (switch_core_session_t *session, switch_core_session_t *peer_session) |
Bridge Signalling from one session to another. More... | |
void | switch_ivr_check_hold (switch_core_session_t *session) |
switch_status_t | switch_ivr_session_transfer (_In_ switch_core_session_t *session, const char *extension, const char *dialplan, const char *context) |
Transfer an existing session to another location. More... | |
uint32_t | switch_ivr_schedule_transfer (time_t runtime, const char *uuid, char *extension, char *dialplan, char *context) |
Transfer an existing session to another location in the future. More... | |
uint32_t | switch_ivr_schedule_hangup (time_t runtime, const char *uuid, switch_call_cause_t cause, switch_bool_t bleg) |
Hangup an existing session in the future. More... | |
switch_status_t | switch_ivr_uuid_bridge (const char *originator_uuid, const char *originatee_uuid) |
Bridge two existing sessions. More... | |
switch_status_t | switch_ivr_media (const char *uuid, switch_media_flag_t flags) |
Signal a session to request direct media access to it's remote end. More... | |
switch_status_t | switch_ivr_3p_media (const char *uuid, switch_media_flag_t flags) |
switch_status_t | switch_ivr_nomedia (const char *uuid, switch_media_flag_t flags) |
Signal a session to request indirect media allowing it to exchange media directly with another device. More... | |
switch_status_t | switch_ivr_3p_nomedia (const char *uuid, switch_media_flag_t flags) |
void | switch_ivr_bg_media (const char *uuid, switch_media_flag_t flags, switch_bool_t on, switch_bool_t is3p, uint32_t delay) |
switch_status_t | switch_ivr_hold_uuid (const char *uuid, const char *message, switch_bool_t moh) |
Signal the session with a protocol specific hold message. More... | |
switch_status_t | switch_ivr_hold_toggle_uuid (const char *uuid, const char *message, switch_bool_t moh) |
Toggles channel hold state of session. More... | |
switch_status_t | switch_ivr_unhold_uuid (const char *uuid) |
Signal the session with a protocol specific unhold message. More... | |
switch_status_t | switch_ivr_hold (switch_core_session_t *session, const char *message, switch_bool_t moh) |
Signal the session with a protocol specific hold message. More... | |
switch_status_t | switch_ivr_unhold (switch_core_session_t *session) |
Signal the session with a protocol specific unhold message. More... | |
uint32_t | switch_ivr_schedule_broadcast (time_t runtime, const char *uuid, const char *path, switch_media_flag_t flags) |
Signal the session to broadcast audio in the future. More... | |
switch_status_t | switch_ivr_broadcast (const char *uuid, const char *path, switch_media_flag_t flags) |
Signal the session to broadcast audio. More... | |
void | switch_ivr_broadcast_in_thread (switch_core_session_t *session, const char *app, int flags) |
switch_status_t | switch_ivr_transfer_variable (switch_core_session_t *sessa, switch_core_session_t *sessb, char *var) |
Transfer variables from one session to another. More... | |
switch_status_t | switch_ivr_digit_stream_parser_new (switch_memory_pool_t *pool, switch_ivr_digit_stream_parser_t **parser) |
Create a digit stream parser object. More... | |
switch_status_t | switch_ivr_digit_stream_parser_destroy (switch_ivr_digit_stream_parser_t *parser) |
Destroy a digit stream parser object. More... | |
switch_status_t | switch_ivr_digit_stream_new (switch_ivr_digit_stream_parser_t *parser, switch_ivr_digit_stream_t **stream) |
Create a new digit stream object. More... | |
switch_status_t | switch_ivr_digit_stream_destroy (switch_ivr_digit_stream_t **stream) |
Destroys a digit stream object. More... | |
switch_status_t | switch_ivr_digit_stream_parser_set_event (switch_ivr_digit_stream_parser_t *parser, char *digits, void *data) |
Set a digit string to action mapping. More... | |
switch_status_t | switch_ivr_digit_stream_parser_del_event (switch_ivr_digit_stream_parser_t *parser, char *digits) |
Delete a string to action mapping. More... | |
void * | switch_ivr_digit_stream_parser_feed (switch_ivr_digit_stream_parser_t *parser, switch_ivr_digit_stream_t *stream, char digit) |
Feed digits collected into the stream for event match testing. More... | |
switch_status_t | switch_ivr_digit_stream_reset (switch_ivr_digit_stream_t *stream) |
Reset the collected digit stream to nothing. More... | |
switch_status_t | switch_ivr_digit_stream_parser_set_terminator (switch_ivr_digit_stream_parser_t *parser, char digit) |
Set a digit string terminator. More... | |
A group of core functions to do IVR related functions designed to be building blocks for a higher level IVR interface.
typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t |
Definition at line 712 of file switch_ivr.h.
typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t |
Definition at line 714 of file switch_ivr.h.
switch_status_t switch_ivr_3p_media | ( | const char * | uuid, |
switch_media_flag_t | flags | ||
) |
Definition at line 1663 of file switch_ivr.c.
References CF_3P_MEDIA_REQUESTED, CF_BRIDGE_ORIGINATOR, CF_BRIDGED, CF_EARLY_MEDIA, CF_MEDIA_ACK, CF_MEDIA_SET, CF_MEDIA_TRANS, CF_PROXY_MODE, CF_REQ_MEDIA, switch_core_session_message::from, switch_core_session_message::message_id, switch_core_session_message::numeric_arg, SMF_IMMEDIATE, SMF_REBRIDGE, SMF_REPLYONLY_A, SMF_REPLYONLY_B, switch_assert, switch_channel_clear_flag(), switch_channel_clear_state_handler(), switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_FALSE, switch_ivr_uuid_bridge(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MESSAGE_INDICATE_3P_MEDIA, SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS, SWITCH_SIGNAL_BRIDGE_VARIABLE, SWITCH_STATUS_GENERR, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_yield.
Referenced by media_thread_run().
switch_status_t switch_ivr_3p_nomedia | ( | const char * | uuid, |
switch_media_flag_t | flags | ||
) |
Definition at line 1881 of file switch_ivr.c.
References CF_3P_NOMEDIA_REQUESTED, CF_3P_NOMEDIA_REQUESTED_BLEG, CF_BRIDGE_ORIGINATOR, CF_MEDIA_ACK, CF_MEDIA_TRANS, CF_PROXY_MODE, CF_REDIRECT, CF_REQ_MEDIA, CF_RESET, CS_HIBERNATE, CS_PARK, switch_core_session_message::from, switch_core_session_message::message_id, SMF_FORCE, SMF_REBRIDGE, switch_core_session_message::string_arg, SWITCH_BRIDGE_VARIABLE, switch_channel_clear_flag(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_state, switch_channel_set_variable, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_channel_wait_for_state(), switch_core_session_get_channel(), switch_core_session_in_thread(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_FALSE, switch_ivr_signal_bridge(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MESSAGE_INDICATE_3P_NOMEDIA, SWITCH_R_SDP_VARIABLE, SWITCH_STATUS_GENERR, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_yield.
Referenced by audio_bridge_thread(), and media_thread_run().
switch_status_t switch_ivr_activate_unicast | ( | switch_core_session_t * | session, |
char * | local_ip, | ||
switch_port_t | local_port, | ||
char * | remote_ip, | ||
switch_port_t | remote_port, | ||
char * | transport, | ||
char * | flags | ||
) |
Definition at line 404 of file switch_ivr.c.
References switch_codec_implementation::actual_samples_per_second, switch_frame::buflen, CF_UNICAST, switch_frame::codec, switch_frame::data, fail, switch_unicast_conninfo::flag_mutex, switch_codec::implementation, switch_unicast_conninfo::local_addr, switch_unicast_conninfo::local_ip, switch_unicast_conninfo::local_port, switch_codec_implementation::microseconds_per_packet, switch_unicast_conninfo::read_codec, switch_unicast_conninfo::remote_addr, switch_unicast_conninfo::remote_ip, switch_unicast_conninfo::remote_port, switch_unicast_conninfo::session, switch_unicast_conninfo::socket, SUF_NATIVE, SUF_READY, switch_assert, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_private(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_init, switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_codec(), switch_core_session_strdup, SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_set_flag, switch_set_flag_locked, switch_sockaddr_info_get(), switch_socket_bind(), switch_socket_create(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_UNSPEC, switch_unicast_conninfo::transport, switch_unicast_conninfo::type, switch_unicast_conninfo::write_frame, and switch_unicast_conninfo::write_frame_data.
Referenced by switch_ivr_parse_event().
void switch_ivr_bg_media | ( | const char * | uuid, |
switch_media_flag_t | flags, | ||
switch_bool_t | on, | ||
switch_bool_t | is3p, | ||
uint32_t | delay | ||
) |
Definition at line 2121 of file switch_ivr.c.
References media_job_t::delay, media_job_t::flags, switch_thread_data_s::func, media_job_t::is3p, media_thread_run(), switch_thread_data_s::obj, media_job_t::on, pool, switch_thread_data_s::pool, media_job_t::pool, switch_core_alloc, switch_core_new_memory_pool, switch_core_strdup, switch_thread_pool_launch_thread(), and media_job_t::uuid.
Referenced by switch_core_media_toggle_hold().
switch_status_t switch_ivr_bridge_bleg | ( | switch_core_session_t * | session, |
switch_core_session_t * | peer_session, | ||
uint32_t | max_wait_ms | ||
) |
Bridge leaving b-leg in the control of another thread. Call from b-leg first then call switch_ivr_multi_threaded_bridge on a-leg and b-leg.
session | b-leg session |
Definition at line 1073 of file switch_ivr_bridge.c.
References audio_bridge_on_exchange_media(), CF_ARRANGED_BRIDGE, CF_TRANSFER, switch_assert, switch_channel_clear_flag(), switch_channel_set_flag, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_core_session_get_channel(), SWITCH_FALSE, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, uuid_bridge_on_hibernate(), uuid_bridge_on_reset(), and uuid_bridge_on_soft_execute().
void switch_ivr_bridge_display | ( | switch_core_session_t * | session, |
switch_core_session_t * | peer_session | ||
) |
Definition at line 336 of file switch_ivr_bridge.c.
References send_display().
Referenced by audio_bridge_thread(), and switch_ivr_signal_bridge().
switch_status_t switch_ivr_broadcast | ( | const char * | uuid, |
const char * | path, | ||
switch_media_flag_t | flags | ||
) |
Signal the session to broadcast audio.
uuid | the uuid of the session to broadcast on |
path | the path data of the broadcast "/path/to/file.wav [<timer name>]" or "speak:<engine>|<voice>|<Text to say>" |
flags | flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call) |
Definition at line 5654 of file switch_ivr_async.c.
References CF_BROADCAST_DROP_MEDIA, CF_PROXY_MODE, SAF_MEDIA_TAP, SMF_ECHO_ALEG, SMF_ECHO_BLEG, SMF_EXEC_INLINE, SMF_HOLD_BLEG, SMF_LOOP, SMF_PRIORITY, SMF_REBRIDGE, switch_assert, switch_channel_get_partner_uuid(), switch_channel_set_flag, switch_channel_test_flag(), switch_core_session_execute_application, switch_core_session_execute_application_get_flags(), switch_core_session_get_app_flags(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_queue_private_event(), switch_core_session_rwunlock(), switch_event_add_header(), switch_event_add_header_string(), SWITCH_EVENT_COMMAND, switch_event_create, switch_ivr_media(), switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by audio_bridge_thread(), bcast_thread(), meta_on_dtmf(), switch_core_media_toggle_hold(), switch_core_session_send_dtmf(), switch_ivr_hold(), switch_ivr_parse_event(), switch_ivr_soft_hold(), and SWITCH_STANDARD_SCHED_FUNC().
void switch_ivr_broadcast_in_thread | ( | switch_core_session_t * | session, |
const char * | app, | ||
int | flags | ||
) |
Definition at line 4540 of file switch_ivr_async.c.
References bch_t::app, bcast_thread(), bch_t::flags, pool, bch_t::session, switch_assert, switch_core_session_alloc, switch_core_session_get_pool(), switch_thread_create(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_detach_set(), switch_threadattr_stacksize_set(), and thread.
Referenced by meta_on_dtmf().
void switch_ivr_check_hold | ( | switch_core_session_t * | session | ) |
Definition at line 2143 of file switch_ivr.c.
References CC_MUTE_VIA_MEDIA_STREAM, CF_ANSWERED, CF_HOLD, switch_core_session_message::from, switch_core_session_message::message_id, SDP_TYPE_REQUEST, switch_channel_test_cap(), switch_channel_test_flag(), switch_core_media_set_smode(), switch_core_session_get_channel(), switch_core_session_media_flow(), switch_core_session_receive_message, switch_ivr_unhold(), SWITCH_MEDIA_FLOW_SENDRECV, SWITCH_MEDIA_TYPE_AUDIO, and SWITCH_MESSAGE_INDICATE_MEDIA_RENEG.
Referenced by switch_ivr_session_transfer(), and switch_ivr_uuid_bridge().
void switch_ivr_clear_speech_cache | ( | switch_core_session_t * | session | ) |
Definition at line 3008 of file switch_ivr_play_say.c.
References cached_speech_handle::codec, switch_timer::interval, cached_speech_handle::sh, switch_speech_handle::speech_interface, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, switch_channel_get_private(), switch_channel_set_private(), switch_core_codec_destroy(), switch_core_session_get_channel(), switch_core_speech_close(), switch_core_timer_destroy(), SWITCH_SPEECH_FLAG_NONE, and cached_speech_handle::timer.
Referenced by switch_core_session_perform_destroy(), and switch_ivr_speak_text().
switch_status_t switch_ivr_collect_digits_callback | ( | switch_core_session_t * | session, |
switch_input_args_t * | args, | ||
uint32_t | digit_timeout, | ||
uint32_t | abs_timeout | ||
) |
Wait for DTMF digits calling a pluggable callback function when digits are collected.
session | the session to read. |
args | arguements to pass for callbacks etc |
timeout | a timeout in milliseconds |
Definition at line 1225 of file switch_ivr.c.
References arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_input_args_t::buflen, CF_BREAK, CF_SERVICE, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_input_args_t::input_callback, switch_input_args_t::read_frame_callback, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_has_dtmf(), switch_channel_ready, switch_channel_test_flag(), switch_cond_next(), switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_read_frame(), switch_event_destroy(), SWITCH_FALSE, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), switch_micro_time_now(), SWITCH_READ_ACCEPTABLE, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, and switch_input_args_t::user_data.
Referenced by CoreSession::collectDigits(), enterprise_originate_ringback_thread(), fs_switch_ivr_collect_digits_callback(), and switch_ivr_soft_hold().
switch_status_t switch_ivr_collect_digits_count | ( | switch_core_session_t * | session, |
char * | buf, | ||
switch_size_t | buflen, | ||
switch_size_t | maxdigits, | ||
const char * | terminators, | ||
char * | terminator, | ||
uint32_t | first_timeout, | ||
uint32_t | digit_timeout, | ||
uint32_t | abs_timeout | ||
) |
Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up.
session | the session to read. |
buf | strig to write to |
buflen | max size of buf |
maxdigits | max number of digits to read |
terminators | digits to end the collection |
terminator | actual digit that caused the collection to end (if any) |
first_timeout | timeout in ms |
digit_timeout | digit timeout in ms |
abs_timeout | abs timeout in ms |
Definition at line 1342 of file switch_ivr.c.
References switch_frame::buflen, CF_SERVICE, switch_frame::codec, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_frame::samples, switch_codec_implementation::samples_per_second, switch_channel_dequeue_dtmf(), switch_channel_get_variable, switch_channel_has_dtmf(), switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_cond_next(), switch_core_codec_destroy(), switch_core_codec_init, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_write_frame(), switch_generate_sln_silence(), SWITCH_IO_FLAG_NONE, switch_ivr_parse_all_events(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_micro_time_now(), SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, switch_zmalloc, and zstr.
Referenced by fs_switch_ivr_collect_digits_count(), CoreSession::getDigits(), play_and_collect(), and switch_ivr_read().
switch_status_t switch_ivr_deactivate_unicast | ( | switch_core_session_t * | session | ) |
Definition at line 371 of file switch_ivr.c.
References CF_UNICAST, switch_unicast_conninfo::read_codec, switch_unicast_conninfo::socket, SUF_READY, SUF_THREAD_RUNNING, switch_channel_clear_flag(), switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_clear_flag_locked, switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_session_get_channel(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SHUTDOWN_READWRITE, switch_socket_close(), switch_socket_shutdown(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_thread_join(), switch_yield, and switch_unicast_conninfo::thread.
Referenced by switch_core_session_perform_destroy(), switch_core_session_reset(), and switch_ivr_park().
switch_status_t switch_ivr_detect_audio | ( | switch_core_session_t * | session, |
uint32_t | thresh, | ||
uint32_t | audio_hits, | ||
uint32_t | timeout_ms, | ||
const char * | file | ||
) |
Definition at line 2235 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, switch_frame::buflen, switch_file_handle::channels, switch_frame::codec, count, switch_frame::data, switch_frame::datalen, switch_codec::implementation, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_frame::samples, switch_codec_implementation::samples_per_packet, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_file_close(), switch_core_file_open, switch_core_file_read(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_set_read_codec(), switch_core_session_write_frame(), SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, SWITCH_IO_FLAG_NONE, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_zmalloc.
switch_status_t switch_ivr_detect_silence | ( | switch_core_session_t * | session, |
uint32_t | thresh, | ||
uint32_t | silence_hits, | ||
uint32_t | timeout_ms, | ||
const char * | file | ||
) |
Definition at line 2368 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, switch_frame::buflen, switch_file_handle::channels, switch_frame::codec, count, switch_frame::data, switch_frame::datalen, switch_codec::implementation, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_frame::samples, switch_codec_implementation::samples_per_packet, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_file_close(), switch_core_file_open, switch_core_file_read(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_set_read_codec(), switch_core_session_write_frame(), SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, SWITCH_IO_FLAG_NONE, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_zmalloc.
switch_status_t switch_ivr_detect_speech | ( | switch_core_session_t * | session, |
const char * | mod_name, | ||
const char * | grammar, | ||
const char * | name, | ||
const char * | dest, | ||
switch_asr_handle_t * | ah | ||
) |
Engage background Speech detection on a session.
session | the session to attach |
mod_name | the module name of the ASR library |
grammar | the grammar text, URI, or local file name |
name | the grammar name |
dest | the destination address |
ah | an ASR handle to use (NULL to create one) |
Definition at line 5461 of file switch_ivr_async.c.
References speech_thread_handle::ah, asr_set_json_text_params(), SWITCH_ASR_FLAG_FIRE_EVENTS, switch_channel_get_private(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_load_grammar(), switch_core_session_get_channel(), switch_ivr_detect_speech_init(), switch_ivr_resume_detect_speech(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), switch_set_flag, SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOT_INITALIZED, SWITCH_STATUS_SUCCESS, and switch_true().
Referenced by CoreSession::detectSpeech(), switch_ivr_play_and_collect_input(), and switch_ivr_play_and_detect_speech().
switch_status_t switch_ivr_detect_speech_disable_all_grammars | ( | switch_core_session_t * | session | ) |
Disable all grammars on a background speech detection handle.
session | The session to change the grammar on |
Definition at line 5359 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_disable_all_grammars(), switch_core_session_get_channel(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
switch_status_t switch_ivr_detect_speech_disable_grammar | ( | switch_core_session_t * | session, |
const char * | name | ||
) |
Disable a grammar on a background speech detection handle.
session | The session to change the grammar on |
name | the grammar name |
Definition at line 5343 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_disable_grammar(), switch_core_session_get_channel(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
switch_status_t switch_ivr_detect_speech_enable_grammar | ( | switch_core_session_t * | session, |
const char * | name | ||
) |
Enable a grammar on a background speech detection handle.
session | The session to change the grammar on |
name | the grammar name |
Definition at line 5327 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_enable_grammar(), switch_core_session_get_channel(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
switch_status_t switch_ivr_detect_speech_init | ( | switch_core_session_t * | session, |
const char * | mod_name, | ||
const char * | dest, | ||
switch_asr_handle_t * | ah | ||
) |
Initialize background Speech detection on a session, so that parameters can be set, and grammars loaded. After calling this function, it is possible to call switch_ivr_set_param_detect_speech() to set recognition parameters. Calling switch_ivr_detect_speech_load_grammar() starts the speech recognition.
session | the session to attach |
mod_name | the module name of the ASR library |
dest | the destination address |
ah | an ASR handle to use (NULL to create one) |
Definition at line 5375 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, speech_thread_handle::ah, speech_thread_handle::bug, switch_ivr_dmachine_binding::key, speech_thread_handle::pool, speech_thread_handle::session, SMBF_NO_PAUSE, SMBF_READ_STREAM, speech_callback(), speech_on_dtmf(), SWITCH_ASR_FLAG_FIRE_EVENTS, SWITCH_ASR_FLAG_NONE, switch_channel_get_private(), switch_channel_get_variable, switch_channel_set_private(), switch_core_asr_close(), switch_core_asr_open(), switch_core_media_bug_add(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_ivr_stop_detect_speech(), switch_set_flag, switch_snprintf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, and switch_true().
Referenced by CoreSession::detectSpeech(), and switch_ivr_detect_speech().
switch_status_t switch_ivr_detect_speech_load_grammar | ( | switch_core_session_t * | session, |
const char * | grammar, | ||
const char * | name | ||
) |
Load a grammar on a background speech detection handle.
session | The session to change the grammar on |
grammar | the grammar text, URI, or local file name |
name | the grammar name |
Definition at line 5270 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_load_grammar(), switch_core_session_get_channel(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
switch_status_t switch_ivr_detect_speech_start_input_timers | ( | switch_core_session_t * | session | ) |
Start input timers on a background speech detection handle.
session | The session to start the timers on |
Definition at line 5299 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), switch_core_asr_start_input_timers(), switch_core_session_get_channel(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech(), switch_ivr_play_and_collect_input(), and switch_ivr_play_and_detect_speech().
switch_status_t switch_ivr_detect_speech_unload_grammar | ( | switch_core_session_t * | session, |
const char * | name | ||
) |
Unload a grammar on a background speech detection handle.
session | The session to change the grammar on |
name | the grammar name |
Definition at line 5311 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), SWITCH_CHANNEL_SESSION_LOG, switch_core_asr_unload_grammar(), switch_core_session_get_channel(), switch_ivr_stop_detect_speech(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
switch_status_t switch_ivr_digit_stream_destroy | ( | switch_ivr_digit_stream_t ** | stream | ) |
Destroys a digit stream object.
stream | a pointer to the stream object |
Definition at line 2447 of file switch_ivr.c.
References switch_safe_free, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_digit_stream_new | ( | switch_ivr_digit_stream_parser_t * | parser, |
switch_ivr_digit_stream_t ** | stream | ||
) |
Create a new digit stream object.
parser | a pointer to the parser object created by switch_ivr_digit_stream_parser_new |
stream | a pointer to the stream object pointer |
Definition at line 2431 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::buflen, memset(), switch_assert, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_zmalloc.
switch_status_t switch_ivr_digit_stream_parser_del_event | ( | switch_ivr_digit_stream_parser_t * | parser, |
char * | digits | ||
) |
Delete a string to action mapping.
parser | a pointer to the parser object created by switch_ivr_digit_stream_parser_new |
digits | the digit string to be removed from the map |
Definition at line 2503 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::hash, SWITCH_CHANNEL_LOG, switch_core_hash_delete(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_digit_stream_parser_destroy | ( | switch_ivr_digit_stream_parser_t * | parser | ) |
Destroy a digit stream parser object.
parser | a pointer to the parser object |
Definition at line 2413 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::hash, switch_ivr_digit_stream_parser::pool, switch_ivr_digit_stream_parser::pool_auto_created, switch_core_destroy_memory_pool, switch_core_hash_destroy(), and SWITCH_STATUS_FALSE.
void* switch_ivr_digit_stream_parser_feed | ( | switch_ivr_digit_stream_parser_t * | parser, |
switch_ivr_digit_stream_t * | stream, | ||
char | digit | ||
) |
Feed digits collected into the stream for event match testing.
parser | a pointer to the parser object created by switch_ivr_digit_stream_parser_new |
stream | a stream to write data to |
digit | a digit to collect and test against the map of digit strings |
Definition at line 2518 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::digit_timeout_ms, switch_ivr_digit_stream::digits, switch_ivr_digit_stream_parser::hash, switch_ivr_digit_stream::last_digit_time, switch_ivr_digit_stream_parser::maxlen, switch_ivr_digit_stream_parser::minlen, switch_assert, switch_core_hash_find(), switch_micro_time_now(), and switch_ivr_digit_stream_parser::terminator.
switch_status_t switch_ivr_digit_stream_parser_new | ( | switch_memory_pool_t * | pool, |
switch_ivr_digit_stream_parser_t ** | parser | ||
) |
Create a digit stream parser object.
pool | the pool to use for the new hash |
parser | a pointer to the object pointer |
Definition at line 2373 of file switch_ivr.c.
References memset(), switch_ivr_digit_stream_parser::pool, switch_ivr_digit_stream_parser::pool_auto_created, SWITCH_CHANNEL_LOG, switch_core_alloc, switch_core_destroy_memory_pool, switch_core_hash_init, switch_core_new_memory_pool, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_digit_stream_parser_set_event | ( | switch_ivr_digit_stream_parser_t * | parser, |
char * | digits, | ||
void * | data | ||
) |
Set a digit string to action mapping.
parser | a pointer to the parser object created by switch_ivr_digit_stream_parser_new |
digits | a string of digits to associate with an action |
data | consumer data attached to this digit string |
Definition at line 2461 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::buflen, switch_ivr_digit_stream_parser::hash, switch_ivr_digit_stream_parser::maxlen, switch_ivr_digit_stream_parser::minlen, SWITCH_CHANNEL_LOG, switch_core_hash_insert, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_ivr_digit_stream_parser::terminator.
switch_status_t switch_ivr_digit_stream_parser_set_terminator | ( | switch_ivr_digit_stream_parser_t * | parser, |
char | digit | ||
) |
Set a digit string terminator.
parser | a pointer to the parser object created by switch_ivr_digit_stream_parser_new |
digit | the terminator digit |
Definition at line 2584 of file switch_ivr.c.
References switch_ivr_digit_stream_parser::maxlen, switch_ivr_digit_stream_parser::minlen, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_ivr_digit_stream_parser::terminator.
switch_status_t switch_ivr_digit_stream_reset | ( | switch_ivr_digit_stream_t * | stream | ) |
Reset the collected digit stream to nothing.
stream | a pointer to the parser stream object created by switch_ivr_digit_stream_new |
Definition at line 2571 of file switch_ivr.c.
References switch_ivr_digit_stream::digits, switch_ivr_digit_stream::last_digit_time, switch_assert, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_displace_session | ( | switch_core_session_t * | session, |
const char * | file, | ||
uint32_t | limit, | ||
const char * | flags | ||
) |
displace the media for a session with the audio from a file
session | the session to displace |
file | filename |
limit | time limit in ms |
flags | m (mux) l (loop) or r(read session instead of write session) |
Definition at line 1001 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, switch_directories::base_dir, switch_file_handle::channels, displace_helper_t::fh, displace_helper_t::file, switch_codec_implementation::iananame, displace_helper_t::loop, displace_helper_t::mutex, displace_helper_t::mux, switch_codec_implementation::number_of_channels, read_displace_callback(), switch_file_handle::samplerate, SMBF_FIRST, SMBF_NO_PAUSE, SMBF_READ_REPLACE, SMBF_WRITE_REPLACE, switch_buffer_create_dynamic(), SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_get_private(), switch_channel_get_variable, switch_channel_hangup, switch_channel_media_up, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_core_file_close(), switch_core_file_open, switch_core_media_bug_add(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_codec(), switch_core_session_get_read_impl(), switch_core_session_reset(), switch_core_session_sprintf(), switch_core_session_strdup, switch_epoch_time_now(), SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, switch_find_end_paren(), SWITCH_GLOBAL_dirs, switch_is_file_path(), SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_init(), SWITCH_MUTEX_NESTED, SWITCH_PATH_SEPARATOR, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_str_nil, SWITCH_TRUE, switch_true(), SWITCH_URL_SEPARATOR, to, displace_helper_t::wbuffer, write_displace_callback(), and zstr.
switch_status_t switch_ivr_eavesdrop_exec_all | ( | switch_core_session_t * | session, |
const char * | app, | ||
const char * | arg | ||
) |
Definition at line 2232 of file switch_ivr_async.c.
References exec_cb_data::caller, exec_cb(), switch_core_media_bug_exec_all(), switch_core_session_alloc, switch_core_session_strdup, exec_cb_data::val, and exec_cb_data::var.
switch_status_t switch_ivr_eavesdrop_pop_eavesdropper | ( | switch_core_session_t * | session, |
switch_core_session_t ** | sessionp | ||
) |
Definition at line 2172 of file switch_ivr_async.c.
References eavesdrop_pvt::eavesdropper, SMBF_PRUNE, switch_core_media_bug_get_user_data(), switch_core_media_bug_pop(), switch_core_media_bug_set_flag(), switch_core_session_read_lock(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_eavesdrop_session | ( | switch_core_session_t * | session, |
const char * | uuid, | ||
const char * | require_group, | ||
switch_eavesdrop_flag_t | flags | ||
) |
Eavesdrop on a another session.
session | our session |
uuid | the uuid of the session to spy on |
require_group | group name to use to limit by group |
flags | tweak read-mux, write-mux and dtmf |
Definition at line 2285 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, buf, eavesdrop_pvt::buffer, switch_frame::buflen, switch_caller_profile::callee_id_name, switch_caller_profile::callee_id_number, switch_caller_profile::caller_id_name, switch_caller_profile::caller_id_number, CF_BRIDGE_ORIGINATOR, CF_BRIDGED, CF_VIDEO, switch_core_session::channel, switch_frame::channels, switch_frame::codec, switch_frame::data, eavesdrop_pvt::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, eavesdrop_callback(), eavesdrop_pvt::eavesdropper, ED_BRIDGE_READ, ED_BRIDGE_WRITE, ED_COPY_DISPLAY, ED_DTMF, ED_MUX_READ, ED_MUX_WRITE, ED_STEREO, ED_TAP_READ, ED_TAP_WRITE, eavesdrop_pvt::flags, switch_core_session_message::from, switch_codec_implementation::iananame, switch_codec::implementation, switch_core_session_message::message_id, switch_codec_implementation::microseconds_per_packet, eavesdrop_pvt::mutex, name, switch_codec_implementation::number_of_channels, eavesdrop_pvt::r_buffer, eavesdrop_pvt::r_mutex, switch_frame::rate, eavesdrop_pvt::read_impl, switch_frame::samples, SFF_CNG, SMBF_NO_PAUSE, SMBF_READ_PING, SMBF_READ_REPLACE, SMBF_READ_STREAM, SMBF_READ_VIDEO_PING, SMBF_READ_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM, SMBF_SPY_VIDEO_STREAM_BLEG, SMBF_STEREO, SMBF_TAP_NATIVE_READ, SMBF_TAP_NATIVE_WRITE, SMBF_THREAD_LOCK, SMBF_WRITE_REPLACE, SMBF_WRITE_STREAM, SMBF_WRITE_VIDEO_STREAM, switch_core_session_message::string_arg, switch_buffer_add_mutex(), switch_buffer_create_dynamic(), switch_buffer_destroy(), switch_buffer_inuse(), switch_buffer_lock(), switch_buffer_read(), switch_buffer_unlock(), switch_buffer_zero(), switch_buffer_zwrite(), switch_channel_dequeue_dtmf(), switch_channel_get_caller_profile(), switch_channel_get_variable, switch_channel_has_dtmf(), switch_channel_media_ack, switch_channel_media_up, switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_state_change_pending(), switch_channel_test_flag(), switch_channel_up, switch_channel_up_nosig, switch_clear_flag, SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_media_bug_add(), switch_core_media_bug_clear_flag(), switch_core_media_bug_remove(), switch_core_media_bug_set_flag(), switch_core_media_bug_test_flag(), switch_core_session_alloc, switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_get_real_read_impl(), switch_core_session_locate, switch_core_session_read_frame(), switch_core_session_receive_message, switch_core_session_request_video_refresh, switch_core_session_reset(), switch_core_session_rwunlock(), switch_core_session_set_read_codec(), switch_core_session_strdup, switch_core_session_write_frame(), switch_event_destroy(), switch_event_get_header, SWITCH_FALSE, switch_goto_status, SWITCH_IO_FLAG_NONE, switch_ivr_phrase_macro, switch_lcm(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_media_bug_parse_spy_fmt(), switch_media_bug_set_spy_fmt(), SWITCH_MESSAGE_INDICATE_BRIDGE, SWITCH_MESSAGE_INDICATE_DISPLAY, SWITCH_MESSAGE_INDICATE_UNBRIDGE, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, switch_mutex_init(), SWITCH_MUTEX_NESTED, switch_mux_channels(), SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, switch_separate_string(), switch_set_flag, switch_snprintf(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, switch_true(), switch_yield, eavesdrop_pvt::tread_impl, eavesdrop_pvt::w_buffer, eavesdrop_pvt::w_mutex, and zstr.
switch_status_t switch_ivr_eavesdrop_update_display | ( | switch_core_session_t * | session, |
const char * | name, | ||
const char * | number | ||
) |
Definition at line 2245 of file switch_ivr_async.c.
References exec_cb_data::caller, display_exec_cb(), switch_channel_clear_app_flag_key(), switch_channel_set_app_flag_key(), switch_channel_test_app_flag_key(), switch_core_media_bug_exec_all(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_strdup, SWITCH_STATUS_FALSE, exec_cb_data::val, and exec_cb_data::var.
switch_status_t switch_ivr_enterprise_originate | ( | switch_core_session_t * | session, |
switch_core_session_t ** | bleg, | ||
switch_call_cause_t * | cause, | ||
const char * | bridgeto, | ||
uint32_t | timelimit_sec, | ||
const switch_state_handler_table_t * | table, | ||
const char * | cid_name_override, | ||
const char * | cid_num_override, | ||
switch_caller_profile_t * | caller_profile_override, | ||
switch_event_t * | ovars, | ||
switch_originate_flag_t | flags, | ||
switch_call_cause_t * | cancel_cause, | ||
switch_dial_handle_list_t * | hl | ||
) |
Definition at line 1567 of file switch_ivr_originate.c.
References enterprise_originate_handle_t::bleg, enterprise_originate_handle_t::cause, CF_ANSWERED, CF_NOT_READY, CF_PROXY_MEDIA, CF_PROXY_MODE, enterprise_originate_handle_t::dh, enterprise_originate_ringback_thread(), enterprise_originate_thread(), switch_dial_handle_list_s::global_vars, switch_dial_handle_list_s::handle_idx, switch_dial_handle_list_s::handles, switch_event::headers, MAX_PEERS, mutex, enterprise_originate_handle_t::mutex, switch_event_header::name, switch_event_header::next, enterprise_originate_handle_t::ovars, pool, ent_originate_ringback::ringback_data, running, ent_originate_ringback::running, ent_originate_ringback::session, enterprise_originate_handle_t::status, switch_caller_profile_clone(), switch_caller_profile_dup(), SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, SWITCH_CAUSE_LOSE_RACE, SWITCH_CAUSE_NO_ANSWER, SWITCH_CAUSE_NO_PICKUP, SWITCH_CAUSE_ORIGINATOR_CANCEL, SWITCH_CAUSE_SUCCESS, switch_channel_cause2str(), switch_channel_clear_flag(), switch_channel_get_caller_profile(), switch_channel_get_variable, switch_channel_handle_cause(), switch_channel_media_ready, switch_channel_pre_answer, switch_channel_process_export(), switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_originatee_caller_profile(), switch_channel_set_originator_caller_profile(), switch_channel_set_variable, switch_channel_test_flag(), switch_core_destroy_memory_pool, switch_core_new_memory_pool, switch_core_session_get_channel(), switch_core_session_get_uuid(), switch_core_strdup, switch_dial_handle_destroy(), switch_dial_handle_dup(), SWITCH_ENT_ORIGINATE_DELIM, switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_DATA, switch_event_create_brackets(), switch_event_create_plain(), switch_event_destroy(), switch_event_dup(), switch_event_merge(), SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE, switch_goto_status, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), switch_separate_string_string(), SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_thread_create(), switch_thread_join(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), switch_yield, thread, enterprise_originate_handle_t::thread, ent_originate_ringback::thread, switch_event_header::value, and zstr.
Referenced by switch_ivr_enterprise_orig_and_bridge(), and switch_ivr_originate().
switch_status_t switch_ivr_generate_json_cdr | ( | switch_core_session_t * | session, |
cJSON ** | json_cdr, | ||
switch_bool_t | urlencode | ||
) |
Generate an JSON CDR report.
session | the session to get the data from. |
json_cdr | pointer to the json object |
Definition at line 3335 of file switch_ivr.c.
References switch_channel_timetable::answered, switch_app_log::app, switch_caller_application::application_data, switch_caller_application::application_name, switch_caller_extension::applications, switch_app_log::arg, switch_channel_timetable::bridged, switch_caller_profile::caller_extension, switch_caller_extension::children, switch_channel_timetable::created, switch_caller_extension::current_application, switch_caller_profile::dialplan, switch_caller_extension::extension_name, switch_caller_extension::extension_number, switch_channel_timetable::hold_accum, switch_channel_timetable::hungup, switch_channel_timetable::last_hold, switch_app_log::next, switch_caller_profile::next, switch_caller_application::next, switch_caller_profile::originatee_caller_profile, switch_caller_profile::originator_caller_profile, switch_channel_timetable::profile_created, switch_caller_profile::profile_index, switch_channel_timetable::progress, switch_channel_timetable::progress_media, switch_channel_timetable::resurrected, switch_app_log::stamp, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), switch_channel_get_caller_profile(), switch_channel_get_cap_string(), switch_channel_get_flag_string(), switch_channel_get_state(), switch_channel_state_name(), switch_core_get_switchname(), switch_core_get_uuid(), switch_core_session_get_app_log(), switch_core_session_get_channel(), switch_ivr_set_json_call_stats(), switch_ivr_set_json_chan_vars(), switch_ivr_set_json_profile_data(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_snprintf(), SWITCH_STATUS_SUCCESS, switch_str_nil, SWITCH_TIME_T_FMT, switch_caller_profile::times, switch_channel_timetable::transferred, and zstr.
Referenced by switch_ivr_multi_threaded_bridge(), and switch_ivr_originate().
switch_status_t switch_ivr_generate_xml_cdr | ( | switch_core_session_t * | session, |
switch_xml_t * | xml_cdr | ||
) |
Generate an XML CDR report.
session | the session to get the data from. |
xml_cdr | pointer to the xml_record |
Definition at line 2862 of file switch_ivr.c.
References switch_channel_timetable::answered, switch_app_log::app, switch_caller_application::application_data, switch_caller_application::application_name, switch_caller_extension::applications, switch_app_log::arg, switch_channel_timetable::bridged, switch_caller_profile::caller_extension, switch_caller_extension::children, switch_caller_profile::clone_of, switch_channel_timetable::created, switch_caller_extension::current_application, switch_caller_profile::dialplan, switch_caller_extension::extension_name, switch_caller_extension::extension_number, switch_channel_timetable::hold_accum, switch_channel_timetable::hungup, switch_channel_timetable::last_hold, switch_app_log::next, switch_hold_record_s::next, switch_caller_profile::next, switch_caller_application::next, switch_caller_profile::originatee_caller_profile, switch_caller_profile::origination_caller_profile, switch_caller_profile::originator_caller_profile, switch_channel_timetable::profile_created, switch_caller_profile::profile_index, switch_channel_timetable::progress, switch_channel_timetable::progress_media, switch_channel_timetable::resurrected, switch_app_log::stamp, SWITCH_CALL_DIRECTION_OUTBOUND, switch_channel_direction(), switch_channel_get_caller_profile(), switch_channel_get_cap_string(), switch_channel_get_flag_string(), switch_channel_get_hold_record(), switch_channel_get_state(), switch_channel_state_name(), switch_core_get_switchname(), switch_core_get_uuid(), switch_core_session_get_app_log(), switch_core_session_get_channel(), switch_core_session_get_text_buffer(), switch_ivr_set_xml_call_stats(), switch_ivr_set_xml_chan_vars(), switch_ivr_set_xml_profile_data(), SWITCH_MEDIA_TYPE_AUDIO, SWITCH_MEDIA_TYPE_VIDEO, switch_snprintf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_TIME_T_FMT, switch_xml_add_child_d(), switch_xml_free(), switch_xml_new(), switch_xml_set_attr_d(), switch_xml_set_attr_d_buf(), switch_xml_set_txt_d(), switch_caller_profile::times, switch_channel_timetable::transferred, switch_caller_profile::uuid_str, and zstr.
Referenced by CoreSession::getXMLCDR(), process_device_hup(), switch_core_recovery_track(), switch_core_session_reporting_state(), switch_ivr_multi_threaded_bridge(), and switch_ivr_originate().
switch_status_t switch_ivr_gentones | ( | switch_core_session_t * | session, |
const char * | script, | ||
int32_t | loops, | ||
switch_input_args_t * | args | ||
) |
Definition at line 1073 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_frame::buflen, switch_input_args_t::buflen, CF_BREAK, teletone_generation_session::channels, switch_frame::codec, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_input_args_t::input_callback, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, teletone_generation_session::rate, switch_input_args_t::read_frame_callback, switch_frame::samples, switch_buffer_create_dynamic(), switch_buffer_destroy(), switch_buffer_read_loop(), switch_buffer_set_loops(), switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_has_dtmf(), switch_channel_pre_answer, switch_channel_ready, switch_channel_test_flag(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_write_frame(), switch_event_destroy(), SWITCH_FALSE, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, teletone_destroy_session(), teletone_handler(), teletone_init_session(), teletone_run(), and switch_input_args_t::user_data.
Referenced by enterprise_originate_ringback_thread().
switch_status_t switch_ivr_hold | ( | switch_core_session_t * | session, |
const char * | message, | ||
switch_bool_t | moh | ||
) |
Signal the session with a protocol specific hold message.
session | the session to hold |
message | optional message |
moh | play music-on-hold |
Definition at line 1525 of file switch_ivr.c.
References CCS_HELD, CF_HOLD, CF_SUSPEND, switch_core_session_message::from, switch_core_session_message::message_id, SMF_ECHO_ALEG, SMF_LOOP, switch_core_session_message::string_arg, switch_channel_event_set_data(), switch_channel_get_callstate(), switch_channel_get_hold_music(), switch_channel_get_partner_uuid(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_core_session_get_channel(), switch_core_session_receive_message, SWITCH_EVENT_CHANNEL_HOLD, switch_event_create, switch_event_fire, switch_ivr_broadcast(), switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MESSAGE_INDICATE_HOLD, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_hold_toggle_uuid(), and switch_ivr_hold_uuid().
switch_status_t switch_ivr_hold_toggle_uuid | ( | const char * | uuid, |
const char * | message, | ||
switch_bool_t | moh | ||
) |
Toggles channel hold state of session.
uuid | the uuid of the session to hold |
message | optional message |
moh | play music-on-hold |
Definition at line 1580 of file switch_ivr.c.
References CCS_ACTIVE, CCS_HELD, CCS_UNHELD, switch_channel_get_callstate(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_rwunlock(), switch_ivr_hold(), switch_ivr_unhold(), and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_hold_uuid | ( | const char * | uuid, |
const char * | message, | ||
switch_bool_t | moh | ||
) |
Signal the session with a protocol specific hold message.
uuid | the uuid of the session to hold |
message | optional message |
moh | play music-on-hold |
Definition at line 1567 of file switch_ivr.c.
References switch_core_session_locate, switch_core_session_rwunlock(), switch_ivr_hold(), and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_toggle_hold().
switch_status_t switch_ivr_inband_dtmf_generate_session | ( | switch_core_session_t * | session, |
switch_bool_t | read_stream | ||
) |
Start generating DTMF inband.
session | the session to generate on |
read_stream | true to use the session we are reading from, false for the session we are writing to. |
Definition at line 4090 of file switch_ivr_async.c.
References inband_dtmf_generate_callback(), switch_inband_dtmf_generate_t::read, switch_inband_dtmf_generate_t::session, SMBF_NO_PAUSE, SMBF_READ_REPLACE, SMBF_WRITE_REPLACE, switch_channel_media_up, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_core_media_bug_add(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_read_codec(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_inband_dtmf_session | ( | switch_core_session_t * | session | ) |
Start looking for DTMF inband.
session | the session to start looking |
Definition at line 3854 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, switch_inband_dtmf_t::dtmf_detect, inband_dtmf_callback(), switch_inband_dtmf_t::session, SMBF_NO_PAUSE, SMBF_ONE_ONLY, SMBF_READ_REPLACE, switch_channel_pre_answer, switch_channel_set_private(), switch_core_media_bug_add(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_read_impl(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, and teletone_dtmf_detect_init().
switch_status_t switch_ivr_media | ( | const char * | uuid, |
switch_media_flag_t | flags | ||
) |
Signal a session to request direct media access to it's remote end.
uuid | the uuid of the session to request |
flags | flags to influence behaviour (SMF_REBRIDGE to rebridge the call in media mode) |
Definition at line 1773 of file switch_ivr.c.
References CF_BRIDGE_ORIGINATOR, CF_BRIDGED, CF_EARLY_MEDIA, CF_MEDIA_ACK, CF_MEDIA_SET, CF_MEDIA_TRANS, CF_PROXY_MODE, CF_REQ_MEDIA, switch_core_session_message::from, switch_core_session_message::message_id, switch_core_session_message::numeric_arg, SMF_IMMEDIATE, SMF_REBRIDGE, SMF_REPLYONLY_A, SMF_REPLYONLY_B, switch_assert, switch_channel_clear_flag(), switch_channel_clear_state_handler(), switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_read_frame(), switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_FALSE, SWITCH_IO_FLAG_NONE, switch_ivr_uuid_bridge(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS, SWITCH_MESSAGE_INDICATE_MEDIA, SWITCH_SIGNAL_BRIDGE_VARIABLE, SWITCH_STATUS_GENERR, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_yield.
Referenced by cleanup_proxy_mode_b(), media_thread_run(), switch_core_session_execute_application_get_flags(), switch_core_standard_on_routing(), switch_ivr_broadcast(), switch_ivr_originate(), and switch_ivr_session_transfer().
switch_status_t switch_ivr_multi_threaded_bridge | ( | _In_ switch_core_session_t * | session, |
_In_ switch_core_session_t * | peer_session, | ||
switch_input_callback_function_t | dtmf_callback, | ||
void * | session_data, | ||
void * | peer_session_data | ||
) |
Bridge Audio from one session to another.
session | one session |
peer_session | the other session |
dtmf_callback | a callback for messages and dtmf |
session_data | data to pass to the DTMF callback for session |
peer_session_data | data to pass to the DTMF callback for peer_session |
Referenced by bridge(), fs_switch_ivr_originate(), switch_ivr_enterprise_orig_and_bridge(), and switch_ivr_orig_and_bridge().
switch_status_t switch_ivr_nomedia | ( | const char * | uuid, |
switch_media_flag_t | flags | ||
) |
Signal a session to request indirect media allowing it to exchange media directly with another device.
uuid | the uuid of the session to request |
flags | flags to influence behaviour (SMF_REBRIDGE to rebridge the call in no_media mode) |
Definition at line 1987 of file switch_ivr.c.
References CF_BRIDGE_ORIGINATOR, CF_MEDIA_ACK, CF_MEDIA_SET, CF_MEDIA_TRANS, CF_PROXY_MODE, CF_REDIRECT, CF_REQ_MEDIA, CF_RESET, CF_SECURE, CS_HIBERNATE, CS_PARK, switch_core_session_message::from, switch_core_session_message::message_id, SMF_FORCE, SMF_REBRIDGE, SWITCH_BRIDGE_VARIABLE, switch_channel_clear_flag(), switch_channel_get_name(), switch_channel_get_variable, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_state, switch_channel_test_flag(), switch_channel_wait_for_flag(), switch_channel_wait_for_state(), switch_core_session_get_channel(), switch_core_session_in_thread(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_FALSE, switch_ivr_signal_bridge(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MESSAGE_INDICATE_NOMEDIA, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_INUSE, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_yield.
Referenced by audio_bridge_thread(), media_thread_run(), and switch_ivr_parse_event().
switch_status_t switch_ivr_originate | ( | switch_core_session_t * | session, |
switch_core_session_t ** | bleg, | ||
switch_call_cause_t * | cause, | ||
const char * | bridgeto, | ||
uint32_t | timelimit_sec, | ||
const switch_state_handler_table_t * | table, | ||
const char * | cid_name_override, | ||
const char * | cid_num_override, | ||
switch_caller_profile_t * | caller_profile_override, | ||
switch_event_t * | ovars, | ||
switch_originate_flag_t | flags, | ||
switch_call_cause_t * | cancel_cause, | ||
switch_dial_handle_t * | dh | ||
) |
Make an outgoing call.
session | originating session |
bleg | B leg session |
cause | a pointer to hold call cause |
bridgeto | the desired remote callstring |
timelimit_sec | timeout in seconds for outgoing call |
table | optional state handler table to install on the channel |
cid_name_override | override the caller id name |
cid_num_override | override the caller id number |
caller_profile_override | override the entire calling caller profile |
ovars | variables to be set on the outgoing channel |
flags | flags to pass |
switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE) &&
Definition at line 2064 of file switch_ivr_originate.c.
References switch_caller_profile::ani, switch_caller_profile::aniii, ringback::asis, ringback::audio_buffer, originate_global_t::bridge_early_media, buf, early_state::buffer, switch_frame::buflen, buflen, switch_caller_profile::callee_id_name, switch_caller_profile::callee_id_number, switch_caller_profile::caller_id_name, switch_caller_profile::caller_id_number, originate_status_t::caller_profile, originate_global_t::caller_profile_override, originate_global_t::cancel_timeout, CF_ANSWERED, CF_BLOCK_STATE, CF_BRIDGED, CF_CONSUME_ON_ORIGINATE, CF_DISABLE_RINGBACK, CF_EARLY_MEDIA, CF_INTERCEPT, CF_INTERCEPTED, CF_LAZY_ATTENDED_TRANSFER, CF_NO_PRESENCE, CF_ORIGINATING, CF_ORIGINATOR, CF_PROXY_MEDIA, CF_PROXY_MODE, CF_REDIRECT, CF_RING_READY, CF_TIMESTAMP_SET, CF_TRANSFER, CF_XFER_ZOMBIE, switch_caller_profile::chan_name, switch_file_handle::channels, check_channel_status(), check_per_channel_timeouts(), originate_global_t::check_vars, switch_frame::codec, originate_global_t::confirm_read_timeout, originate_global_t::confirm_timeout, originate_global_t::continue_on_timeout, CS_HANGUP, CS_REPORTING, CS_RESET, CS_ROUTING, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_caller_profile::destination_number, switch_dtmf_t::digit, originate_status_t::down_session, originate_global_t::early_ok, early_thread_run(), switch_codec_implementation::encoded_bytes_per_packet, originate_global_t::error_file, originate_global_t::ethread, ringback::fh, originate_global_t::file, switch_caller_profile::flags, switch_core_session_message::from, switch_event::headers, originate_global_t::hups, originate_global_t::idx, IDX_CANCEL, IDX_KEY_CANCEL, IDX_NADA, IDX_TIMEOUT, IDX_XFER, originate_global_t::ignore_early_media, originate_global_t::ignore_ring_ready, switch_codec::implementation, originate_global_t::instant_ringback, originate_global_t::key, MAX_PEERS, memset(), switch_core_session_message::message_id, originate_global_t::monitor_early_media_fail, originate_global_t::monitor_early_media_ring, early_state::mutex, ringback::mux_buf, switch_event_header::name, switch_event_header::next, switch_codec_implementation::number_of_channels, early_state::oglobals, originate_global_t::originate_status, originate_status_t::peer_channel, peer_eligible, originate_status_t::peer_session, originate_status_t::per_channel_delay_start, originate_status_t::per_channel_progress_timelimit_sec, originate_status_t::per_channel_timelimit_sec, switch_caller_profile::pool, originate_global_t::pool, originate_global_t::progress, QUOTED_ESC_COMMA, early_state::ready, originate_global_t::return_ring_ready, originate_global_t::ring_ready, early_state::ringback, originate_global_t::ringback_ok, switch_frame::samples, switch_codec_implementation::samples_per_packet, originate_global_t::sending_ringback, originate_global_t::sent_ring, originate_global_t::session, setup_ringback(), ringback::silence, SMF_NONE, SOF_FORKED_DIAL, SOF_NO_EFFECTIVE_ANI, SOF_NO_EFFECTIVE_ANIII, SOF_NO_EFFECTIVE_CID_NAME, SOF_NO_EFFECTIVE_CID_NUM, SOF_NO_LIMITS, SOF_NOBLOCK, SOF_NONE, switch_file_handle::speed, switch_assert, SWITCH_B_SDP_VARIABLE, SWITCH_BLANK_STRING, switch_buffer_create_dynamic(), switch_buffer_destroy(), switch_buffer_inuse(), switch_buffer_peek(), switch_buffer_read(), switch_buffer_read_loop(), switch_buffer_toss(), SWITCH_BYPASS_MEDIA_VARIABLE, SWITCH_CALL_TIMEOUT_VARIABLE, switch_caller_profile_clone(), switch_caller_profile_dup(), switch_caller_profile_new(), SWITCH_CAUSE_ATTENDED_TRANSFER, SWITCH_CAUSE_CALL_REJECTED, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION, SWITCH_CAUSE_INVALID_PROFILE, SWITCH_CAUSE_LOSE_RACE, SWITCH_CAUSE_NO_ANSWER, SWITCH_CAUSE_NONE, SWITCH_CAUSE_NORMAL_UNSPECIFIED, SWITCH_CAUSE_ORIGINATOR_CANCEL, SWITCH_CAUSE_PICKED_OFF, SWITCH_CAUSE_PROGRESS_TIMEOUT, SWITCH_CAUSE_SUCCESS, SWITCH_CAUSE_USER_BUSY, switch_channel_add_state_handler(), switch_channel_add_variable_var_check(), switch_channel_answer, switch_channel_api_on(), SWITCH_CHANNEL_API_ON_ORIGINATE_VARIABLE, SWITCH_CHANNEL_API_ON_POST_ORIGINATE_VARIABLE, SWITCH_CHANNEL_API_ON_PRE_ORIGINATE_VARIABLE, switch_channel_audio_sync, switch_channel_caller_extension_masquerade(), switch_channel_cause2str(), SWITCH_CHANNEL_CHANNEL_LOG, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_down_nosig, switch_channel_execute_on(), SWITCH_CHANNEL_EXECUTE_ON_ORIGINATE_VARIABLE, SWITCH_CHANNEL_EXECUTE_ON_POST_ORIGINATE_VARIABLE, SWITCH_CHANNEL_EXECUTE_ON_PRE_ORIGINATE_VARIABLE, switch_channel_get_caller_profile(), switch_channel_get_cause(), switch_channel_get_name(), switch_channel_get_state(), switch_channel_get_uuid(), switch_channel_get_variable, switch_channel_hangup, switch_channel_has_dtmf(), switch_channel_media_ready, switch_channel_media_up, switch_channel_pass_callee_id(), switch_channel_pre_answer, switch_channel_process_export(), switch_channel_ready, switch_channel_restart(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_name(), switch_channel_set_originatee_caller_profile(), switch_channel_set_private(), switch_channel_set_profile_var(), switch_channel_set_timestamps(), switch_channel_set_variable, switch_channel_set_variable_var_check(), switch_channel_state_change_pending(), switch_channel_test_flag(), switch_channel_up, switch_channel_up_nosig, switch_channel_var_true(), switch_channel_variable_first(), switch_channel_variable_last(), switch_channel_wait_for_state_timeout(), switch_cond_next(), switch_copy_string(), switch_core_codec_destroy(), switch_core_codec_ready(), switch_core_destroy_memory_pool, switch_core_file_close(), switch_core_file_read(), switch_core_file_seek(), switch_core_get_variable(), switch_core_new_memory_pool, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_get_uuid(), switch_core_session_locate, switch_core_session_outgoing_channel(), switch_core_session_read_frame(), switch_core_session_read_lock(), switch_core_session_receive_message, switch_core_session_reset(), switch_core_session_running(), switch_core_session_rwunlock(), switch_core_session_sprintf(), switch_core_session_thread_launch(), switch_core_session_write_frame(), switch_core_strdup, SWITCH_CPF_HIDE_NAME, SWITCH_CPF_HIDE_NUMBER, SWITCH_CPF_NONE, SWITCH_CPF_SCREEN, SWITCH_DEFAULT_CLID_NAME, SWITCH_DEFAULT_CLID_NUMBER, SWITCH_DEFAULT_TIMEOUT, switch_dial_handle_get_global_vars(), switch_dial_handle_get_peers(), switch_dial_handle_get_total(), switch_dial_handle_get_vars(), SWITCH_ENT_ORIGINATE_DELIM, switch_epoch_time_now(), switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_DATA, switch_event_create_brackets(), switch_event_create_plain(), switch_event_del_header, switch_event_destroy(), switch_event_dup(), switch_event_get_header, switch_event_merge(), switch_event_serialize(), SWITCH_EXPORT_VARS_VARIABLE, SWITCH_FALSE, switch_false(), switch_find_end_paren(), switch_generate_sln_silence(), switch_goto_status, SWITCH_HANGUP_AFTER_BRIDGE_VARIABLE, SWITCH_HOLDING_UUID_VARIABLE, SWITCH_INT64_T_FMT, SWITCH_IO_FLAG_NONE, switch_is_number(), switch_ivr_enterprise_originate(), switch_ivr_generate_json_cdr(), switch_ivr_generate_xml_cdr(), switch_ivr_media(), switch_ivr_parse_all_events(), switch_ivr_session_transfer(), switch_ivr_sleep(), switch_ivr_stop_tone_detect_session(), switch_ivr_transfer_recordings(), switch_ivr_uuid_bridge(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, SWITCH_LOG_INFO, SWITCH_LOG_NOTICE, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS, switch_micro_time_now(), switch_mutex_init(), switch_mutex_lock(), SWITCH_MUTEX_NESTED, switch_mutex_unlock(), SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE, switch_process_import(), SWITCH_PROXY_MEDIA_VARIABLE, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, switch_sanitize_number(), switch_separate_string(), switch_set_flag, SWITCH_SIGNAL_BOND_VARIABLE, switch_snprintf(), SWITCH_SOFT_HOLDING_UUID_VARIABLE, SWITCH_STACK_BOTTOM, SWITCH_STACK_PUSH, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_stristr(), switch_thread_create(), switch_thread_join(), SWITCH_THREAD_STACKSIZE, switch_threadattr_create(), switch_threadattr_stacksize_set(), SWITCH_TRUE, switch_true(), switch_xml_free(), switch_xml_toxml, switch_yield, switch_zmalloc, originate_status_t::tagged, teletone_destroy_session(), to, ringback::ts, early_state::ttl, UNQUOTED_ESC_COMMA, switch_caller_profile::uuid, switch_event_header::value, wait_for_cause(), and zstr.
Referenced by CoreSession::CoreSession(), enterprise_originate_thread(), fs_switch_ivr_originate(), CoreSession::originate(), and switch_ivr_orig_and_bridge().
switch_status_t switch_ivr_park | ( | switch_core_session_t * | session, |
switch_input_args_t * | args | ||
) |
Definition at line 946 of file switch_ivr.c.
References switch_codec_implementation::actual_samples_per_second, arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_frame::buflen, switch_input_args_t::buflen, CF_CONTROLLED, CF_PARK, CF_RECOVERED, CF_SERVICE, CF_UNICAST, switch_frame::codec, CS_RESET, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_input_args_t::input_callback, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_unicast_conninfo::read_codec, switch_unicast_conninfo::remote_addr, switch_frame::samples, switch_codec_implementation::samples_per_second, SFF_CNG, switch_unicast_conninfo::socket, SUF_NATIVE, switch_assert, SWITCH_CAUSE_NORMAL_CLEARING, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_event_set_data(), switch_channel_get_private(), switch_channel_get_state(), switch_channel_get_variable, switch_channel_hangup, switch_channel_has_dtmf(), switch_channel_media_ready, switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_variable, switch_channel_str2cause(), switch_channel_test_flag(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_cond_next(), switch_core_codec_decode(), switch_core_codec_destroy(), switch_core_codec_init, switch_core_session_dequeue_event(), switch_core_session_dequeue_private_event(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_codec(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_write_frame(), switch_epoch_time_now(), SWITCH_EVENT_CHANNEL_PARK, SWITCH_EVENT_CHANNEL_UNPARK, switch_event_create, switch_event_destroy(), switch_event_fire, SWITCH_FALSE, switch_generate_sln_silence(), switch_goto_status, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_deactivate_unicast(), switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), switch_ivr_parse_event(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, SWITCH_LOG_NOTICE, switch_log_printf(), SWITCH_PARK_AFTER_BRIDGE_VARIABLE, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE, switch_socket_sendto(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOOP, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_yield, switch_zmalloc, to, and unicast_thread_launch().
Referenced by switch_core_standard_on_park().
switch_status_t switch_ivr_parse_all_events | ( | switch_core_session_t * | session | ) |
Parse all commands from an event.
session | the session on which to parse the events |
Definition at line 913 of file switch_ivr.c.
References CF_BLOCK_BROADCAST_UNTIL_MEDIA, CF_PROXY_MODE, switch_channel_clear_flag(), switch_channel_media_up, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_get_name, switch_core_session_stack_count(), switch_ivr_parse_all_messages(), switch_ivr_parse_next_event(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_MAX_STACKS, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by check_channel_status(), switch_core_session_run(), switch_ivr_collect_digits_callback(), switch_ivr_collect_digits_count(), switch_ivr_gentones(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_ivr_park(), switch_ivr_play_file(), switch_ivr_record_file_event(), switch_ivr_session_echo(), switch_ivr_sleep(), switch_ivr_speak_text_handle(), and switch_ivr_wait_for_answer().
switch_status_t switch_ivr_parse_all_messages | ( | switch_core_session_t * | session | ) |
Definition at line 847 of file switch_ivr.c.
References switch_core_session_dequeue_message(), switch_core_session_free_message(), switch_core_session_receive_message, switch_ivr_parse_all_signal_data(), switch_ivr_process_indications(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by audio_bridge_thread(), enterprise_originate_ringback_thread(), originate_on_consume_media_transmit(), read_rtp_packet(), signal_bridge_on_hibernate(), switch_core_session_run(), switch_ivr_multi_threaded_bridge(), switch_ivr_parse_all_events(), switch_ivr_play_file(), switch_ivr_speak_text_handle(), and switch_ivr_wait_for_answer().
switch_status_t switch_ivr_parse_all_signal_data | ( | switch_core_session_t * | session | ) |
Definition at line 905 of file switch_ivr.c.
References SWITCH_FALSE, switch_ivr_parse_signal_data(), and SWITCH_TRUE.
Referenced by switch_ivr_parse_all_messages().
switch_status_t switch_ivr_parse_event | ( | _In_ switch_core_session_t * | session, |
_In_ switch_event_t * | event | ||
) |
Parse command from an event.
session | the session on which to parse the event |
event | the event to parse |
switch_status_t switch_ivr_parse_next_event | ( | switch_core_session_t * | session | ) |
Definition at line 796 of file switch_ivr.c.
References switch_channel_event_set_data(), switch_core_session_dequeue_private_event(), switch_core_session_get_channel(), switch_event_fire, switch_event_prep_for_delivery, SWITCH_EVENT_PRIVATE_COMMAND, switch_ivr_parse_event(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by audio_bridge_thread(), and switch_ivr_parse_all_events().
switch_status_t switch_ivr_parse_next_signal_data | ( | switch_core_session_t * | session | ) |
Definition at line 909 of file switch_ivr.c.
References SWITCH_FALSE, and switch_ivr_parse_signal_data().
switch_status_t switch_ivr_parse_signal_data | ( | switch_core_session_t * | session, |
switch_bool_t | all, | ||
switch_bool_t | only_session_thread | ||
) |
Definition at line 869 of file switch_ivr.c.
References CF_SIGNAL_DATA, switch_core_session_message::from, switch_core_session_message::message_id, switch_core_session_message::pointer_arg, switch_channel_clear_flag(), switch_channel_set_flag, switch_channel_test_flag(), switch_core_session_dequeue_signal_data(), switch_core_session_get_channel(), switch_core_session_in_thread(), switch_core_session_receive_message, SWITCH_MESSAGE_INDICATE_SIGNAL_DATA, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_channel_check_signal(), switch_ivr_parse_all_signal_data(), and switch_ivr_parse_next_signal_data().
switch_status_t switch_ivr_pause_detect_speech | ( | switch_core_session_t * | session | ) |
Pause background Speech detection on a session.
session | The session to pause detection on |
Definition at line 5245 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), switch_core_asr_pause(), switch_core_session_get_channel(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech(), switch_ivr_play_and_collect_input(), and switch_ivr_play_and_detect_speech().
switch_status_t switch_ivr_play_and_detect_speech | ( | switch_core_session_t * | session, |
const char * | file, | ||
const char * | mod_name, | ||
const char * | grammar, | ||
char ** | result, | ||
uint32_t | input_timeout, | ||
switch_input_args_t * | args | ||
) |
play a file to the session while doing speech recognition.
session | the session to play and detect on |
file | the path to the file |
mod_name | the module name of the ASR library |
grammar | the grammar text, URI, or local file name |
result | of speech recognition, allocated from the session pool |
input_timeout | time to wait for input |
args | arguements to pass for callbacks etc |
Definition at line 4882 of file switch_ivr_async.c.
References arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_input_args_t::buflen, switch_input_args_t::dmachine, play_and_detect_speech_state_t::done, switch_input_args_t::input_callback, play_and_detect_speech_state_t::original_args, PLAY_AND_DETECT_DONE, PLAY_AND_DETECT_DONE_RECOGNIZING, play_and_detect_input_callback(), switch_input_args_t::read_frame_callback, play_and_detect_speech_state_t::result, switch_channel_get_name(), switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_var_true(), switch_core_session_get_channel(), SWITCH_FALSE, switch_ivr_detect_speech(), switch_ivr_detect_speech_start_input_timers(), switch_ivr_dmachine_last_ping(), switch_ivr_pause_detect_speech(), switch_ivr_play_file(), switch_ivr_sleep(), switch_ivr_stop_detect_speech(), SWITCH_LOG_INFO, switch_log_printf(), SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, and switch_input_args_t::user_data.
Referenced by CoreSession::playAndDetectSpeech().
switch_status_t switch_ivr_play_file | ( | switch_core_session_t * | session, |
switch_file_handle_t * | fh, | ||
const char * | file, | ||
switch_input_args_t * | args | ||
) |
play a file from the disk to the session
session | the session to play the file too |
fh | file handle to use (NULL for builtin one) |
file | the path to the file |
args | arguements to pass for callbacks etc |
Definition at line 1244 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, arg_recursion_check_start, arg_recursion_check_stop, switch_file_handle::audio_buffer, switch_directories::base_dir, switch_input_args_t::buf, switch_frame::buflen, buflen, switch_input_args_t::buflen, CF_BREAK, CF_HOLD, CF_VIDEO, switch_frame::channels, switch_file_handle::channels, switch_frame::codec, cur, switch_file_handle::cur_channels, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_codec_implementation::encoded_bytes_per_packet, FILE_BLOCKSIZE, FILE_BUFSIZE, FILE_STARTSAMPLES, switch_codec_implementation::iananame, switch_codec::implementation, switch_input_args_t::input_callback, memset(), switch_codec_implementation::microseconds_per_packet, switch_file_handle::native_rate, switch_codec_implementation::number_of_channels, switch_file_handle::offset_pos, switch_file_handle::params, pool, switch_file_handle::prebuf, switch_file_handle::prefix, switch_frame::rate, switch_input_args_t::read_frame_callback, switch_timer::samplecount, switch_file_handle::samplerate, switch_frame::samples, switch_file_handle::samples, switch_file_handle::samples_in, switch_codec_implementation::samples_per_packet, switch_codec_implementation::samples_per_second, switch_file_handle::sp_audio_buffer, switch_file_handle::speed, switch_assert, SWITCH_AUDIO_COL_STR_ARTIST, SWITCH_AUDIO_COL_STR_COMMENT, SWITCH_AUDIO_COL_STR_COPYRIGHT, SWITCH_AUDIO_COL_STR_DATE, SWITCH_AUDIO_COL_STR_SOFTWARE, SWITCH_AUDIO_COL_STR_TITLE, switch_buffer_create_dynamic(), switch_buffer_destroy(), switch_buffer_inuse(), switch_buffer_read(), switch_buffer_write(), switch_buffer_zero(), switch_change_sln_volume(), switch_change_sln_volume_granular(), switch_channel_audio_sync, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_event_set_data(), switch_channel_get_name(), switch_channel_get_variable, switch_channel_has_dtmf(), switch_channel_media_ready, switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_clear_flag_locked, SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_codec_ready(), switch_core_file_close(), switch_core_file_get_string(), switch_core_file_has_video(), switch_core_file_open, switch_core_file_read(), switch_core_file_seek(), switch_core_media_set_video_file(), switch_core_service_session, switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_codec(), switch_core_session_get_read_impl(), switch_core_session_io_rwunlock(), switch_core_session_io_write_lock(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_sprintf(), switch_core_session_strdup, switch_core_session_write_frame(), switch_core_thread_session_end(), switch_core_timer_destroy(), switch_core_timer_init(), switch_core_timer_next(), switch_core_timer_sync(), switch_event_add_header_string(), switch_event_create, switch_event_destroy(), switch_event_fire, switch_event_merge(), SWITCH_EVENT_PLAYBACK_START, SWITCH_EVENT_PLAYBACK_STOP, SWITCH_FALSE, SWITCH_FILE_BREAK_ON_CHANGE, SWITCH_FILE_CALLBACK, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, SWITCH_FILE_FLAG_VIDEO, SWITCH_FILE_NATIVE, SWITCH_FILE_OPEN, SWITCH_FILE_PAUSE, SWITCH_FILE_SEEK, switch_find_end_paren(), SWITCH_GLOBAL_dirs, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, SWITCH_IO_FLAG_SINGLE_READ, switch_is_file_path(), switch_ivr_dmachine_feed(), switch_ivr_dmachine_is_parsing(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), switch_ivr_parse_all_messages(), switch_ivr_phrase_macro, switch_ivr_sleep(), switch_ivr_speak_text(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_PATH_SEPARATOR, SWITCH_READ_ACCEPTABLE, SWITCH_RW_WRITE, switch_safe_free, switch_separate_string(), switch_set_flag_locked, SWITCH_STACK_BOTTOM, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_MORE_DATA, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, switch_str_nil, switch_swap_linear(), switch_test_flag, SWITCH_TRUE, switch_true(), SWITCH_URL_SEPARATOR, switch_yield, switch_zmalloc, switch_frame::timestamp, switch_input_args_t::user_data, switch_file_handle::vol, switch_file_handle::volgranular, and zstr.
Referenced by collect_thread_run(), enterprise_originate_ringback_thread(), fs_ivr_play_file(), fs_ivr_play_file2(), play_and_collect(), CoreSession::streamFile(), switch_ivr_menu_execute(), switch_ivr_phrase_macro_event(), switch_ivr_play_and_collect_input(), switch_ivr_play_and_detect_speech(), switch_ivr_read(), switch_ivr_soft_hold(), and switch_play_and_get_digits().
switch_status_t switch_ivr_process_indications | ( | switch_core_session_t * | session, |
switch_core_session_message_t * | message | ||
) |
Definition at line 813 of file switch_ivr.c.
References switch_core_session_message::message_id, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_answer, switch_channel_hangup, switch_channel_pre_answer, switch_channel_ring_ready, switch_core_session_get_channel(), switch_core_session_receive_message, SWITCH_MESSAGE_INDICATE_ANSWER, SWITCH_MESSAGE_INDICATE_PROGRESS, SWITCH_MESSAGE_INDICATE_RESPOND, SWITCH_MESSAGE_INDICATE_RINGING, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_session_flush_message(), and switch_ivr_parse_all_messages().
switch_status_t switch_ivr_record_file | ( | _In_ switch_core_session_t * | session, |
_In_ switch_file_handle_t * | fh, | ||
_In_z_ const char * | file, | ||
_In_opt_ switch_input_args_t * | args, | ||
_In_ uint32_t | limit | ||
) |
record a file from the session to a file
session | the session to record from |
fh | file handle to use |
file | the path to the file |
args | arguements to pass for callbacks etc |
limit | max limit to record for (0 for infinite) |
Referenced by fs_switch_ivr_record_file(), and CoreSession::recordFile().
switch_status_t switch_ivr_record_file_event | ( | _In_ switch_core_session_t * | session, |
_In_ switch_file_handle_t * | fh, | ||
_In_z_ const char * | file, | ||
_In_opt_ switch_input_args_t * | args, | ||
_In_ uint32_t | limit, | ||
switch_event_t * | vars | ||
) |
record a file from the session to a file
session | the session to record from |
fh | file handle to use |
file | the path to the file |
args | arguements to pass for callbacks etc |
limit | max limit to record for (0 for infinite) |
vars | vars to add to RECORD_START and RECORD_STOP automatically prefixed with Recording-Variable- |
switch_status_t switch_ivr_record_session | ( | switch_core_session_t * | session, |
const char * | file, | ||
uint32_t | limit, | ||
switch_file_handle_t * | fh | ||
) |
Record a session to disk.
session | the session to record |
file | the path to the file |
limit | stop recording after this amount of time (in ms, 0 = never stop) |
fh | file handle to use (NULL for builtin one) |
Definition at line 3355 of file switch_ivr_async.c.
References switch_ivr_record_session_event().
switch_status_t switch_ivr_record_session_event | ( | switch_core_session_t * | session, |
const char * | file, | ||
uint32_t | limit, | ||
switch_file_handle_t * | fh, | ||
switch_event_t * | variables | ||
) |
Definition at line 2927 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, switch_directories::base_dir, record_helper::bug, CF_VIDEO, switch_file_handle::channels, record_helper::completion_cause, switch_codec_implementation::decoded_bytes_per_packet, record_helper::fh, record_helper::file, record_helper::final_timeout_ms, switch_core_session_message::from, get_recording_var(), record_helper::hangup_on_error, record_helper::helper_pool, switch_codec_implementation::iananame, record_helper::in_fh, record_helper::initial_timeout_ms, switch_core_session_message::message_id, record_helper::min_sec, record_helper::native, switch_codec_implementation::number_of_channels, record_helper::out_fh, record_helper::packet_len, switch_file_handle::params, path, switch_file_handle::pre_buffer_datalen, record_helper::read_impl, record_callback(), record_helper_create(), record_helper_destroy(), recording_var_true(), switch_file_handle::samplerate, set_completion_cause(), record_helper::silence_threshold, SMBF_ANSWER_REQ, SMBF_BRIDGE_REQ, SMBF_READ_PING, SMBF_READ_STREAM, SMBF_READ_VIDEO_PING, SMBF_READ_VIDEO_STREAM, SMBF_STEREO, SMBF_STEREO_SWAP, SMBF_TAP_NATIVE_READ, SMBF_TAP_NATIVE_WRITE, SMBF_WRITE_STREAM, SMBF_WRITE_VIDEO_STREAM, SWITCH_AUDIO_COL_STR_ARTIST, SWITCH_AUDIO_COL_STR_COMMENT, SWITCH_AUDIO_COL_STR_COPYRIGHT, SWITCH_AUDIO_COL_STR_DATE, SWITCH_AUDIO_COL_STR_SOFTWARE, SWITCH_AUDIO_COL_STR_TITLE, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_get_private(), switch_channel_get_variable, switch_channel_hangup, switch_channel_media_up, switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_channel_set_variable, switch_channel_set_variable_printf(), switch_channel_test_flag(), switch_core_alloc, switch_core_file_close(), switch_core_file_handle_dup(), switch_core_file_has_video(), switch_core_file_open, switch_core_file_set_string(), switch_core_media_bug_add(), switch_core_media_bug_set_pre_buffer_framecount(), switch_core_session_get_channel(), switch_core_session_get_partner, switch_core_session_get_pool(), switch_core_session_get_read_codec(), switch_core_session_get_read_impl(), switch_core_session_receive_message, switch_core_session_reset(), switch_core_session_rwunlock(), switch_core_sprintf(), switch_core_strdup, SWITCH_DEFAULT_DIR_PERMS, SWITCH_DEFAULT_FILE_BUFFER_LEN, switch_dir_make_recursive(), switch_epoch_time_now(), switch_event_dup(), switch_event_get_header, SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_VIDEO, SWITCH_FILE_FLAG_WRITE, SWITCH_FILE_NATIVE, SWITCH_FILE_WRITE_APPEND, switch_find_end_paren(), SWITCH_GLOBAL_dirs, switch_goto_status, switch_is_file_path(), switch_is_valid_rate, switch_ivr_stop_record_session(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ, SWITCH_PATH_SEPARATOR, switch_set_flag, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_str_nil, SWITCH_TRUE, switch_true(), SWITCH_URL_SEPARATOR, to, record_helper::variables, and zstr.
Referenced by switch_ivr_record_session().
switch_status_t switch_ivr_resume_detect_speech | ( | switch_core_session_t * | session | ) |
Resume background Speech detection on a session.
session | The session to resume detection on |
Definition at line 5257 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_audio_sync, switch_channel_get_private(), switch_core_asr_resume(), switch_core_session_get_channel(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech(), speech_thread(), and switch_ivr_detect_speech().
uint32_t switch_ivr_schedule_broadcast | ( | time_t | runtime, |
const char * | uuid, | ||
const char * | path, | ||
switch_media_flag_t | flags | ||
) |
Signal the session to broadcast audio in the future.
runtime | when (in epoch time) to run the broadcast |
uuid | the uuid of the session to broadcast on |
path | the path data of the broadcast "/path/to/file.wav [<timer name>]" or "speak:<engine>|<voice>|<Text to say>" |
flags | flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call) |
Definition at line 5635 of file switch_ivr_async.c.
References __SWITCH_FUNC__, cur, broadcast_helper::flags, broadcast_helper::path, SSHF_FREE_ARG, switch_copy_string(), switch_scheduler_add_task(), switch_zmalloc, and broadcast_helper::uuid_str.
uint32_t switch_ivr_schedule_hangup | ( | time_t | runtime, |
const char * | uuid, | ||
switch_call_cause_t | cause, | ||
switch_bool_t | bleg | ||
) |
Hangup an existing session in the future.
runtime | the time (int epoch seconds) to transfer the call |
uuid | the uuid of the session to hangup |
cause | the hanup cause code |
bleg | hangup up the B-Leg if possible |
Definition at line 5538 of file switch_ivr_async.c.
References __SWITCH_FUNC__, hangup_helper::bleg, hangup_helper::cause, SSHF_FREE_ARG, switch_copy_string(), switch_scheduler_add_task(), switch_zmalloc, and hangup_helper::uuid_str.
uint32_t switch_ivr_schedule_transfer | ( | time_t | runtime, |
const char * | uuid, | ||
char * | extension, | ||
char * | dialplan, | ||
char * | context | ||
) |
Transfer an existing session to another location in the future.
runtime | the time (int epoch seconds) to transfer the call |
uuid | the uuid of the session to transfer |
extension | the new extension |
dialplan | the new dialplan (OPTIONAL, may be NULL) |
context | the new context (OPTIONAL, may be NULL) |
Definition at line 5575 of file switch_ivr_async.c.
References __SWITCH_FUNC__, transfer_helper::context, cur, transfer_helper::dialplan, transfer_helper::extension, SSHF_FREE_ARG, switch_copy_string(), switch_scheduler_add_task(), switch_zmalloc, and transfer_helper::uuid_str.
switch_status_t switch_ivr_session_audio | ( | switch_core_session_t * | session, |
const char * | cmd, | ||
const char * | direction, | ||
int | level | ||
) |
Definition at line 3727 of file switch_ivr_async.c.
References switch_session_audio_t::read_level, switch_session_audio_t::read_mute, switch_session_audio_t::session, session_audio_callback(), SMBF_NO_PAUSE, SMBF_READ_REPLACE, SMBF_WRITE_REPLACE, switch_channel_get_private(), switch_channel_pre_answer, switch_channel_set_private(), switch_core_media_bug_add(), switch_core_media_bug_get_user_data(), switch_core_media_bug_set_flag(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_read_impl(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_session_audio_t::write_level, and switch_session_audio_t::write_mute.
switch_status_t switch_ivr_session_echo | ( | switch_core_session_t * | session, |
switch_input_args_t * | args | ||
) |
session | the session to act on |
Definition at line 703 of file switch_ivr_async.c.
References arg_recursion_check_start, switch_input_args_t::buf, switch_input_args_t::buflen, CF_BREAK, CF_TEXT_ECHO, CF_VIDEO_DECODED_READ, CF_VIDEO_ECHO, switch_dtmf_t::digit, switch_input_args_t::input_callback, switch_channel_clear_flag(), switch_channel_clear_flag_recursive(), switch_channel_dequeue_dtmf(), switch_channel_has_dtmf(), switch_channel_pre_answer, switch_channel_ready, switch_channel_set_flag, switch_channel_set_flag_recursive(), switch_channel_test_flag(), switch_channel_var_true(), switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_raw_read(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_video_reset(), switch_core_session_write_frame(), switch_event_destroy(), SWITCH_FALSE, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_parse_all_events(), SWITCH_READ_ACCEPTABLE, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and SWITCH_TRUE.
switch_status_t switch_ivr_session_transfer | ( | _In_ switch_core_session_t * | session, |
const char * | extension, | ||
const char * | dialplan, | ||
const char * | context | ||
) |
Transfer an existing session to another location.
session | the session to transfer |
extension | the new extension |
dialplan | the new dialplan (OPTIONAL, may be NULL) |
context | the new context (OPTIONAL, may be NULL) |
Referenced by fs_switch_ivr_session_transfer(), switch_channel_handle_cause(), switch_ivr_multi_threaded_bridge(), switch_ivr_originate(), switch_play_and_get_digits(), SWITCH_STANDARD_SCHED_FUNC(), CoreSession::transfer(), transfer_after_bridge(), and uuid_bridge_on_soft_execute().
switch_status_t switch_ivr_set_param_detect_speech | ( | switch_core_session_t * | session, |
const char * | name, | ||
const char * | val | ||
) |
Definition at line 5286 of file switch_ivr_async.c.
References speech_thread_handle::ah, switch_channel_get_private(), switch_core_asr_text_param(), switch_core_session_get_channel(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech().
int switch_ivr_set_xml_chan_vars | ( | switch_xml_t | xml, |
switch_channel_t * | channel, | ||
int | off | ||
) |
Definition at line 2838 of file switch_ivr.c.
References switch_event_header::array, switch_event_header::idx, switch_event_header::name, switch_event_header::next, switch_channel_variable_first(), switch_channel_variable_last(), switch_ivr_set_xml_chan_var(), and switch_event_header::value.
Referenced by switch_ivr_generate_xml_cdr().
int switch_ivr_set_xml_profile_data | ( | switch_xml_t | xml, |
switch_caller_profile_t * | caller_profile, | ||
int | off | ||
) |
Definition at line 2599 of file switch_ivr.c.
References switch_caller_profile::ani, switch_caller_profile::aniii, switch_caller_profile::callee_id_name, switch_caller_profile::callee_id_number, switch_caller_profile::caller_id_name, switch_caller_profile::caller_id_number, switch_caller_profile::chan_name, switch_caller_profile::context, switch_caller_profile::destination_number, switch_caller_profile::dialplan, switch_caller_profile::network_addr, profile_node_s::next, switch_caller_profile::rdnis, switch_caller_profile::soft, switch_caller_profile::source, switch_xml_add_child_d(), switch_xml_set_txt_d(), switch_caller_profile::transfer_source, switch_caller_profile::username, switch_caller_profile::uuid, profile_node_s::val, and profile_node_s::var.
Referenced by switch_ivr_generate_xml_cdr().
switch_status_t switch_ivr_signal_bridge | ( | switch_core_session_t * | session, |
switch_core_session_t * | peer_session | ||
) |
Bridge Signalling from one session to another.
session | one session |
peer_session | the other session |
Definition at line 1532 of file switch_ivr_bridge.c.
References CF_BRIDGE_ORIGINATOR, CF_BRIDGED, CF_RESET, CF_SIGNAL_BRIDGE_TTL, CF_TRANSFER, check_bridge_export(), CS_HIBERNATE, SWITCH_CAUSE_ORIGINATOR_CANCEL, switch_channel_add_state_handler(), switch_channel_clear_flag(), switch_channel_clear_state_handler(), switch_channel_down_nosig, switch_channel_event_set_data(), switch_channel_get_cause(), switch_channel_hangup, switch_channel_set_flag, switch_channel_set_flag_recursive(), switch_channel_set_state, switch_channel_set_state_flag(), switch_channel_set_variable, switch_channel_test_flag(), switch_channel_up_nosig, switch_core_session_get_channel(), switch_core_session_get_uuid(), switch_event_add_header_string(), SWITCH_EVENT_CHANNEL_EXECUTE, switch_event_create, switch_event_fire, switch_ivr_bridge_display(), SWITCH_SIGNAL_BRIDGE_VARIABLE, SWITCH_STACK_BOTTOM, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_standard_on_reset(), switch_ivr_3p_nomedia(), switch_ivr_enterprise_orig_and_bridge(), switch_ivr_multi_threaded_bridge(), switch_ivr_nomedia(), and switch_ivr_orig_and_bridge().
switch_status_t switch_ivr_sleep | ( | switch_core_session_t * | session, |
uint32_t | ms, | ||
switch_bool_t | sync, | ||
switch_input_args_t * | args | ||
) |
Wait for time to pass for a specified number of milliseconds.
session | the session to wait for. |
ms | the number of milliseconds |
sync | synchronize the channel's audio before waiting |
args | arguements to pass for callbacks etc |
Definition at line 127 of file switch_ivr.c.
References switch_codec_implementation::actual_samples_per_second, arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_frame::buflen, switch_input_args_t::buflen, CF_BREAK, CF_VIDEO_BLANK, switch_frame::codec, switch_frame::data, switch_frame::datalen, switch_codec_implementation::decoded_bytes_per_packet, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_input_args_t::input_callback, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_input_args_t::read_frame_callback, switch_frame::samples, SFF_CNG, switch_channel_audio_sync, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_get_variable, switch_channel_has_dtmf(), switch_channel_media_ready, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_test_flag(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_write_frame(), switch_event_destroy(), SWITCH_FALSE, switch_generate_sln_silence(), switch_goto_status, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), SWITCH_IVR_VERIFY_SILENCE_DIVISOR, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_micro_time_now(), SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, SWITCH_SEND_SILENCE_WHEN_IDLE_VARIABLE, switch_set_flag, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_yield, switch_zmalloc, and switch_input_args_t::user_data.
Referenced by audio_bridge_thread(), collect_thread_run(), fs_switch_ivr_sleep(), originate_on_consume_media_transmit(), CoreSession::sleep(), switch_channel_perform_answer(), switch_ivr_originate(), switch_ivr_phrase_macro_event(), switch_ivr_play_and_collect_input(), switch_ivr_play_and_detect_speech(), and switch_ivr_play_file().
switch_status_t switch_ivr_speak_text | ( | switch_core_session_t * | session, |
const char * | tts_name, | ||
const char * | voice_name, | ||
const char * | text, | ||
switch_input_args_t * | args | ||
) |
Speak given text with given tts engine.
session | the session to speak on |
tts_name | the desired tts module |
voice_name | the desired voice |
text | the text to speak |
args | arguements to pass for callbacks etc |
Definition at line 3026 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, arg_recursion_check_start, arg_recursion_check_stop, switch_frame::codec, cached_speech_handle::codec, memset(), switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, pool, switch_speech_handle::samples, cached_speech_handle::sh, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, SWITCH_CACHE_SPEECH_HANDLES_VARIABLE, switch_channel_get_private(), switch_channel_get_variable, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_copy_string(), switch_core_codec_destroy(), switch_core_codec_init, switch_core_service_session, switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_reset(), switch_core_speech_close(), switch_core_speech_open(), switch_core_speech_text_param_tts(), switch_core_thread_session_end(), switch_core_timer_destroy(), switch_core_timer_init(), switch_core_timer_sync(), SWITCH_FALSE, switch_ivr_clear_speech_cache(), switch_ivr_speak_text_handle(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_SPEECH_FLAG_NONE, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, switch_true(), cached_speech_handle::timer, cached_speech_handle::tts_name, and cached_speech_handle::voice_name.
Referenced by fs_switch_ivr_speak_text(), CoreSession::speak(), switch_ivr_phrase_macro_event(), and switch_ivr_play_file().
switch_status_t switch_ivr_speak_text_handle | ( | switch_core_session_t * | session, |
switch_speech_handle_t * | sh, | ||
switch_codec_t * | codec, | ||
switch_timer_t * | timer, | ||
const char * | text, | ||
switch_input_args_t * | args | ||
) |
Definition at line 2744 of file switch_ivr_play_say.c.
References arg_recursion_check_start, arg_recursion_check_stop, switch_input_args_t::buf, switch_frame::buflen, switch_input_args_t::buflen, CF_BREAK, CF_HOLD, switch_speech_handle::channels, switch_frame::codec, switch_frame::data, switch_frame::datalen, switch_dtmf_t::digit, switch_input_args_t::dmachine, switch_codec::implementation, switch_input_args_t::input_callback, memset(), switch_frame::rate, switch_speech_handle::rate, switch_input_args_t::read_frame_callback, switch_timer::samplecount, switch_frame::samples, switch_speech_handle::samples, switch_assert, switch_channel_audio_sync, switch_channel_clear_flag(), switch_channel_dequeue_dtmf(), switch_channel_get_variable, switch_channel_has_dtmf(), switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_test_flag(), switch_core_codec_ready(), switch_core_session_dequeue_event(), switch_core_session_get_channel(), switch_core_session_read_frame(), switch_core_session_write_frame(), switch_core_speech_feed_tts(), switch_core_speech_flush_tts(), switch_core_speech_read_tts(), switch_core_timer_next(), switch_event_destroy(), SWITCH_FALSE, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), switch_ivr_parse_all_messages(), SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, switch_safe_free, SWITCH_SPEECH_FLAG_BLOCKING, SWITCH_SPEECH_FLAG_NONE, SWITCH_SPEECH_FLAG_PAUSE, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, switch_test_flag, switch_yield, switch_frame::timestamp, and switch_input_args_t::user_data.
Referenced by switch_ivr_speak_text().
switch_status_t switch_ivr_stop_detect_speech | ( | switch_core_session_t * | session | ) |
Stop background Speech detection on a session.
session | The session to stop detection on |
Definition at line 5229 of file switch_ivr_async.c.
References speech_thread_handle::bug, speech_on_dtmf(), switch_assert, switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_SPEECH_KEY, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::detectSpeech(), switch_ivr_detect_speech(), switch_ivr_detect_speech_disable_all_grammars(), switch_ivr_detect_speech_disable_grammar(), switch_ivr_detect_speech_enable_grammar(), switch_ivr_detect_speech_init(), switch_ivr_detect_speech_load_grammar(), switch_ivr_detect_speech_unload_grammar(), and switch_ivr_play_and_detect_speech().
switch_status_t switch_ivr_stop_displace_session | ( | switch_core_session_t * | session, |
const char * | file | ||
) |
Stop displacing a session.
session | the session |
file | file name from the switch_ivr_displace_session call |
Definition at line 987 of file switch_ivr_async.c.
References switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_stop_inband_dtmf_generate_session | ( | switch_core_session_t * | session | ) |
Stop generating DTMF inband.
session | the session to stop generating |
Definition at line 4075 of file switch_ivr_async.c.
References switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_stop_inband_dtmf_session | ( | switch_core_session_t * | session | ) |
Stop looking for DTMF inband.
session | the session to stop looking |
Definition at line 3841 of file switch_ivr_async.c.
References switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_stop_record_session | ( | switch_core_session_t * | session, |
const char * | file | ||
) |
Stop Recording a session.
session | the session to stop recording |
file | the path to the file |
Definition at line 1920 of file switch_ivr_async.c.
References record_helper::bug, record_callback(), switch_channel_get_private(), switch_core_media_bug_remove(), switch_core_media_bug_remove_callback(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_record_session_event().
switch_status_t switch_ivr_stop_session_audio | ( | switch_core_session_t * | session | ) |
Definition at line 3714 of file switch_ivr_async.c.
References switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_stop_tone_detect_session | ( | switch_core_session_t * | session | ) |
Stop looking for TONES.
session | the session to stop looking |
Definition at line 4307 of file switch_ivr_async.c.
References switch_tone_container_t::bug, switch_tone_container_t::detect_fax, switch_tone_container_t::index, switch_tone_container_t::list, switch_channel_get_private(), switch_channel_set_private(), switch_core_media_bug_remove(), switch_core_session_get_channel(), SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_tone_detect_t::up.
Referenced by switch_ivr_originate().
switch_status_t switch_ivr_tone_detect_session | ( | switch_core_session_t * | session, |
const char * | key, | ||
const char * | tone_spec, | ||
const char * | flags, | ||
time_t | timeout, | ||
int | hits, | ||
const char * | app, | ||
const char * | data, | ||
switch_tone_detect_callback_t | callback | ||
) |
Start looking for TONES.
session | the session to start looking |
key | the name of the tone. |
tone_spec | comma sep list of tone freqs |
flags | one or both of 'r' and 'w' |
timeout | timeout |
app | optional application to execute when tone is found |
data | optional data for appliaction |
Definition at line 4327 of file switch_ivr_async.c.
References switch_codec_implementation::actual_samples_per_second, switch_tone_detect_t::app, switch_tone_container_t::bug, switch_tone_container_t::bug_running, switch_ivr_dmachine_binding::callback, switch_tone_detect_t::callback, switch_tone_detect_t::data, switch_tone_detect_t::default_expires, switch_tone_detect_t::default_sleep, switch_tone_container_t::detect_fax, switch_tone_detect_t::expires, teletone_tone_map_t::freqs, switch_tone_detect_t::hits, switch_tone_container_t::index, switch_tone_detect_t::key, switch_tone_container_t::list, switch_tone_detect_t::map, MAX_TONES, memset(), switch_tone_detect_t::mt, switch_ivr_dmachine_binding::next, switch_tone_detect_t::once, teletone_multi_tone_t::sample_rate, switch_tone_container_t::session, switch_tone_detect_t::sleep, SMBF_NO_PAUSE, SMBF_READ_REPLACE, SMBF_WRITE_REPLACE, switch_tone_detect_t::start_time, switch_channel_get_name(), switch_channel_get_private(), switch_channel_get_variable, switch_channel_pre_answer, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_private(), switch_core_media_bug_add(), switch_core_session_alloc, switch_core_session_get_channel(), switch_core_session_get_read_impl(), switch_core_session_strdup, SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), switch_micro_time_now(), SWITCH_STATUS_FALSE, SWITCH_STATUS_MEMERR, SWITCH_STATUS_SUCCESS, teletone_multi_tone_init(), tone_detect_callback(), tone_on_dtmf(), switch_tone_detect_t::total_hits, switch_tone_detect_t::up, and zstr.
Referenced by check_channel_status().
switch_status_t switch_ivr_transfer_recordings | ( | switch_core_session_t * | orig_session, |
switch_core_session_t * | new_session | ||
) |
Definition at line 1951 of file switch_ivr_async.c.
References record_callback(), switch_channel_get_variable, switch_channel_set_variable, switch_channel_transfer_variable_prefix(), switch_core_media_bug_transfer_callback(), switch_core_session_get_channel(), switch_ivr_record_user_data_dup(), SWITCH_RECORD_POST_PROCESS_EXEC_API_VARIABLE, and SWITCH_RECORD_POST_PROCESS_EXEC_APP_VARIABLE.
Referenced by switch_channel_mark_hold(), and switch_ivr_originate().
switch_status_t switch_ivr_transfer_variable | ( | switch_core_session_t * | sessa, |
switch_core_session_t * | sessb, | ||
char * | var | ||
) |
Transfer variables from one session to another.
sessa | the original session |
sessb | the new session |
var | the name of the variable to transfer (NULL for all) |
Definition at line 2318 of file switch_ivr.c.
References switch_event::headers, switch_event_header::name, switch_event_header::next, switch_channel_get_variable, switch_channel_get_variables(), switch_channel_set_variable, switch_core_session_get_channel(), switch_event_destroy(), SWITCH_STATUS_SUCCESS, and switch_event_header::value.
switch_status_t switch_ivr_unhold | ( | switch_core_session_t * | session | ) |
Signal the session with a protocol specific unhold message.
session | the session to unhold |
Definition at line 1603 of file switch_ivr.c.
References CCS_HELD, CF_BROADCAST, CF_HOLD, CF_SUSPEND, switch_core_session_message::from, switch_core_session_message::message_id, switch_channel_clear_flag(), switch_channel_event_set_data(), switch_channel_get_callstate(), switch_channel_get_partner_uuid(), SWITCH_CHANNEL_SESSION_LOG, switch_channel_stop_broadcast, switch_channel_wait_for_flag(), switch_core_session_get_channel(), switch_core_session_locate, switch_core_session_receive_message, switch_core_session_rwunlock(), SWITCH_EVENT_CHANNEL_UNHOLD, switch_event_create, switch_event_fire, SWITCH_FALSE, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_MESSAGE_INDICATE_UNHOLD, SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by switch_core_media_toggle_hold(), switch_ivr_check_hold(), switch_ivr_hold_toggle_uuid(), and switch_ivr_unhold_uuid().
switch_status_t switch_ivr_unhold_uuid | ( | const char * | uuid | ) |
Signal the session with a protocol specific unhold message.
uuid | the uuid of the session to hold |
Definition at line 1646 of file switch_ivr.c.
References switch_core_session_locate, switch_core_session_rwunlock(), switch_ivr_unhold(), and SWITCH_STATUS_SUCCESS.
switch_status_t switch_ivr_uuid_bridge | ( | const char * | originator_uuid, |
const char * | originatee_uuid | ||
) |
Bridge two existing sessions.
originator_uuid | the uuid of the originator |
originatee_uuid | the uuid of the originator |
Definition at line 2005 of file switch_ivr_bridge.c.
References switch_caller_profile::callee_id_name, switch_caller_profile::callee_id_number, switch_caller_profile::caller_id_name, switch_caller_profile::caller_id_number, CF_BLEG, CF_BRIDGE_ORIGINATOR, CF_DIALPLAN, CF_HOLD_ON_BRIDGE, CF_LEG_HOLDING, CF_ORIGINATING, CF_RECOVERING_BRIDGE, CF_REDIRECT, CF_TRANSFER, CF_UUID_BRIDGE_ORIGINATOR, cleanup_proxy_mode_a(), CS_CONSUME_MEDIA, CS_HIBERNATE, switch_caller_profile::destination_number, DUMP_EVENT, switch_caller_profile::pool, SWITCH_BRIDGE_CHANNEL_VARIABLE, SWITCH_BRIDGE_UUID_VARIABLE, SWITCH_CALL_DIRECTION_INBOUND, SWITCH_CALL_DIRECTION_OUTBOUND, switch_caller_profile_clone(), switch_caller_profile_event_set_data(), switch_channel_add_state_handler(), switch_channel_add_variable_var_check(), switch_channel_clear_flag(), switch_channel_clear_state_flag(), switch_channel_clear_state_handler(), switch_channel_direction(), switch_channel_down_nosig, switch_channel_flip_cid(), switch_channel_get_caller_profile(), switch_channel_get_name(), switch_channel_get_state(), switch_channel_inbound_display, switch_channel_invert_cid(), switch_channel_media_up, switch_channel_outbound_display, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_flag, switch_channel_set_originatee_caller_profile(), switch_channel_set_originator_caller_profile(), switch_channel_set_state, switch_channel_set_state_flag(), switch_channel_set_variable, switch_channel_step_caller_profile(), switch_channel_stop_broadcast, switch_channel_test_flag(), switch_core_session_get_channel(), switch_core_session_get_uuid(), switch_core_session_locate, switch_core_session_rwunlock(), switch_core_sprintf(), switch_core_strdup, switch_epoch_time_now(), SWITCH_EVENT_CHANNEL_DATA, switch_event_create_plain(), switch_event_destroy(), SWITCH_FALSE, switch_ivr_check_hold(), SWITCH_LOG_CRIT, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_SIGNAL_BOND_VARIABLE, SWITCH_STACK_PUSH, SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, SWITCH_TRANSFER_HISTORY_VARIABLE, SWITCH_TRANSFER_SOURCE_VARIABLE, SWITCH_UUID_BRIDGE, switch_caller_profile::transfer_source, and switch_caller_profile::uuid_str.
Referenced by switch_core_standard_on_reset(), switch_ivr_3p_media(), switch_ivr_intercept_session(), switch_ivr_media(), and switch_ivr_originate().
switch_status_t switch_ivr_wait_for_silence | ( | switch_core_session_t * | session, |
uint32_t | thresh, | ||
uint32_t | silence_hits, | ||
uint32_t | listen_hits, | ||
uint32_t | timeout_ms, | ||
const char * | file | ||
) |
Definition at line 2080 of file switch_ivr_play_say.c.
References switch_codec_implementation::actual_samples_per_second, switch_frame::buflen, switch_file_handle::channels, switch_frame::codec, count, switch_frame::data, switch_frame::datalen, if(), switch_codec::implementation, switch_codec_implementation::microseconds_per_packet, switch_codec_implementation::number_of_channels, switch_frame::samples, switch_codec_implementation::samples_per_packet, switch_frame::seq, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_channel_set_variable_printf(), SWITCH_CODEC_FLAG_DECODE, SWITCH_CODEC_FLAG_ENCODE, switch_core_codec_destroy(), switch_core_codec_init, switch_core_file_close(), switch_core_file_open, switch_core_file_read(), switch_core_session_get_channel(), switch_core_session_get_pool(), switch_core_session_get_read_impl(), switch_core_session_read_frame(), switch_core_session_reset(), switch_core_session_set_read_codec(), switch_core_session_write_frame(), SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, SWITCH_IO_FLAG_NONE, SWITCH_LOG_DEBUG, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_STATUS_FALSE, SWITCH_STATUS_NOTFOUND, SWITCH_STATUS_SUCCESS, SWITCH_TRUE, and switch_zmalloc.
switch_status_t switch_play_and_get_digits | ( | switch_core_session_t * | session, |
uint32_t | min_digits, | ||
uint32_t | max_digits, | ||
uint32_t | max_tries, | ||
uint32_t | timeout, | ||
const char * | valid_terminators, | ||
const char * | audio_file, | ||
const char * | bad_input_audio_file, | ||
const char * | var_name, | ||
char * | digit_buffer, | ||
uint32_t | digit_buffer_length, | ||
const char * | digits_regex, | ||
uint32_t | digit_timeout, | ||
const char * | transfer_on_failure | ||
) |
Play a sound and gather digits with the number of retries specified if the user doesn't give digits in the set time.
session | the current session to play sound to and collect digits |
min_digits | the fewest digits allowed for the response to be valid |
max_digits | the max number of digits to accept |
max_tries | number of times to replay the sound and capture digits |
timeout | time to wait for input (this is per iteration, so total possible time = max_tries * (timeout + audio playback length) |
valid_terminators | for input that can include # or * (useful for variable length prompts) |
audio_file | file to play |
bad_input_audio_file | file to play if the input from the user was invalid |
var_name | variable name to put results in |
digit_buffer | variable digits captured will be put back into (empty if capture failed) |
digit_buffer_length | length of the buffer for digits (should be the same or larger than max_digits) |
digits_regex | the qualifying regex |
Definition at line 2627 of file switch_ivr_play_say.c.
References memset(), switch_channel_get_variable, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_channel_set_variable, switch_core_session_get_channel(), switch_core_session_strdup, switch_ivr_play_file(), switch_ivr_read(), switch_ivr_session_transfer(), SWITCH_LOG_DEBUG1, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, switch_mprintf(), SWITCH_READ_TERMINATOR_USED_VARIABLE, switch_regex_match(), switch_safe_free, switch_separate_string(), SWITCH_STATUS_FALSE, SWITCH_STATUS_RESTART, SWITCH_STATUS_SUCCESS, SWITCH_STATUS_TIMEOUT, SWITCH_STATUS_TOO_SMALL, target, and zstr.
Referenced by CoreSession::playAndGetDigits(), and switch_ivr_menu_execute().