37 #pragma warning(disable:4127 4003) 62 if (!
zstr(event_name)) {
63 bind(event_name, subclass_name);
80 if (
zstr(subclass_name)) {
120 ret =
new Event(event, 1);
164 const char *greeting_sound,
165 const char *short_greeting_sound,
166 const char *invalid_sound,
167 const char *exit_sound,
168 const char *transfer_sound,
169 const char *confirm_macro,
170 const char *confirm_key,
171 const char *tts_engine,
172 const char *tts_voice,
173 int confirm_attempts,
188 exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout,
189 digit_len, timeout, max_failures, max_timeouts,
pool);
251 return (
char *) stream.
data;
283 if ((arg = strchr(mycmd,
' '))) {
291 return (
char *) stream.
data;
298 if (!strcasecmp(type,
"json") && !
zstr(subclass_name)) {
303 event_id =
event->event_id;
321 serialized_string = NULL;
329 serialized_string = NULL;
335 if (serialized_string) {
336 free(serialized_string);
351 if (
zstr(dest_proto)) {
369 if (format && !strcasecmp(format,
"xml")) {
374 return serialized_string;
378 }
else if (format && !strcasecmp(format,
"json")) {
380 return serialized_string;
383 char *new_serialized_string =
switch_mprintf(
"%s", serialized_string);
384 free(serialized_string);
385 serialized_string = new_serialized_string;
386 return serialized_string;
439 if (
zstr(header_name)) {
469 if (
zstr(header_name)) {
521 return (
char *)
"invalid";
533 if (!to_merge || !to_merge->
event) {
547 if (iduration == 0) {
551 duration = iduration;
563 stream_p = &mystream;
588 if (!stream_p->read_function)
return NULL;
590 buff = stream_p->read_function(stream_p, len);
592 if (!buff || *len <= 0) {
597 return (
const char *)buff;
603 stream_p->write_function(stream_p,
"%s", data);
609 stream_p->raw_write_function(stream_p, (uint8_t *)data, len);
616 return stream_p ? (
const char *)stream_p->data : NULL;
636 uuid = strdup(nuuid);
641 if (
switch_ivr_originate(a_leg ? a_leg->
session : NULL, &session, &cause, nuuid, 60, NULL, NULL, NULL, NULL, NULL,
SOF_NONE, NULL, NULL)
658 session = new_session;
668 if (allocated) destroy();
686 return (
char *) (xml_cdr_text ? xml_cdr_text :
"");
694 if (channel && e->
event) {
739 this->begin_allow_threads();
743 this->end_allow_threads();
751 this->begin_allow_threads();
753 this->end_allow_threads();
795 begin_allow_threads();
805 cb_state.funcargs = funcargs;
806 cb_state.function = cbfunc;
808 args.buf = &cb_state;
809 args.buflen =
sizeof(cb_state);
854 begin_allow_threads();
867 tts_name = strdup(tts_name_p);
868 voice_name = strdup(voice_name_p);
882 return collectDigits(0, abs_timeout);
888 begin_allow_threads();
896 return getDigits(maxdigits, terminators, timeout, 0);
901 return getDigits(maxdigits, terminators, timeout, interdigit, 0);
912 begin_allow_threads();
915 memset(dtmf_buf, 0,
sizeof(dtmf_buf));
922 (uint32_t) timeout, (uint32_t)interdigit, (uint32_t)abstimeout);
938 begin_allow_threads();
948 const char *prompt_audio_file,
950 const char *valid_terminators,
955 if (min_digits < 1) {
959 if (max_digits < 1) {
967 begin_allow_threads();
968 switch_ivr_read(session, min_digits, max_digits, prompt_audio_file, NULL, dtmf_buf,
969 sizeof(dtmf_buf), timeout, valid_terminators, (uint32_t)digit_timeout);
981 char *bad_input_audio_files,
983 const char *var_name,
985 const char *transfer_on_failure)
989 begin_allow_threads();
990 memset(dtmf_buf, 0,
sizeof(dtmf_buf));
992 (uint32_t) min_digits,
993 (uint32_t) max_digits,
994 (uint32_t) max_tries,
998 bad_input_audio_files,
1003 (uint32_t) digit_timeout,
1004 transfer_on_failure);
1006 end_allow_threads();
1015 begin_allow_threads();
1019 if (!strcasecmp(arg0,
"grammar") && arg1 && arg2) {
1021 }
else if (!strcasecmp(arg0,
"nogrammar") && arg1) {
1023 }
else if (!strcasecmp(arg0,
"grammaron") && arg1) {
1025 }
else if (!strcasecmp(arg0,
"grammaroff") && arg1) {
1027 }
else if (!strcasecmp(arg0,
"grammarsalloff")) {
1029 }
else if (!strcasecmp(arg0,
"init") && arg1 && arg2) {
1031 }
else if (!strcasecmp(arg0,
"pause")) {
1033 }
else if (!strcasecmp(arg0,
"resume")) {
1035 }
else if (!strcasecmp(arg0,
"stop")) {
1037 }
else if (!strcasecmp(arg0,
"param") && arg1 && arg2) {
1039 }
else if (!strcasecmp(arg0,
"start-input-timers")) {
1041 }
else if (!strcasecmp(arg0,
"start_input_timers")) {
1044 }
else if (arg1 && arg2 && arg3) {
1048 end_allow_threads();
1055 begin_allow_threads();
1057 char *result = NULL;
1070 end_allow_threads();
1072 return result ? strdup(result) : NULL;
1079 if (!(tosay && module_name && say_type && say_method)) {
1083 begin_allow_threads();
1084 switch_ivr_say(session, tosay, module_name, say_type, say_method, say_gender, ap);
1085 end_allow_threads();
1093 if (!(phrase_name)) {
1098 begin_allow_threads();
1100 end_allow_threads();
1113 memset(&local_fh, 0,
sizeof(local_fh));
1115 local_fh.
samples = starting_sample_count;
1119 int maybe = atoi(prebuf);
1125 begin_allow_threads();
1127 end_allow_threads();
1142 begin_allow_threads();
1144 end_allow_threads();
1254 if (a_leg_session != NULL) {
1255 aleg_core_session = a_leg_session->
session;
1304 if (!file_name)
return 0;
1305 memset(&local_fh, 0,
sizeof(local_fh));
1307 local_fh.
thresh = silence_threshold;
1310 begin_allow_threads();
1312 end_allow_threads();
1376 on_hangup = hangup_func;
1381 switch_core_event_hook_add_state_change(session,
hanguphook);
1414 if (
zstr(val)) val = NULL;
1415 if (
zstr(val2)) val2 = NULL;
1486 SWITCH_DECLARE(
bool)
email(
char *
to,
char *from,
char *headers,
char *body,
char *file,
char *convert_cmd,
char *convert_ext)
1505 const char *err =
"Channels not ready\n";
1536 if (session_hungup) {
int flushEvents()
flush any pending events
switch_status_t switch_event_serialize_json(switch_event_t *event, char **str)
void console_clean_log(char *msg)
void consoleCleanLog(char *msg)
switch_time_t switch_micro_time_now(void)
Get the current epoch time in microseconds.
void switch_core_session_hangup_state(switch_core_session_t *session, switch_bool_t force)
switch_channel_state_t switch_channel_get_state(switch_channel_t *channel)
Get the current state of a channel in the state engine.
#define switch_event_fire(event)
Fire an event filling in most of the arguements with obvious values.
#define switch_channel_hangup(channel, hangup_cause)
Hangup a channel flagging it's state machine to end.
void switch_xml_free(_In_opt_ switch_xml_t xml)
frees the memory allocated for an switch_xml structure
#define switch_channel_answer(channel)
Answer a channel (initiate/acknowledge a successful connection)
void set_tts_parms(char *tts_name, char *voice_name)
switch_status_t hanguphook(switch_core_session_t *session_hungup)
the actual hangup hook called back by freeswitch core which in turn gets the session and calls the ap...
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
#define SWITCH_SENSITIVE_DTMF_VARIABLE
#define SWITCH_CHANNEL_SESSION_LOG(x)
#define switch_core_session_force_locate(uuid_str)
Locate a session based on it's uuid even if the channel is not ready.
void execute(const char *app, const char *data=NULL)
#define switch_set_flag(obj, flag)
Set a flag on an arbitrary object.
void hangup(const char *cause="normal_clearing")
switch_status_t switch_event_bind_removable(const char *id, switch_event_types_t event, const char *subclass_name, switch_event_callback_t callback, void *user_data, switch_event_node_t **node)
Bind an event callback to a specific event.
DTMF(char idigit, uint32_t iduration=SWITCH_DEFAULT_DTMF_DURATION)
void consoleLog2(char *level_str, char *file, char *func, int line, char *msg)
#define SWITCH_CHANNEL_LOG
void setGlobalVariable(char *var_name, char *var_val)
#define switch_event_del_header(_e, _h)
const char * execute(const char *command, const char *data=NULL)
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...
void raw_write(const char *data, int len)
#define switch_channel_set_state(channel, state)
Set the current state of a channel.
switch_status_t switch_channel_set_private(switch_channel_t *channel, const char *key, const void *private_info)
Set private data on channel.
const char * switch_channel_cause2str(_In_ switch_call_cause_t cause)
return a cause string for a given cause
const char * hangupCause()
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.
void switch_channel_flush_dtmf(_In_ switch_channel_t *channel)
EventConsumer(const char *event_name=NULL, const char *subclass_name="", int len=5000)
switch_event_types_t
Built-in Events.
int insertFile(const char *file, const char *insert_file, int sample_point)
void switch_sleep(switch_interval_time_t t)
switch_status_t switch_queue_pop_timeout(switch_queue_t *queue, void **data, switch_interval_time_t timeout)
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_channel_up(_channel)
switch_bool_t switch_core_running(void)
void switch_channel_event_set_data(_In_ switch_channel_t *channel, _In_ switch_event_t *event)
Add information about a given channel to an event object.
switch_status_t switch_name_event(const char *name, switch_event_types_t *type)
return the event id that matches a given event name
switch_priority_t
Priority Indication.
char * playAndDetectSpeech(char *file, char *engine, char *grammar)
Play a file and detect speech See API docs switch_ivr_play_and_detect_speech(...) ...
switch_bool_t switch_core_set_var_conditional(_In_z_ const char *varname, _In_opt_z_ const char *value, _In_opt_z_ const char *val2)
Conditionally add a global variable to the core.
switch_status_t switch_api_execute(const char *cmd, const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream)
Execute a registered API command.
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
void console_log2(char *level_str, char *file, char *func, int line, char *msg)
Representation of an event.
switch_status_t process_callback_result(char *result)
#define switch_channel_ready(_channel)
void switch_core_set_variable(_In_z_ const char *varname, _In_opt_z_ const char *value)
Add a global variable to the core.
switch_status_t switch_event_add_body(switch_event_t *event, const char *fmt,...) PRINTF_FUNCTION(2
Add a body to an event.
const char * getType(void)
const char *const const char *const const cJSON *const value
switch_status_t switch_queue_trypop(switch_queue_t *queue, void **data)
bool merge(Event *to_merge)
switch_status_t switch_event_set_priority(switch_event_t *event, switch_priority_t priority)
Set the priority of an event.
#define switch_channel_media_ready(_channel)
int setAutoHangup(bool val)
virtual bool begin_allow_threads()=0
void setPrivate(char *var, void *val)
void consoleLog2(char *level_str, char *file, char *func, int line, char *msg)
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.
#define SWITCH_DEFAULT_DTMF_DURATION
const char * switch_channel_state_name(_In_ switch_channel_state_t state)
Render the name of the provided state enum.
switch_status_t switch_queue_pop(switch_queue_t *queue, void **data)
char const int const cJSON_bool format
void waitForAnswer(CoreSession *calling_session)
switch_status_t switch_event_dup(switch_event_t **event, switch_event_t *todup)
Duplicate an event.
#define switch_event_create_subclass(_e, _eid, _sn)
int sleep(int ms, int sync=0)
uint32_t switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flag)
Test for presence of given flag on a given channel.
bool addBody(const char *value)
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.
void setVariable(char *var, char *val)
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.
int flushDigits()
flush any pending digits
char * getDigits(int maxdigits, char *terminators, int timeout)
#define switch_core_session_execute_application(_a, _b, _c)
Execute an application on a session.
_Ret_ switch_channel_t * switch_core_session_get_channel(_In_ switch_core_session_t *session)
Retrieve a pointer to the channel object associated with a given session.
int chat_execute(const char *app, const char *data=NULL)
switch_status_t switch_core_chat_send(const char *dest_proto, switch_event_t *message_event)
#define switch_clear_flag(obj, flag)
Clear a flag on an arbitrary object while locked.
switch_event_node_t * enodes[SWITCH_EVENT_ALL+1]
int main(int argc, char *argv[])
void switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state)
void sayPhrase(const char *phrase_name, const char *phrase_data="", const char *phrase_lang=NULL)
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
void bridge(CoreSession &session_a, CoreSession &session_b)
bridge the audio of session_b into session_a
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.
void setHangupHook(void *hangup_func)
Set the hangup callback function.
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.
void consoleLog(char *level_str, char *msg)
void switch_event_merge(switch_event_t *event, switch_event_t *tomerge)
switch_log_level_t switch_log_str2level(_In_z_ const char *str)
Return the level number of the specified log level name.
char * switch_event_get_body(switch_event_t *event)
Retrieve the body value from an event.
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_pause_detect_speech(switch_core_session_t *session)
Pause background Speech detection on a session.
#define switch_channel_get_variable(_c, _v)
int streamFile(char *file, int starting_sample_count=0)
Play a file that resides on disk into the channel.
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
int globalSetVariable(const char *var, const char *val, const char *val2)
void set_tts_params(char *tts_name, char *voice_name)
const char * switch_event_name(switch_event_types_t event)
Render the name of an event id enumeration.
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
switch_status_t dtmf_callback(switch_core_session_t *session_cb, void *input, switch_input_type_t itype, void *buf, unsigned int buflen)
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)
void sendEvent(Event *sendME)
const char * getVariable(char *var)
bool delHeader(const char *header_name)
Event * pop(int block=0, int timeout=0)
switch_call_cause_t switch_channel_str2cause(_In_ const char *str)
return a cause code for a given string
virtual switch_status_t run_dtmf_callback(void *input, switch_input_type_t itype)=0
#define SWITCH_CHANNEL_LOG_CLEAN
switch_status_t switch_event_create_json(switch_event_t **event, const char *json)
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.
virtual void destroy(void)
switch_byte_t switch_byte_t uint32_t buflen
int64_t switch_interval_time_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.
#define SWITCH_STANDARD_STREAM(s)
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_call_cause_t cause
switch_channel_state_t hook_state
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.
const char * serialize(const char *format=NULL)
switch_status_t switch_ivr_resume_detect_speech(switch_core_session_t *session)
Resume background Speech detection on a session.
#define this_check_void()
void switch_core_session_rwunlock(_In_ switch_core_session_t *session)
Unlock a read or write lock on as given session.
char * switch_core_session_get_uuid(_In_ switch_core_session_t *session)
Retrieve the unique identifier from a session.
switch_status_t switch_channel_set_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check)
#define sanity_check_noreturn
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
#define switch_str_nil(s)
Make a null string a blank string instead.
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.
int recordFile(char *file_name, int time_limit=0, int silence_threshold=0, int silence_hits=0)
Record to a file.
void switch_msleep(unsigned ms)
char * read(int min_digits, int max_digits, const char *prompt_audio_file, int timeout, const char *valid_terminators, int digit_timeout=0)
static int switch_channel_var_true(switch_channel_t *channel, const char *variable)
Event(const char *type, const char *subclass_name=NULL)
switch_channel_state_t
Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are ...
bool email(char *to, char *from, char *headers, char *body, char *file, char *convert_cmd, char *convert_ext)
bool setPriority(switch_priority_t priority=SWITCH_PRIORITY_NORMAL)
switch_stream_handle_write_function_t write_function
#define switch_channel_down(_channel)
switch_status_t
Common return values.
void * switch_channel_get_private(switch_channel_t *channel, const char *key)
Retrieve private from a given channel.
switch_status_t switch_core_session_read_lock_hangup(_In_ switch_core_session_t *session)
Acquire a read lock on the session.
void setDTMFCallback(void *cbfunc, char *funcargs)
set a DTMF callback function
switch_status_t switch_core_session_dequeue_event(_In_ switch_core_session_t *session, _Out_ switch_event_t **event, switch_bool_t force)
DE-Queue an event on a given session.
char * getGlobalVariable(char *var_name)
switch_status_t switch_core_session_receive_event(_In_ switch_core_session_t *session, _Inout_ switch_event_t **event)
Send an event to a session translating it to it's native message format.
switch_status_t switch_queue_interrupt_all(switch_queue_t *queue)
switch_status_t switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)
Disable all grammars on a background speech detection handle.
static void event_handler(switch_event_t *event)
const switch_input_args_t & get_cb_args() const
Get the callback function arguments associated with this session.
void * getPrivate(char *var)
int transfer(char *extension, char *dialplan=NULL, char *context=NULL)
switch_status_t switch_ivr_set_param_detect_speech(switch_core_session_t *session, const char *name, const char *val)
switch_bool_t switch_simple_email(const char *to, const char *from, const char *headers, const char *body, const char *file, const char *convert_cmd, const char *convert_ext)
#define switch_event_get_header(_e, _h)
switch_call_direction_t switch_channel_direction(switch_channel_t *channel)
switch_status_t switch_core_execute_chat_app(switch_event_t *message, const char *app, const char *data)
switch_status_t switch_queue_trypush(switch_queue_t *queue, void *data)
virtual void check_hangup_hook()=0
Callback to the language specific hangup callback.
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.
const char * executeString(const char *command)
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
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_memory_pool_t * pool
bool addHeader(const char *header_name, const char *value)
switch_status_t switch_queue_create(switch_queue_t **queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
void switch_event_destroy(switch_event_t **event)
Destroy an event.
const char * getHeader(const char *header_name)
char * playAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators, char *audio_files, char *bad_input_audio_files, char *digits_regex, const char *var_name=NULL, int digit_timeout=0, const char *transfer_on_failure=NULL)
Play a file into channel and collect dtmfs.
const char * get_data(void)
switch_status_t switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t *xml_cdr)
Generate an XML CDR report.
#define switch_channel_pre_answer(channel)
Indicate progress on a channel to attempt early media.
switch_status_t switch_event_serialize(switch_event_t *event, char **str, switch_bool_t encode)
char * switch_channel_get_name(switch_channel_t *channel)
Retrieve the name of a given channel.
SWITCH_BEGIN_EXTERN_C char * switch_mprintf(const char *zFormat,...)
void console_log(char *level_str, char *msg)
void detectSpeech(char *arg0, char *arg1=NULL, char *arg2=NULL, char *arg3=NULL)
int chat_send(const char *dest_proto=NULL)
void setEventData(Event *e)
int originate(CoreSession *a_leg_session, char *dest, int timeout=60, switch_state_handler_table_t *handlers=NULL)
Set attributes of caller data for purposes of outgoing calls.
switch_log_level_t
Log Level Enumeration.
virtual bool end_allow_threads()=0
switch_status_t switch_ivr_detect_speech_start_input_timers(switch_core_session_t *session)
Start input timers on a background speech detection handle.
char * switch_core_get_variable_dup(_In_z_ const char *varname)
int collectDigits(int abs_timeout)
void consoleLog(char *level_str, char *msg)
switch_call_cause_t switch_channel_get_cause(_In_ switch_channel_t *channel)
return the cause code for a given channel
void say(const char *tosay, const char *module_name, const char *say_type, const char *say_method, const char *say_gender=NULL)
#define switch_xml_toxml(xml, prn_header)
Converts an switch_xml structure back to xml in html format. Returns a string of html data that \ mus...
void write(const char *data)
const char * read(int *len)
switch_xml_t switch_event_xmlize(switch_event_t *event, const char *fmt,...) PRINTF_FUNCTION(2
Render a XML representation of an event suitable for printing or network transport.
switch_status_t switch_event_unbind(switch_event_node_t **node)
Unbind a bound event consumer.
int bind(const char *event_name, const char *subclass_name="")