2006-01-26 18:00:27 +00:00
|
|
|
/*
|
|
|
|
* FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
* Copyright (C) 2005/2006, Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
*
|
|
|
|
* Version: MPL 1.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
|
|
|
* Portions created by the Initial Developer are Copyright (C)
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Anthony Minessale II <anthmct@yahoo.com>
|
2006-11-13 16:29:16 +00:00
|
|
|
* Neal Horman <neal at wanlink dot com>
|
2007-06-04 22:10:42 +00:00
|
|
|
* Bret McDanel <trixter AT 0xdecafbad dot com>
|
2006-01-26 18:00:27 +00:00
|
|
|
*
|
|
|
|
* switch_ivr.h -- IVR Library
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @file switch_ivr.h
|
|
|
|
* @brief IVR Library
|
|
|
|
* @see switch_ivr
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SWITCH_IVR_H
|
|
|
|
#define SWITCH_IVR_H
|
|
|
|
|
|
|
|
#include <switch.h>
|
|
|
|
|
2006-09-07 14:23:31 +00:00
|
|
|
SWITCH_BEGIN_EXTERN_C
|
2007-04-09 18:38:47 +00:00
|
|
|
|
|
|
|
struct switch_unicast_conninfo {
|
|
|
|
switch_core_session_t *session;
|
|
|
|
switch_codec_t read_codec;
|
|
|
|
switch_frame_t write_frame;
|
|
|
|
switch_byte_t write_frame_data[SWITCH_RECOMMENDED_BUFFER_SIZE];
|
|
|
|
switch_socket_t *socket;
|
|
|
|
char *local_ip;
|
2007-04-10 17:34:53 +00:00
|
|
|
switch_port_t local_port;
|
2007-04-09 18:38:47 +00:00
|
|
|
char *remote_ip;
|
2007-04-10 17:34:53 +00:00
|
|
|
switch_port_t remote_port;
|
2007-04-09 18:38:47 +00:00
|
|
|
switch_sockaddr_t *local_addr;
|
|
|
|
switch_sockaddr_t *remote_addr;
|
|
|
|
switch_mutex_t *flag_mutex;
|
|
|
|
int32_t flags;
|
|
|
|
int type;
|
|
|
|
int transport;
|
|
|
|
int stream_id;
|
|
|
|
};
|
|
|
|
typedef struct switch_unicast_conninfo switch_unicast_conninfo_t;
|
|
|
|
|
|
|
|
|
2006-01-26 18:00:27 +00:00
|
|
|
/**
|
|
|
|
* @defgroup switch_ivr IVR Library
|
2006-04-12 16:34:34 +00:00
|
|
|
* @ingroup core1
|
2006-01-26 18:00:27 +00:00
|
|
|
* A group of core functions to do IVR related functions designed to be
|
|
|
|
* building blocks for a higher level IVR interface.
|
|
|
|
* @{
|
|
|
|
*/
|
2007-04-09 18:38:47 +00:00
|
|
|
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_deactivate_unicast(switch_core_session_t *session);
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_activate_unicast(switch_core_session_t *session,
|
|
|
|
char *local_ip,
|
2007-04-10 17:34:53 +00:00
|
|
|
switch_port_t local_port,
|
2007-04-09 18:38:47 +00:00
|
|
|
char *remote_ip,
|
2007-04-10 17:34:53 +00:00
|
|
|
switch_port_t remote_port,
|
2007-04-13 16:24:02 +00:00
|
|
|
char *transport,
|
|
|
|
char *flags);
|
2007-04-09 18:38:47 +00:00
|
|
|
|
2007-02-14 15:19:01 +00:00
|
|
|
/*!
|
|
|
|
\brief Generate an XML CDR report.
|
|
|
|
\param session the session to get the data from.
|
|
|
|
\param xml_cdr pointer to the xml_record
|
|
|
|
\return SWITCH_STATUS_SUCCESS if successful
|
|
|
|
\note on success the xml object must be freed
|
|
|
|
*/
|
2007-03-29 22:31:56 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t * xml_cdr);
|
2007-02-14 15:19:01 +00:00
|
|
|
|
2007-01-06 17:06:18 +00:00
|
|
|
/*!
|
|
|
|
\brief Parse command from an event
|
2007-05-14 23:50:38 +00:00
|
|
|
\param session the session on which to parse the event
|
|
|
|
\param event the event to parse
|
2007-01-06 17:06:18 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if successful
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_event(switch_core_session_t *session, switch_event_t *event);
|
|
|
|
|
2007-05-14 23:50:38 +00:00
|
|
|
/*!
|
|
|
|
\brief Parse all commands from an event
|
|
|
|
\param session the session on which to parse the events
|
|
|
|
\return SWITCH_STATUS_SUCCESS if successful
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session);
|
|
|
|
|
2006-07-13 13:20:20 +00:00
|
|
|
/*!
|
|
|
|
\brief Wait for time to pass for a specified number of milliseconds
|
|
|
|
\param session the session to wait for.
|
|
|
|
\param ms the number of milliseconds
|
|
|
|
\return SWITCH_STATUS_SUCCESS if the channel is still up
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, uint32_t ms);
|
|
|
|
|
2007-02-16 21:32:49 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_park(switch_core_session_t *session, switch_input_args_t *args);
|
2006-09-07 03:58:01 +00:00
|
|
|
|
2006-01-27 21:33:45 +00:00
|
|
|
/*!
|
|
|
|
\brief Wait for DTMF digits calling a pluggable callback function when digits are collected.
|
|
|
|
\param session the session to read.
|
2007-04-09 18:42:40 +00:00
|
|
|
\param args arguements to pass for callbacks etc
|
2006-11-09 05:39:04 +00:00
|
|
|
\param timeout a timeout in milliseconds
|
2006-01-27 21:33:45 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_callback(switch_core_session_t *session, switch_input_args_t *args, uint32_t timeout);
|
2006-01-27 21:33:45 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Wait for specified number of DTMF digits, untile terminator is received or until the channel hangs up.
|
|
|
|
\param session the session to read.
|
|
|
|
\param buf strig to write to
|
|
|
|
\param buflen max size of buf
|
|
|
|
\param maxdigits max number of digits to read
|
|
|
|
\param terminators digits to end the collection
|
|
|
|
\param terminator actual digit that caused the collection to end (if any)
|
2006-03-07 20:31:48 +00:00
|
|
|
\param timeout timeout in ms
|
2006-01-27 21:33:45 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS to keep the collection moving.
|
|
|
|
*/
|
2006-04-29 23:43:28 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_collect_digits_count(switch_core_session_t *session,
|
2006-06-09 22:59:13 +00:00
|
|
|
char *buf,
|
2006-11-12 00:38:31 +00:00
|
|
|
uint32_t buflen,
|
2007-03-30 00:13:31 +00:00
|
|
|
uint32_t maxdigits, const char *terminators, char *terminator, uint32_t timeout);
|
2006-09-09 03:39:28 +00:00
|
|
|
|
2006-11-09 05:39:04 +00:00
|
|
|
/*!
|
|
|
|
\brief Engage background Speech detection on a session
|
|
|
|
\param session the session to attach
|
|
|
|
\param mod_name the module name of the ASR library
|
|
|
|
\param grammar the grammar name
|
|
|
|
\param path the path to the grammar file
|
|
|
|
\param dest the destination address
|
|
|
|
\param ah an ASR handle to use (NULL to create one)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *session,
|
2007-03-30 00:13:31 +00:00
|
|
|
char *mod_name, char *grammar, char *path, char *dest, switch_asr_handle_t *ah);
|
2006-11-09 05:39:04 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Stop background Speech detection on a session
|
|
|
|
\param session The session to stop detection on
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_session_t *session);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Pause background Speech detection on a session
|
|
|
|
\param session The session to pause detection on
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_pause_detect_speech(switch_core_session_t *session);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Resume background Speech detection on a session
|
|
|
|
\param session The session to resume detection on
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_session_t *session);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Load a grammar on a background speech detection handle
|
|
|
|
\param session The session to change the grammar on
|
|
|
|
\param grammar the grammar name
|
|
|
|
\param path the grammar path
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *path);
|
2006-11-09 05:39:04 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Unload a grammar on a background speech detection handle
|
|
|
|
\param session The session to change the grammar on
|
|
|
|
\param grammar the grammar name
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, char *grammar);
|
|
|
|
|
2006-09-09 03:39:28 +00:00
|
|
|
/*!
|
|
|
|
\brief Record a session to disk
|
|
|
|
\param session the session to record
|
|
|
|
\param file the path to the file
|
|
|
|
\param fh file handle to use (NULL for builtin one)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-05-31 14:42:23 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t *session, char *file, uint32_t limit, switch_file_handle_t *fh);
|
2006-09-09 03:39:28 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Stop Recording a session
|
|
|
|
\param session the session to stop recording
|
|
|
|
\param file the path to the file
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_record_session(switch_core_session_t *session, char *file);
|
|
|
|
|
2007-06-04 22:10:42 +00:00
|
|
|
/*!
|
|
|
|
\brief Start looking for DTMF inband
|
|
|
|
\param session the session to start looking
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-02-03 04:09:43 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_inband_dtmf_session(switch_core_session_t *session);
|
2007-06-04 22:10:42 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Stop looking for DTMF inband
|
|
|
|
\param session the session to stop looking
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-02-03 04:09:43 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_inband_dtmf_session(switch_core_session_t *session);
|
2007-06-04 22:10:42 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief XXX DESCRIBE ME
|
|
|
|
\param session the session to act on
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well - maybe more XXX FIXME
|
|
|
|
*/
|
2007-04-19 21:40:50 +00:00
|
|
|
SWITCH_DECLARE(void) switch_ivr_session_echo(switch_core_session_t *session);
|
2007-02-03 04:09:43 +00:00
|
|
|
|
2007-06-04 22:10:42 +00:00
|
|
|
/*!
|
|
|
|
\brief Stop looking for FAX CNG
|
|
|
|
\param session the session to stop looking
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_stop_fax_detect_session(switch_core_session_t *session);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Start looking for FAX CNG
|
|
|
|
\param session the session to start looking
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_fax_detect_session(switch_core_session_t *session);
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-01-26 18:00:27 +00:00
|
|
|
/*!
|
|
|
|
\brief play a file from the disk to the session
|
|
|
|
\param session the session to play the file too
|
2006-03-07 20:31:48 +00:00
|
|
|
\param fh file handle to use (NULL for builtin one)
|
2006-01-26 18:00:27 +00:00
|
|
|
\param file the path to the file
|
2007-04-09 18:42:40 +00:00
|
|
|
\param args arguements to pass for callbacks etc
|
2006-01-26 18:00:27 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *session, switch_file_handle_t *fh, char *file, switch_input_args_t *args);
|
2006-01-27 01:46:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief record a file from the session to a file
|
|
|
|
\param session the session to record from
|
2006-03-07 20:31:48 +00:00
|
|
|
\param fh file handle to use
|
2006-01-27 01:46:14 +00:00
|
|
|
\param file the path to the file
|
2007-04-09 18:42:40 +00:00
|
|
|
\param args arguements to pass for callbacks etc
|
2006-11-28 21:46:29 +00:00
|
|
|
\param limit max limit to record for (0 for infinite)
|
2006-01-27 01:46:14 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2006-04-29 23:43:28 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *session,
|
2007-03-30 00:13:31 +00:00
|
|
|
switch_file_handle_t *fh, char *file, switch_input_args_t *args, uint32_t limit);
|
2006-01-27 21:33:45 +00:00
|
|
|
|
2006-10-28 04:40:59 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Play a sound and gather digits with the number of retries specified if the user doesn't give digits in the set time
|
|
|
|
\param session the current session to play sound to and collect digits
|
|
|
|
\param min_digits the fewest digits allowed for the response to be valid
|
|
|
|
\param max_digits the max number of digits to accept
|
|
|
|
\param max_tries number of times to replay the sound and capture digits
|
|
|
|
\param timeout time to wait for input (this is per iteration, so total possible time = max_tries * (timeout + audio playback length)
|
|
|
|
\param valid_terminators for input that can include # or * (useful for variable length prompts)
|
|
|
|
\param audio_file file to play
|
|
|
|
\param bad_input_audio_file file to play if the input from the user was invalid
|
|
|
|
\param digit_buffer variable digits captured will be put back into (empty if capture failed)
|
|
|
|
\param digit_buffer_length length of the buffer for digits (should be the same or larger than max_digits)
|
2006-11-11 17:36:44 +00:00
|
|
|
\param digits_regex the qualifying regex
|
2006-10-28 04:40:59 +00:00
|
|
|
\return switch status, used to note status of channel (will still return success if digit capture failed)
|
2006-11-11 17:36:44 +00:00
|
|
|
\note to test for digit capture failure look for \\0 in the first position of the buffer
|
2006-10-28 04:40:59 +00:00
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_play_and_get_digits(switch_core_session_t *session,
|
2007-03-29 22:31:56 +00:00
|
|
|
uint32_t min_digits,
|
|
|
|
uint32_t max_digits,
|
|
|
|
uint32_t max_tries,
|
|
|
|
uint32_t timeout,
|
|
|
|
char *valid_terminators,
|
|
|
|
char *audio_file,
|
2007-03-30 00:15:25 +00:00
|
|
|
char *bad_input_audio_file, void *digit_buffer, uint32_t digit_buffer_length,
|
|
|
|
char *digits_regex);
|
2006-01-27 21:33:45 +00:00
|
|
|
|
2006-06-08 01:58:37 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session_t *session,
|
2007-03-29 22:31:56 +00:00
|
|
|
switch_speech_handle_t *sh,
|
2007-03-30 00:13:31 +00:00
|
|
|
switch_codec_t *codec, switch_timer_t *timer, char *text, switch_input_args_t *args);
|
2006-06-08 01:58:37 +00:00
|
|
|
|
2006-03-01 00:58:32 +00:00
|
|
|
/*!
|
|
|
|
\brief Speak given text with given tts engine
|
|
|
|
\param session the session to speak on
|
2006-03-07 20:31:48 +00:00
|
|
|
\param tts_name the desired tts module
|
2006-03-01 00:58:32 +00:00
|
|
|
\param voice_name the desired voice
|
|
|
|
\param rate the sample rate
|
|
|
|
\param text the text to speak
|
2007-04-09 18:42:40 +00:00
|
|
|
\param args arguements to pass for callbacks etc
|
2006-03-01 00:58:32 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-29 22:31:56 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text(switch_core_session_t *session,
|
2007-03-30 00:13:31 +00:00
|
|
|
char *tts_name, char *voice_name, uint32_t rate, char *text, switch_input_args_t *args);
|
2006-06-08 01:58:37 +00:00
|
|
|
|
2006-08-15 19:38:14 +00:00
|
|
|
/*!
|
|
|
|
\brief Make an outgoing call
|
|
|
|
\param session originating session
|
|
|
|
\param bleg B leg session
|
2006-09-12 01:32:04 +00:00
|
|
|
\param cause a pointer to hold call cause
|
2006-08-15 19:38:14 +00:00
|
|
|
\param bridgeto the desired remote callstring
|
2006-08-17 00:53:09 +00:00
|
|
|
\param timelimit_sec timeout in seconds for outgoing call
|
2006-08-16 00:35:02 +00:00
|
|
|
\param table optional state handler table to install on the channel
|
|
|
|
\param cid_name_override override the caller id name
|
|
|
|
\param cid_num_override override the caller id number
|
2006-08-21 19:14:51 +00:00
|
|
|
\param caller_profile_override override the entire calling caller profile
|
2006-08-15 19:38:14 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if bleg is a running session.
|
2007-04-13 22:15:58 +00:00
|
|
|
\note bleg will be read locked which must be unlocked with switch_core_session_rwunlock() before losing scope
|
2006-08-15 19:38:14 +00:00
|
|
|
*/
|
2006-08-16 00:35:02 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *session,
|
|
|
|
switch_core_session_t **bleg,
|
2006-09-12 01:32:04 +00:00
|
|
|
switch_call_cause_t *cause,
|
2006-08-16 00:35:02 +00:00
|
|
|
char *bridgeto,
|
2006-08-17 00:53:09 +00:00
|
|
|
uint32_t timelimit_sec,
|
2006-08-16 00:35:02 +00:00
|
|
|
const switch_state_handler_table_t *table,
|
2007-03-30 00:13:31 +00:00
|
|
|
char *cid_name_override, char *cid_num_override, switch_caller_profile_t *caller_profile_override);
|
2006-02-26 20:23:23 +00:00
|
|
|
|
2006-03-01 00:58:32 +00:00
|
|
|
/*!
|
|
|
|
\brief Bridge Audio from one session to another
|
|
|
|
\param session one session
|
|
|
|
\param peer_session the other session
|
2007-04-09 18:42:40 +00:00
|
|
|
\param dtmf_callback a callback for messages and dtmf
|
2006-03-01 05:52:42 +00:00
|
|
|
\param session_data data to pass to the DTMF callback for session
|
|
|
|
\param peer_session_data data to pass to the DTMF callback for peer_session
|
2006-03-01 00:58:32 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-29 22:31:56 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_multi_threaded_bridge(switch_core_session_t *session,
|
2006-08-17 00:53:09 +00:00
|
|
|
switch_core_session_t *peer_session,
|
2007-03-30 00:15:25 +00:00
|
|
|
switch_input_callback_function_t dtmf_callback, void *session_data,
|
|
|
|
void *peer_session_data);
|
2006-03-01 00:58:32 +00:00
|
|
|
|
2006-10-06 22:39:49 +00:00
|
|
|
/*!
|
|
|
|
\brief Bridge Signalling from one session to another
|
|
|
|
\param session one session
|
|
|
|
\param peer_session the other session
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_signal_bridge(switch_core_session_t *session, switch_core_session_t *peer_session);
|
2006-04-28 19:46:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Transfer an existing session to another location
|
|
|
|
\param session the session to transfer
|
|
|
|
\param extension the new extension
|
|
|
|
\param dialplan the new dialplan (OPTIONAL, may be NULL)
|
|
|
|
\param context the new context (OPTIONAL, may be NULL)
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_session_transfer(switch_core_session_t *session, char *extension, char *dialplan, char *context);
|
2006-04-28 19:46:57 +00:00
|
|
|
|
2007-03-28 23:37:12 +00:00
|
|
|
/*!
|
|
|
|
\brief Transfer an existing session to another location in the future
|
|
|
|
\param runtime the time (int epoch seconds) to transfer the call
|
|
|
|
\param uuid the uuid of the session to transfer
|
|
|
|
\param extension the new extension
|
|
|
|
\param dialplan the new dialplan (OPTIONAL, may be NULL)
|
|
|
|
\param context the new context (OPTIONAL, may be NULL)
|
|
|
|
\return the id of the task
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_transfer(time_t runtime, char *uuid, char *extension, char *dialplan, char *context);
|
2007-03-28 23:37:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Hangup an existing session in the future
|
|
|
|
\param runtime the time (int epoch seconds) to transfer the call
|
|
|
|
\param uuid the uuid of the session to hangup
|
|
|
|
\param cause the hanup cause code
|
|
|
|
\param bleg hangup up the B-Leg if possible
|
|
|
|
\return the id of the task
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_hangup(time_t runtime, char *uuid, switch_call_cause_t cause, switch_bool_t bleg);
|
2007-03-28 23:37:12 +00:00
|
|
|
|
2006-09-19 02:18:24 +00:00
|
|
|
/*!
|
|
|
|
\brief Bridge two existing sessions
|
|
|
|
\param originator_uuid the uuid of the originator
|
|
|
|
\param originatee_uuid the uuid of the originator
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(char *originator_uuid, char *originatee_uuid);
|
|
|
|
|
2006-10-31 21:38:06 +00:00
|
|
|
/*!
|
|
|
|
\brief Signal a session to request direct media access to it's remote end
|
|
|
|
\param uuid the uuid of the session to request
|
|
|
|
\param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in media mode)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_media(char *uuid, switch_media_flag_t flags);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Signal a session to request indirect media allowing it to exchange media directly with another device
|
|
|
|
\param uuid the uuid of the session to request
|
|
|
|
\param flags flags to influence behaviour (SMF_REBRIDGE to rebridge the call in no_media mode)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(char *uuid, switch_media_flag_t flags);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Signal the session with a protocol specific hold message.
|
|
|
|
\param uuid the uuid of the session to hold
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(char *uuid);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Signal the session with a protocol specific unhold message.
|
|
|
|
\param uuid the uuid of the session to hold
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_unhold_uuid(char *uuid);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Signal the session with a protocol specific hold message.
|
|
|
|
\param session the session to hold
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold(switch_core_session_t *session);
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Signal the session with a protocol specific unhold message.
|
2006-11-11 17:36:44 +00:00
|
|
|
\param session the session to unhold
|
2006-10-31 21:38:06 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session);
|
|
|
|
|
2007-03-28 23:37:12 +00:00
|
|
|
/*!
|
|
|
|
\brief Signal the session to broadcast audio in the future
|
|
|
|
\param runtime when (in epoch time) to run the broadcast
|
|
|
|
\param uuid the uuid of the session to broadcast on
|
|
|
|
\param path the path data of the broadcast "/path/to/file.wav [<timer name>]" or "speak:<engine>|<voice>|<Text to say>"
|
|
|
|
\param flags flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call)
|
|
|
|
\return the id of the task
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(uint32_t) switch_ivr_schedule_broadcast(time_t runtime, char *uuid, char *path, switch_media_flag_t flags);
|
2007-03-28 23:37:12 +00:00
|
|
|
|
2006-10-31 21:38:06 +00:00
|
|
|
/*!
|
|
|
|
\brief Signal the session to broadcast audio
|
|
|
|
\param uuid the uuid of the session to broadcast on
|
|
|
|
\param path the path data of the broadcast "/path/to/file.wav [<timer name>]" or "speak:<engine>|<voice>|<Text to say>"
|
|
|
|
\param flags flags to send to the request (SMF_ECHO_BRIDGED to send the broadcast to both sides of the call)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_broadcast(char *uuid, char *path, switch_media_flag_t flags);
|
|
|
|
|
2006-10-05 14:24:25 +00:00
|
|
|
/*!
|
|
|
|
\brief Transfer variables from one session to another
|
|
|
|
\param sessa the original session
|
|
|
|
\param sessb the new session
|
|
|
|
\param var the name of the variable to transfer (NULL for all)
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_transfer_variable(switch_core_session_t *sessa, switch_core_session_t *sessb, char *var);
|
2006-10-05 14:24:25 +00:00
|
|
|
|
2006-11-13 16:29:16 +00:00
|
|
|
|
2006-12-10 22:22:28 +00:00
|
|
|
/******************************************************************************************************/
|
|
|
|
|
2007-03-29 22:31:56 +00:00
|
|
|
struct switch_ivr_digit_stream_parser;
|
|
|
|
typedef struct switch_ivr_digit_stream_parser switch_ivr_digit_stream_parser_t;
|
|
|
|
struct switch_ivr_digit_stream;
|
|
|
|
typedef struct switch_ivr_digit_stream switch_ivr_digit_stream_t;
|
2006-11-13 16:29:16 +00:00
|
|
|
/*!
|
|
|
|
\brief Create a digit stream parser object
|
|
|
|
\param pool the pool to use for the new hash
|
|
|
|
\param parser a pointer to the object pointer
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:15:25 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_new(switch_memory_pool_t *pool, switch_ivr_digit_stream_parser_t ** parser);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Destroy a digit stream parser object
|
2006-12-10 22:22:28 +00:00
|
|
|
\param parser a pointer to the parser object
|
2006-11-13 16:29:16 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_destroy(switch_ivr_digit_stream_parser_t * parser);
|
2006-12-10 22:22:28 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Create a new digit stream object
|
|
|
|
\param parser a pointer to the parser object created by switch_ivr_digit_stream_parser_new
|
|
|
|
\param stream a pointer to the stream object pointer
|
|
|
|
\return NULL if no match found or consumer data that was associated with a given digit string when matched
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_new(switch_ivr_digit_stream_parser_t * parser, switch_ivr_digit_stream_t ** stream);
|
2006-12-10 22:22:28 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Destroys a digit stream object
|
|
|
|
\param stream a pointer to the stream object
|
|
|
|
\return NULL if no match found or consumer data that was associated with a given digit string when matched
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_destroy(switch_ivr_digit_stream_t * stream);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Set a digit string to action mapping
|
|
|
|
\param parser a pointer to the parser object created by switch_ivr_digit_stream_parser_new
|
|
|
|
\param digits a string of digits to associate with an action
|
|
|
|
\param data consumer data attached to this digit string
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_event(switch_ivr_digit_stream_parser_t * parser, char *digits, void *data);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Delete a string to action mapping
|
|
|
|
\param parser a pointer to the parser object created by switch_ivr_digit_stream_parser_new
|
|
|
|
\param digits the digit string to be removed from the map
|
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_del_event(switch_ivr_digit_stream_parser_t * parser, char *digits);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
2006-11-13 17:41:45 +00:00
|
|
|
\brief Feed digits collected into the stream for event match testing
|
2006-11-13 16:29:16 +00:00
|
|
|
\param parser a pointer to the parser object created by switch_ivr_digit_stream_parser_new
|
2007-04-09 18:42:40 +00:00
|
|
|
\param stream a stream to write data to
|
2006-11-13 16:29:16 +00:00
|
|
|
\param digit a digit to collect and test against the map of digit strings
|
|
|
|
\return NULL if no match found or consumer data that was associated with a given digit string when matched
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(void *) switch_ivr_digit_stream_parser_feed(switch_ivr_digit_stream_parser_t * parser, switch_ivr_digit_stream_t * stream, char digit);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Reset the collected digit stream to nothing
|
2006-12-10 22:22:28 +00:00
|
|
|
\param stream a pointer to the parser stream object created by switch_ivr_digit_stream_new
|
2006-11-13 16:29:16 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_reset(switch_ivr_digit_stream_t * stream);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\brief Set a digit string terminator
|
|
|
|
\param parser a pointer to the parser object created by switch_ivr_digit_stream_parser_new
|
2006-12-01 16:00:16 +00:00
|
|
|
\param digit the terminator digit
|
2006-11-13 16:29:16 +00:00
|
|
|
\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_digit_stream_parser_set_terminator(switch_ivr_digit_stream_parser_t * parser, char digit);
|
2006-11-13 16:29:16 +00:00
|
|
|
|
2006-12-10 22:22:28 +00:00
|
|
|
|
|
|
|
/******************************************************************************************************/
|
|
|
|
|
|
|
|
|
2006-01-26 18:00:27 +00:00
|
|
|
/** @} */
|
|
|
|
|
2006-11-12 00:32:18 +00:00
|
|
|
/**
|
|
|
|
* @defgroup switch_ivr_menu IVR Menu Library
|
|
|
|
* @ingroup switch_ivr
|
|
|
|
* IVR menu functions
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2007-03-29 22:31:56 +00:00
|
|
|
typedef enum {
|
|
|
|
SWITCH_IVR_MENU_FLAG_FALLTOMAIN = (1 << 0),
|
|
|
|
SWITCH_IVR_MENU_FLAG_FREEPOOL = (1 << 1),
|
2007-06-08 14:52:50 +00:00
|
|
|
SWITCH_IVR_MENU_FLAG_STACK = (1 << 2)
|
2007-03-29 22:31:56 +00:00
|
|
|
} switch_ivr_menu_flags;
|
2006-11-12 00:32:18 +00:00
|
|
|
/* Actions are either set in switch_ivr_menu_bind_function or returned by a callback */
|
2007-03-29 22:31:56 +00:00
|
|
|
typedef enum {
|
|
|
|
SWITCH_IVR_ACTION_DIE, /* Exit the menu. */
|
|
|
|
SWITCH_IVR_ACTION_EXECMENU, /* Goto another menu in the stack. */
|
|
|
|
SWITCH_IVR_ACTION_EXECAPP, /* Execute an application. */
|
|
|
|
SWITCH_IVR_ACTION_PLAYSOUND, /* Play a sound. */
|
|
|
|
SWITCH_IVR_ACTION_SAYTEXT, /* say text. */
|
|
|
|
SWITCH_IVR_ACTION_SAYPHRASE, /* say a phrase macro. */
|
|
|
|
SWITCH_IVR_ACTION_BACK, /* Go back 1 menu. */
|
|
|
|
SWITCH_IVR_ACTION_TOMAIN, /* Go back to the top level menu. */
|
|
|
|
SWITCH_IVR_ACTION_TRANSFER, /* Transfer caller to another ext. */
|
2007-06-08 14:52:50 +00:00
|
|
|
SWITCH_IVR_ACTION_NOOP /* No operation */
|
2007-03-29 22:31:56 +00:00
|
|
|
} switch_ivr_action_t;
|
|
|
|
struct switch_ivr_menu;
|
2007-03-30 00:13:31 +00:00
|
|
|
typedef switch_ivr_action_t switch_ivr_menu_action_function_t(struct switch_ivr_menu *, char *, char *, size_t, void *);
|
2007-03-29 22:31:56 +00:00
|
|
|
typedef struct switch_ivr_menu switch_ivr_menu_t;
|
|
|
|
typedef struct switch_ivr_menu_action switch_ivr_menu_action_t;
|
2006-11-12 00:32:18 +00:00
|
|
|
/******************************************************************************************************/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
*\brief Create a new menu object.
|
2006-11-12 21:16:46 +00:00
|
|
|
*\param new_menu the pointer to the new menu
|
2006-11-12 00:32:18 +00:00
|
|
|
*\param main The top level menu, (NULL if this is the top level one).
|
|
|
|
*\param name A pointer to the name of this menu.
|
|
|
|
*\param greeting_sound Optional pointer to a main sound (press 1 for this 2 for that).
|
|
|
|
*\param short_greeting_sound Optional pointer to a shorter main sound for subsequent loops.
|
2007-04-09 18:42:40 +00:00
|
|
|
*\param exit_sound Optional pointer to a sound to play upon exiting the menu.
|
2006-11-12 00:32:18 +00:00
|
|
|
*\param invalid_sound Optional pointer to a sound to play after invalid input.
|
2007-04-09 18:42:40 +00:00
|
|
|
*\param tts_engine Text To Speech engine name.
|
|
|
|
*\param tts_voice Text To Speech engine voice name.
|
|
|
|
*\param phrase_lang the language to use for the phrase macros.
|
2006-11-12 00:32:18 +00:00
|
|
|
*\param timeout A number of milliseconds to pause before looping.
|
|
|
|
*\param max_failures Maximum number of failures to withstand before hangingup This resets everytime you enter the menu.
|
2007-04-09 18:42:40 +00:00
|
|
|
*\param pool memory pool (NULL to create one).
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if the menu was created.
|
2006-11-12 00:32:18 +00:00
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_init(switch_ivr_menu_t ** new_menu,
|
|
|
|
switch_ivr_menu_t * main,
|
|
|
|
const char *name,
|
|
|
|
const char *greeting_sound,
|
|
|
|
const char *short_greeting_sound,
|
|
|
|
const char *exit_sound,
|
|
|
|
const char *invalid_sound,
|
|
|
|
const char *tts_engine,
|
|
|
|
const char *tts_voice,
|
2007-03-30 00:15:25 +00:00
|
|
|
const char *phrase_lang, int timeout, int max_failures, switch_memory_pool_t *pool);
|
2006-11-12 00:32:18 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
*\brief switch_ivr_menu_bind_action: Bind a keystroke to an action.
|
|
|
|
*\param menu The menu obj you wish to bind to.
|
|
|
|
*\param ivr_action switch_ivr_action_t enum of what you want to do.
|
|
|
|
*\param arg Optional (sometimes necessary) string arguement.
|
|
|
|
*\param bind KeyStrokes to bind the action to.
|
|
|
|
*\return SWUTCH_STATUS_SUCCESS if the action was binded
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_action(switch_ivr_menu_t * menu, switch_ivr_action_t ivr_action, const char *arg, const char *bind);
|
2006-11-12 00:32:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
*\brief Bind a keystroke to a callback function.
|
|
|
|
*\param menu The menu obj you wish to bind to.
|
|
|
|
*\param function The function to call [int proto(struct switch_ivr_menu *, char *, size_t, void *)]
|
2006-12-04 05:41:03 +00:00
|
|
|
*\param arg Optional (sometimes necessary) string arguement.
|
2006-11-12 00:32:18 +00:00
|
|
|
*\param bind KeyStrokes to bind the action to.
|
|
|
|
*\note The function is passed a buffer to fill in with any required argument data.
|
|
|
|
*\note The function is also passed an optional void pointer to an object set upon menu execution. (think threads)
|
|
|
|
*\note The function returns an switch_ivr_action_t enum of what you want to do. and looks to your buffer for args.
|
|
|
|
*\return SWUTCH_STATUS_SUCCESS if the function was binded
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_bind_function(switch_ivr_menu_t * menu,
|
|
|
|
switch_ivr_menu_action_function_t * function, const char *arg, const char *bind);
|
2006-11-12 00:32:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
*\brief Execute a menu.
|
|
|
|
*\param session The session running the menu.
|
|
|
|
*\param stack The top-level menu object (the first one you created.)
|
|
|
|
*\param name A pointer to the name of the menu.
|
|
|
|
*\param obj A void pointer to an object you want to make avaliable to your callback functions that you may have binded with switch_ivr_menu_bind_function.
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t * stack, char *name, void *obj);
|
2006-11-12 00:32:18 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
*\brief free a stack of menu objects.
|
|
|
|
*\param stack The top level menu you wish to destroy.
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if the object was a top level menu and it was freed
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_free(switch_ivr_menu_t * stack);
|
2006-11-12 00:32:18 +00:00
|
|
|
|
2007-03-29 22:31:56 +00:00
|
|
|
struct switch_ivr_menu_xml_ctx;
|
|
|
|
typedef struct switch_ivr_menu_xml_ctx switch_ivr_menu_xml_ctx_t;
|
2006-11-13 16:29:16 +00:00
|
|
|
/*!
|
2006-12-04 05:41:03 +00:00
|
|
|
*\brief Build a menu stack from an xml source
|
|
|
|
*\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init
|
2006-11-13 16:29:16 +00:00
|
|
|
*\param menu_stack The menu stack object that will be created for you
|
|
|
|
*\param xml_menus The xml Menus source
|
|
|
|
*\param xml_menu The xml Menu source of the menu to be created
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_build(switch_ivr_menu_xml_ctx_t * xml_menu_ctx,
|
|
|
|
switch_ivr_menu_t ** menu_stack, switch_xml_t xml_menus, switch_xml_t xml_menu);
|
2006-12-04 05:41:03 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
*\param xml_menu_ctx The XML menu parser context previously created by switch_ivr_menu_stack_xml_init
|
|
|
|
*\param name The xml tag name to add to the parser engine
|
|
|
|
*\param function The menu function callback that will be executed when menu digits are bound to this name
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_add_custom(switch_ivr_menu_xml_ctx_t * xml_menu_ctx,
|
|
|
|
char *name, switch_ivr_menu_action_function_t * function);
|
2006-12-04 05:41:03 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
*\param xml_menu_ctx A pointer of a XML menu parser context to be created
|
|
|
|
*\param pool memory pool (NULL to create one)
|
|
|
|
*\return SWITCH_STATUS_SUCCESS if all is well
|
|
|
|
*/
|
2007-03-30 00:15:25 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_menu_stack_xml_init(switch_ivr_menu_xml_ctx_t ** xml_menu_ctx, switch_memory_pool_t *pool);
|
2006-12-04 05:41:03 +00:00
|
|
|
|
2007-03-30 00:15:25 +00:00
|
|
|
SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro(switch_core_session_t *session, char *macro_name, char *data, char *lang,
|
|
|
|
switch_input_args_t *args);
|
2006-11-12 00:32:18 +00:00
|
|
|
/** @} */
|
|
|
|
|
2007-03-30 00:13:31 +00:00
|
|
|
SWITCH_END_EXTERN_C
|
2006-01-26 18:00:27 +00:00
|
|
|
#endif
|
2006-11-27 22:30:48 +00:00
|
|
|
/* For Emacs:
|
|
|
|
* Local Variables:
|
|
|
|
* mode:c
|
2007-02-09 02:36:03 +00:00
|
|
|
* indent-tabs-mode:t
|
2006-11-27 22:30:48 +00:00
|
|
|
* tab-width:4
|
|
|
|
* c-basic-offset:4
|
|
|
|
* End:
|
|
|
|
* For VIM:
|
|
|
|
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
|
|
|
|
*/
|