RTS API Documentation
1.10.11
|
#include <switch.h>
Go to the source code of this file.
Data Structures | |
struct | cached_speech_handle |
struct | switch_collect_input_state_t |
Macros | |
#define | FILE_STARTSAMPLES 1024 * 32 |
#define | FILE_BLOCKSIZE 1024 * 8 |
#define | FILE_BUFSIZE 1024 * 64 |
Typedefs | |
typedef struct cached_speech_handle | cached_speech_handle_t |
Enumerations | |
enum | switch_collect_input_flags_t { SWITCH_COLLECT_INPUT_PROMPT = (1 << 0), SWITCH_COLLECT_INPUT_SPEECH = (1 << 1), SWITCH_COLLECT_INPUT_SPEECH_DONE = (1 << 2), SWITCH_COLLECT_INPUT_DIGITS = (1 << 3), SWITCH_COLLECT_INPUT_DIGITS_DONE = (1 << 4) } |
Functions | |
switch_status_t | switch_ivr_phrase_macro_event (switch_core_session_t *session, const char *macro_name, const char *data, switch_event_t *event, const char *lang, switch_input_args_t *args) |
static void | merge_recording_variables (switch_event_t *vars, switch_event_t *event) |
static const char * | get_recording_var (switch_channel_t *channel, switch_event_t *vars, switch_file_handle_t *fh, const char *name) |
static int | recording_var_true (switch_channel_t *channel, switch_event_t *vars, switch_file_handle_t *fh, const char *name) |
switch_status_t | switch_ivr_record_file_event (switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args, uint32_t limit, switch_event_t *vars) |
switch_status_t | switch_ivr_record_file (switch_core_session_t *session, switch_file_handle_t *fh, const char *file, switch_input_args_t *args, uint32_t limit) |
static int | teletone_handler (teletone_generation_session_t *ts, teletone_tone_map_t *map) |
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_get_file_handle (switch_core_session_t *session, switch_file_handle_t **fh) |
switch_status_t | switch_ivr_release_file_handle (switch_core_session_t *session, switch_file_handle_t **fh) |
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_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_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_read (switch_core_session_t *session, uint32_t min_digits, uint32_t max_digits, const char *prompt_audio_file, const char *var_name, char *digit_buffer, switch_size_t digit_buffer_length, uint32_t timeout, const char *valid_terminators, uint32_t digit_timeout) |
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 *prompt_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... | |
static switch_status_t | hold_on_dtmf (switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen) |
switch_status_t | switch_ivr_soft_hold (switch_core_session_t *session, const char *unhold_key, const char *moh_a, const char *moh_b) |
static void | deliver_asr_event (switch_core_session_t *session, switch_event_t *event, switch_input_args_t *args) |
static switch_status_t | switch_collect_input_callback (switch_core_session_t *session, void *input, switch_input_type_t input_type, void *data, unsigned int len) |
switch_status_t | switch_ivr_play_and_collect_input (switch_core_session_t *session, const char *prompt, const char *recognizer_mod_name, const char *recognizer_grammar, int min_digits, int max_digits, const char *terminators, uint32_t digit_timeout, cJSON **recognition_result, char **digits_collected, char *terminator_collected, switch_input_args_t *args) |
Play prompt and collect input. More... | |
#define FILE_BLOCKSIZE 1024 * 8 |
Definition at line 1241 of file switch_ivr_play_say.c.
Referenced by switch_ivr_play_file().
#define FILE_BUFSIZE 1024 * 64 |
Definition at line 1242 of file switch_ivr_play_say.c.
Referenced by switch_ivr_play_file().
#define FILE_STARTSAMPLES 1024 * 32 |
Definition at line 1240 of file switch_ivr_play_say.c.
Referenced by switch_ivr_play_file().
typedef struct cached_speech_handle cached_speech_handle_t |
Definition at line 3006 of file switch_ivr_play_say.c.
Definition at line 3263 of file switch_ivr_play_say.c.
|
static |
Definition at line 3289 of file switch_ivr_play_say.c.
References switch_input_args_t::buf, switch_input_args_t::buflen, switch_input_args_t::input_callback, and SWITCH_INPUT_TYPE_EVENT.
Referenced by switch_collect_input_callback().
|
static |
Definition at line 384 of file switch_ivr_play_say.c.
References switch_file_handle::params, switch_channel_get_variable, and switch_event_get_header.
Referenced by recording_var_true(), and switch_ivr_record_file_event().
|
static |
Definition at line 3178 of file switch_ivr_play_say.c.
References switch_dtmf_t::digit, SWITCH_INPUT_TYPE_DTMF, SWITCH_STATUS_BREAK, and SWITCH_STATUS_SUCCESS.
Referenced by switch_ivr_soft_hold().
|
static |
Definition at line 366 of file switch_ivr_play_say.c.
References buf, switch_event::headers, switch_event_header::name, switch_event_header::next, switch_assert, switch_event_add_header_string(), switch_snprintf(), SWITCH_STACK_BOTTOM, and switch_event_header::value.
Referenced by switch_ivr_record_file_event().
|
static |
Definition at line 399 of file switch_ivr_play_say.c.
References get_recording_var(), and switch_true().
Referenced by switch_ivr_record_file_event().
|
static |
Definition at line 3296 of file switch_ivr_play_say.c.
References cJSON_GetObjectCstr(), deliver_asr_event(), switch_dtmf_t::digit, switch_collect_input_state_t::digits, switch_collect_input_state_t::is_speech, switch_collect_input_state_t::last_digit_time, switch_collect_input_state_t::max_digits, switch_collect_input_state_t::original_args, switch_collect_input_state_t::recognition_result, switch_channel_get_name(), SWITCH_CHANNEL_SESSION_LOG, SWITCH_COLLECT_INPUT_DIGITS, SWITCH_COLLECT_INPUT_DIGITS_DONE, SWITCH_COLLECT_INPUT_PROMPT, SWITCH_COLLECT_INPUT_SPEECH, SWITCH_COLLECT_INPUT_SPEECH_DONE, switch_core_session_get_channel(), SWITCH_EVENT_DETECTED_SPEECH, switch_event_get_body(), switch_event_get_header, SWITCH_FALSE, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_INT64_T_FMT, SWITCH_LOG_DEBUG, SWITCH_LOG_INFO, switch_log_printf(), switch_micro_time_now(), switch_set_flag, SWITCH_STATUS_BREAK, SWITCH_STATUS_SUCCESS, switch_test_flag, SWITCH_TRUE, switch_collect_input_state_t::terminator, switch_collect_input_state_t::terminators, and zstr.
Referenced by switch_ivr_play_and_collect_input().
switch_status_t switch_ivr_record_file | ( | switch_core_session_t * | session, |
switch_file_handle_t * | fh, | ||
const char * | file, | ||
switch_input_args_t * | args, | ||
uint32_t | limit | ||
) |
Definition at line 1052 of file switch_ivr_play_say.c.
References switch_ivr_record_file_event().
switch_status_t switch_ivr_record_file_event | ( | switch_core_session_t * | session, |
switch_file_handle_t * | fh, | ||
const char * | file, | ||
switch_input_args_t * | args, | ||
uint32_t | limit, | ||
switch_event_t * | vars | ||
) |
Definition at line 404 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, CF_VIDEO, CF_VIDEO_BLANK, CF_VIDEO_DECODED_READ, CF_VIDEO_ECHO, switch_file_handle::channels, switch_frame::codec, count, switch_frame::data, switch_stream_handle::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, switch_vid_params_s::fps, switch_mm_s::fps, get_recording_var(), switch_vid_params_s::height, switch_codec_implementation::iananame, if(), switch_codec::implementation, switch_input_args_t::input_callback, memset(), merge_recording_variables(), switch_codec_implementation::microseconds_per_packet, switch_file_handle::mm, switch_file_handle::native_rate, switch_codec_implementation::number_of_channels, switch_file_handle::params, switch_file_handle::pre_buffer_datalen, switch_file_handle::prefix, switch_input_args_t::read_frame_callback, recording_var_true(), switch_file_handle::samplerate, switch_frame::samples, switch_file_handle::samples, switch_file_handle::samples_out, switch_codec_implementation::samples_per_packet, SCFC_FLUSH_AUDIO, SFF_CNG, switch_file_handle::silence_hits, switch_directories::sounds_dir, switch_api_execute(), SWITCH_AUDIO_COL_STR_ARTIST, SWITCH_AUDIO_COL_STR_COMMENT, SWITCH_AUDIO_COL_STR_COPYRIGHT, SWITCH_AUDIO_COL_STR_DATE, SWITCH_AUDIO_COL_STR_FILE_SIZE, SWITCH_AUDIO_COL_STR_FILE_TRIMMED, SWITCH_AUDIO_COL_STR_FILE_TRIMMED_MS, SWITCH_AUDIO_COL_STR_SOFTWARE, SWITCH_AUDIO_COL_STR_TITLE, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER, switch_channel_api_on(), switch_channel_clear_flag(), switch_channel_clear_flag_recursive(), switch_channel_dequeue_dtmf(), switch_channel_event_set_data(), switch_channel_execute_on(), switch_channel_execute_on_value(), switch_channel_expand_variables, switch_channel_get_name(), 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_flag_recursive(), 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_file_close(), switch_core_file_command(), switch_core_file_get_string(), switch_core_file_has_video(), switch_core_file_open, switch_core_file_pre_close(), switch_core_file_read(), switch_core_file_seek(), switch_core_file_set_string(), switch_core_file_write(), switch_core_media_gen_key_frame, switch_core_media_get_vid_params(), switch_core_media_lock_video_file(), switch_core_media_set_video_file(), switch_core_media_unlock_video_file(), 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_request_video_refresh, switch_core_session_reset(), switch_core_session_set_read_codec(), switch_core_session_sprintf(), switch_core_session_strdup, switch_core_session_wait_for_video_input_params(), switch_core_session_write_frame(), SWITCH_DEFAULT_FILE_BUFFER_LEN, switch_epoch_time_now(), switch_event_add_header_string(), switch_event_create, switch_event_destroy(), switch_event_fire, switch_event_get_header, SWITCH_EVENT_RECORD_START, SWITCH_EVENT_RECORD_STOP, SWITCH_FALSE, SWITCH_FILE_DATA_SHORT, SWITCH_FILE_FLAG_READ, SWITCH_FILE_FLAG_VIDEO, SWITCH_FILE_FLAG_VIDEO_EOF, SWITCH_FILE_FLAG_WRITE, SWITCH_FILE_NATIVE, SWITCH_FILE_OPEN, SWITCH_FILE_PAUSE, SWITCH_FILE_SEEK, SWITCH_FILE_WRITE_APPEND, SWITCH_FILE_WRITE_OVER, switch_find_end_paren(), switch_generate_sln_silence(), SWITCH_GLOBAL_dirs, SWITCH_INPUT_TYPE_DTMF, SWITCH_INPUT_TYPE_EVENT, SWITCH_IO_FLAG_NONE, switch_is_file_path(), switch_is_valid_rate, switch_ivr_dmachine_feed(), switch_ivr_dmachine_ping(), switch_ivr_parse_all_events(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_LOG_WARNING, SWITCH_PATH_SEPARATOR, SWITCH_READ_ACCEPTABLE, SWITCH_RECOMMENDED_BUFFER_SIZE, SWITCH_RW_READ, SWITCH_RW_WRITE, switch_safe_free, SWITCH_STACK_BOTTOM, SWITCH_STANDARD_STREAM, SWITCH_STATUS_BREAK, SWITCH_STATUS_FALSE, SWITCH_STATUS_GENERR, SWITCH_STATUS_SUCCESS, switch_str_nil, switch_test_flag, SWITCH_TRUE, switch_true(), SWITCH_URL_SEPARATOR, switch_file_handle::thresh, switch_input_args_t::user_data, switch_mm_s::vh, switch_mm_s::vw, switch_vid_params_s::width, and write_buf().
Referenced by switch_ivr_record_file().
|
static |
Definition at line 1058 of file switch_ivr_play_say.c.
References teletone_generation_session::buffer, switch_buffer_write(), teletone_mux_tones(), and teletone_generation_session::user_data.
Referenced by switch_ivr_gentones().