68 #define SWITCH_IVR_VERIFY_SILENCE_DIVISOR(divisor) \ 70 if ((divisor) <= 0 && (divisor) != -1) { \ 149 uint32_t abs_timeout);
168 const char *terminators,
char *terminator,
169 uint32_t first_timeout, uint32_t digit_timeout, uint32_t abs_timeout);
184 const char *mod_name,
187 uint32_t input_timeout,
214 const char *mod_name,
400 const char *
key,
const char *tone_spec,
401 const char *
flags, time_t timeout,
int hits,
419 uint32_t timeout_ms,
const char *file);
422 uint32_t timeout_ms,
const char *file);
425 uint32_t listen_hits, uint32_t timeout_ms,
const char *file);
477 const char *valid_terminators,
478 const char *audio_file,
479 const char *bad_input_audio_file,
480 const char *var_name,
char *digit_buffer, uint32_t digit_buffer_length,
481 const char *digits_regex,
482 uint32_t digit_timeout,
483 const char *transfer_on_failure);
499 const char *tts_name,
const char *voice_name,
const char *text,
switch_input_args_t *args);
520 const char *bridgeto,
521 uint32_t timelimit_sec,
523 const char *cid_name_override,
524 const char *cid_num_override,
533 const char *bridgeto,
534 uint32_t timelimit_sec,
536 const char *cid_name_override,
537 const char *cid_num_override,
557 void *peer_session_data);
586 const char *context);
847 const char *greeting_sound,
848 const char *short_greeting_sound,
849 const char *invalid_sound,
850 const char *exit_sound,
851 const char *transfer_sound,
852 const char *confirm_macro,
853 const char *confirm_key,
854 const char *tts_engine,
855 const char *tts_voice,
856 int confirm_attempts,
857 int inter_timeout,
int digit_len,
int timeout,
int max_failures,
936 #define switch_ivr_phrase_macro(session, macro_name, data, lang, args) switch_ivr_phrase_macro_event(session, macro_name, data, NULL, lang, args) 946 const char *prompt_audio_file,
947 const char *var_name,
951 const char *valid_terminators,
952 uint32_t digit_timeout);
964 const char *module_name,
965 const char *say_type,
966 const char *say_method,
967 const char *say_gender,
974 const char *module_name,
975 const char *say_type,
976 const char *say_method,
977 const char *say_gender,
993 const char *user,
const char *domain,
switch_xml_t x_user);
1010 uint32_t digit_timeout, uint32_t input_timeout,
1089 const char *recognizer_mod_name,
1090 const char *recognizer_grammar,
1093 const char *terminators,
1094 uint32_t digit_timeout,
1095 cJSON **recognition_result,
1096 char **digits_collected,
1097 char *terminator_collected,
switch_status_t switch_ivr_digit_stream_reset(switch_ivr_digit_stream_t *stream)
Reset the collected digit stream to nothing.
uint32_t switch_bind_flag_t
int switch_ivr_set_xml_profile_data(switch_xml_t xml, switch_caller_profile_t *caller_profile, int off)
switch_sockaddr_t * local_addr
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_digit_stream_parser_set_terminator(switch_ivr_digit_stream_parser_t *parser, char digit)
Set a digit string terminator.
const char *const const double number
switch_status_t switch_ivr_parse_all_signal_data(switch_core_session_t *session)
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_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_eavesdrop_exec_all(switch_core_session_t *session, const char *app, const char *arg)
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 i...
switch_status_t switch_ivr_process_indications(switch_core_session_t *session, switch_core_session_message_t *message)
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.
switch_status_t switch_ivr_stop_record_session(switch_core_session_t *session, const char *file)
Stop Recording a session.
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.
#define SWITCH_END_EXTERN_C
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...
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.
#define SWITCH_RECOMMENDED_BUFFER_SIZE
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)
switch_status_t switch_ivr_stop_session_audio(switch_core_session_t *session)
switch_status_t switch_ivr_digit_stream_destroy(switch_ivr_digit_stream_t **stream)
Destroys a digit stream object.
switch_status_t switch_ivr_unhold_uuid(const char *uuid)
Signal the session with a protocol specific unhold message.
switch_status_t switch_ivr_broadcast(const char *uuid, const char *path, switch_media_flag_t flags)
Signal the session to broadcast audio.
switch_memory_pool_t * pool
Representation of an event.
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.
switch_status_t switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args)
switch_status_t dtmf_callback(switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
switch_sockaddr_t * remote_addr
switch_status_t switch_ivr_parse_event(_In_ switch_core_session_t *session, _In_ switch_event_t *event)
Parse command from an event.
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
A representation of an XML tree.
uint32_t switch_originate_flag_t
switch_status_t switch_ivr_parse_all_events(switch_core_session_t *session)
Parse all commands from an event.
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.
Abstract handler to a timer module.
switch_status_t switch_ivr_eavesdrop_pop_eavesdropper(switch_core_session_t *session, switch_core_session_t **sessionp)
struct switch_runtime runtime
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.
switch_status_t switch_ivr_stop_inband_dtmf_session(switch_core_session_t *session)
Stop looking for DTMF inband.
A message object designed to allow unlike technologies to exchange data.
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.
switch_status_t switch_ivr_parse_next_event(switch_core_session_t *session)
void switch_ivr_broadcast_in_thread(switch_core_session_t *session, const char *app, int flags)
int main(int argc, char *argv[])
switch_port_t remote_port
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...
switch_byte_t switch_byte_t * buf
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.
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.
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.
switch_status_t switch_ivr_stop_detect_speech(switch_core_session_t *session)
Stop background Speech detection on a session.
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_pause_detect_speech(switch_core_session_t *session)
Pause background Speech detection on a session.
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.
switch_codec_t read_codec
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_mul...
switch_status_t switch_ivr_uuid_bridge(const char *originator_uuid, const char *originatee_uuid)
Bridge two existing sessions.
switch_status_t(* switch_input_callback_function_t)(switch_core_session_t *session, void *input, switch_input_type_t input_type, void *buf, unsigned int buflen)
switch_status_t switch_ivr_inband_dtmf_session(switch_core_session_t *session)
Start looking for DTMF inband.
switch_status_t switch_ivr_hold_toggle_uuid(const char *uuid, const char *message, switch_bool_t moh)
Toggles channel hold state of session.
An abstraction of a data frame.
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_tone_detect_session(switch_core_session_t *session)
Stop looking for TONES.
switch_status_t switch_ivr_stop_displace_session(switch_core_session_t *session, const char *file)
Stop displacing a session.
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.
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.
switch_status_t(* switch_say_callback_t)(switch_core_session_t *session, char *tosay, switch_say_args_t *say_args, switch_input_args_t *args)
switch_byte_t switch_byte_t uint32_t buflen
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.
uint32_t switch_eavesdrop_flag_t
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.
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.
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.
switch_status_t switch_ivr_stop_inband_dtmf_generate_session(switch_core_session_t *session)
Stop generating DTMF inband.
switch_status_t switch_ivr_resume_detect_speech(switch_core_session_t *session)
Resume background Speech detection on a session.
switch_mutex_t * flag_mutex
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.
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.
switch_status_t switch_ivr_parse_next_signal_data(switch_core_session_t *session)
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.
struct fspr_sockaddr_t switch_sockaddr_t
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
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.
switch_frame_t write_frame
struct fspr_thread_mutex_t switch_mutex_t
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.
switch_status_t switch_ivr_3p_nomedia(const char *uuid, switch_media_flag_t flags)
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.
switch_status_t
Common return values.
switch_status_t(* switch_ivr_dmachine_callback_t)(switch_ivr_dmachine_match_t *match)
const char *const const char *const path
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_bool_t(* switch_tone_detect_callback_t)(switch_core_session_t *, const char *, const char *)
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_unhold(switch_core_session_t *session)
Signal the session with a protocol specific unhold message.
switch_status_t switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)
Disable all grammars on a background speech detection handle.
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_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val)
switch_status_t switch_ivr_eavesdrop_update_display(switch_core_session_t *session, const char *name, const char *number)
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
switch_core_session_t * session
void switch_ivr_bridge_display(switch_core_session_t *session, switch_core_session_t *peer_session)
int switch_ivr_set_xml_chan_vars(switch_xml_t xml, switch_channel_t *channel, int off)
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
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.
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.
uint32_t switch_media_flag_t
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_check_hold(switch_core_session_t *session)
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.
switch_status_t switch_ivr_inband_dtmf_generate_session(switch_core_session_t *session, switch_bool_t read_stream)
Start generating DTMF inband.
switch_status_t switch_ivr_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session)
struct fspr_pool_t switch_memory_pool_t
switch_status_t switch_ivr_deactivate_unicast(switch_core_session_t *session)
switch_status_t switch_ivr_session_echo(switch_core_session_t *session, switch_input_args_t *args)
NEEDDESC -
struct fspr_socket_t switch_socket_t
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.
switch_status_t switch_ivr_3p_media(const char *uuid, switch_media_flag_t flags)
struct fspr_thread_t switch_thread_t
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.
switch_status_t switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t *xml_cdr)
Generate an XML CDR report.
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.
switch_byte_t write_frame_data[SWITCH_RECOMMENDED_BUFFER_SIZE]
switch_status_t switch_ivr_digit_stream_parser_destroy(switch_ivr_digit_stream_parser_t *parser)
Destroy a digit stream parser object.
switch_status_t switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session)
Start input timers on a background speech detection handle.
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.
void switch_ivr_clear_speech_cache(switch_core_session_t *session)
switch_status_t switch_ivr_parse_all_messages(switch_core_session_t *session)
#define SWITCH_BEGIN_EXTERN_C