RTS API Documentation
1.10.11
|
#include <switch.h>
Go to the source code of this file.
Data Structures | |
class | IVRMenu |
class | API |
struct | input_callback_state |
class | DTMF |
class | Stream |
class | Event |
class | EventConsumer |
class | CoreSession |
Macros | |
#define | this_check(x) do { if (!this) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "object is not initalized\n"); return x;}} while(0) |
#define | this_check_void() do { if (!this) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "object is not initalized\n"); return;}} while(0) |
#define | sanity_check(x) do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid),SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0) |
#define | sanity_check_noreturn do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid),SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0) |
#define | init_vars() |
Typedefs | |
typedef struct input_callback_state | input_callback_state_t |
Enumerations | |
enum | session_flag_t { S_HUP = (1 << 0), S_FREE = (1 << 1), S_RDLOCK = (1 << 2) } |
Functions | |
void | setGlobalVariable (char *var_name, char *var_val) |
char * | getGlobalVariable (char *var_name) |
void | consoleLog (char *level_str, char *msg) |
void | consoleLog2 (char *level_str, char *file, char *func, int line, char *msg) |
void | consoleCleanLog (char *msg) |
bool | running (void) |
bool | email (char *to, char *from, char *headers=NULL, char *body=NULL, char *file=NULL, char *convert_cmd=NULL, char *convert_ext=NULL) |
void | console_log (char *level_str, char *msg) |
void | console_log2 (char *level_str, char *file, char *func, int line, char *msg) |
void | console_clean_log (char *msg) |
void | switch_msleep (unsigned ms) |
void | bridge (CoreSession &session_a, CoreSession &session_b) |
bridge the audio of session_b into session_a More... | |
switch_status_t | hanguphook (switch_core_session_t *session) |
the actual hangup hook called back by freeswitch core which in turn gets the session and calls the appropriate instance method to complete the callback. More... | |
switch_status_t | dtmf_callback (switch_core_session_t *session, void *input, switch_input_type_t itype, void *buf, unsigned int buflen) |
#define init_vars | ( | ) |
Definition at line 16 of file switch_cpp.h.
Referenced by CoreSession::CoreSession(), and CoreSession::destroy().
#define sanity_check | ( | x | ) | do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid),SWITCH_LOG_ERROR, "session is not initalized\n"); return x;}} while(0) |
Definition at line 14 of file switch_cpp.h.
Referenced by CoreSession::answer(), CoreSession::answered(), CoreSession::bridged(), CoreSession::collectDigits(), CoreSession::flushDigits(), CoreSession::flushEvents(), CoreSession::getDigits(), CoreSession::getPrivate(), CoreSession::getVariable(), CoreSession::getXMLCDR(), CoreSession::insertFile(), CoreSession::mediaReady(), CoreSession::playAndDetectSpeech(), CoreSession::playAndGetDigits(), CoreSession::preAnswer(), CoreSession::print(), CoreSession::process_callback_result(), CoreSession::read(), CoreSession::ready(), CoreSession::recordFile(), CoreSession::setAutoHangup(), CoreSession::sleep(), CoreSession::speak(), CoreSession::streamFile(), and CoreSession::transfer().
#define sanity_check_noreturn do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_UUID_LOG(uuid),SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0) |
Definition at line 15 of file switch_cpp.h.
Referenced by CoreSession::detectSpeech(), CoreSession::execute(), CoreSession::hangup(), CoreSession::hangupState(), CoreSession::say(), CoreSession::sayPhrase(), CoreSession::sendEvent(), CoreSession::set_tts_params(), CoreSession::set_tts_parms(), CoreSession::setDTMFCallback(), CoreSession::setEventData(), CoreSession::setHangupHook(), CoreSession::setPrivate(), CoreSession::setVariable(), and CoreSession::waitForAnswer().
#define this_check | ( | x | ) | do { if (!this) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "object is not initalized\n"); return x;}} while(0) |
Definition at line 12 of file switch_cpp.h.
Referenced by Event::addBody(), Event::addHeader(), CoreSession::answer(), CoreSession::answered(), CoreSession::bridged(), CoreSession::collectDigits(), Event::delHeader(), API::execute(), API::executeString(), Event::fire(), CoreSession::flushDigits(), CoreSession::flushEvents(), Stream::get_data(), Event::getBody(), CoreSession::getDigits(), Event::getHeader(), CoreSession::getPrivate(), CoreSession::getState(), Event::getType(), CoreSession::getVariable(), CoreSession::getXMLCDR(), CoreSession::hangupCause(), CoreSession::insertFile(), CoreSession::mediaReady(), Event::merge(), CoreSession::originate(), CoreSession::playAndDetectSpeech(), CoreSession::playAndGetDigits(), CoreSession::preAnswer(), CoreSession::print(), CoreSession::process_callback_result(), Stream::read(), CoreSession::read(), CoreSession::ready(), CoreSession::recordFile(), Event::serialize(), CoreSession::setAutoHangup(), Event::setPriority(), CoreSession::sleep(), CoreSession::speak(), CoreSession::streamFile(), and CoreSession::transfer().
#define this_check_void | ( | ) | do { if (!this) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_ERROR, "object is not initalized\n"); return;}} while(0) |
Definition at line 13 of file switch_cpp.h.
Referenced by IVRMenu::bindAction(), CoreSession::CoreSession(), CoreSession::destroy(), CoreSession::detectSpeech(), IVRMenu::execute(), CoreSession::execute(), CoreSession::hangup(), Stream::raw_write(), CoreSession::say(), CoreSession::sayPhrase(), CoreSession::sendEvent(), CoreSession::set_tts_params(), CoreSession::set_tts_parms(), CoreSession::setDTMFCallback(), CoreSession::setEventData(), CoreSession::setHangupHook(), CoreSession::setPrivate(), CoreSession::setVariable(), CoreSession::waitForAnswer(), and Stream::write().
typedef struct input_callback_state input_callback_state_t |
enum session_flag_t |
Enumerator | |
---|---|
S_HUP | |
S_FREE | |
S_RDLOCK |
Definition at line 129 of file switch_cpp.h.
void bridge | ( | CoreSession & | session_a, |
CoreSession & | session_b | ||
) |
bridge the audio of session_b into session_a
NOTE: the stuff regarding the dtmf callback might be completely wrong and has not been reviewed or tested
Definition at line 1500 of file switch_cpp.cpp.
References CoreSession::allocated, CoreSession::begin_allow_threads(), switch_input_args_t::buf, CoreSession::end_allow_threads(), CoreSession::get_cb_args(), switch_input_args_t::input_callback, CoreSession::session, SWITCH_CALL_DIRECTION_INBOUND, switch_channel_direction(), switch_channel_media_ready, switch_channel_pre_answer, switch_channel_ready, SWITCH_CHANNEL_SESSION_LOG, switch_core_session_get_channel(), switch_ivr_multi_threaded_bridge(), SWITCH_LOG_ERROR, and switch_log_printf().
Referenced by CoreSession::get_cb_args(), and switch_channel_set_timestamps().
void console_clean_log | ( | char * | msg | ) |
Definition at line 1481 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, switch_log_printf(), and switch_str_nil.
Referenced by consoleCleanLog(), and CoreSession::get_cb_args().
void console_log | ( | char * | level_str, |
char * | msg | ||
) |
Definition at line 1456 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, SWITCH_LOG_INVALID, switch_log_printf(), switch_log_str2level(), and switch_str_nil.
Referenced by consoleLog(), and CoreSession::get_cb_args().
void console_log2 | ( | char * | level_str, |
char * | file, | ||
char * | func, | ||
int | line, | ||
char * | msg | ||
) |
Definition at line 1469 of file switch_cpp.cpp.
References SWITCH_CHANNEL_ID_LOG, SWITCH_LOG_DEBUG, SWITCH_LOG_INVALID, switch_log_printf(), switch_log_str2level(), and switch_str_nil.
Referenced by consoleLog2(), and CoreSession::get_cb_args().
void consoleCleanLog | ( | char * | msg | ) |
void consoleLog | ( | char * | level_str, |
char * | msg | ||
) |
Definition at line 1441 of file switch_cpp.cpp.
References console_log().
Referenced by CoreSession::get_cb_args().
void consoleLog2 | ( | char * | level_str, |
char * | file, | ||
char * | func, | ||
int | line, | ||
char * | msg | ||
) |
Definition at line 1446 of file switch_cpp.cpp.
References console_log2().
Referenced by CoreSession::get_cb_args().
switch_status_t dtmf_callback | ( | switch_core_session_t * | session, |
void * | input, | ||
switch_input_type_t | itype, | ||
void * | buf, | ||
unsigned int | buflen | ||
) |
Definition at line 1557 of file switch_cpp.cpp.
References CoreSession::run_dtmf_callback(), switch_channel_get_private(), switch_core_session_get_channel(), and SWITCH_STATUS_FALSE.
Referenced by CoreSession::get_cb_args(), and CoreSession::setDTMFCallback().
bool email | ( | char * | to, |
char * | from, | ||
char * | headers = NULL , |
||
char * | body = NULL , |
||
char * | file = NULL , |
||
char * | convert_cmd = NULL , |
||
char * | convert_ext = NULL |
||
) |
Definition at line 1486 of file switch_cpp.cpp.
References switch_simple_email(), and SWITCH_TRUE.
char* getGlobalVariable | ( | char * | var_name | ) |
Definition at line 1430 of file switch_cpp.cpp.
References switch_core_get_variable_dup().
switch_status_t hanguphook | ( | switch_core_session_t * | session | ) |
the actual hangup hook called back by freeswitch core which in turn gets the session and calls the appropriate instance method to complete the callback.
Definition at line 1534 of file switch_cpp.cpp.
References CoreSession::cause, CoreSession::check_hangup_hook(), CoreSession::hook_state, switch_channel_get_cause(), switch_channel_get_private(), switch_channel_get_state(), SWITCH_CHANNEL_LOG, switch_core_session_get_channel(), SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_FALSE, and SWITCH_STATUS_SUCCESS.
Referenced by CoreSession::get_cb_args(), and CoreSession::setHangupHook().
bool running | ( | void | ) |
void setGlobalVariable | ( | char * | var_name, |
char * | var_val | ||
) |
Definition at line 1425 of file switch_cpp.cpp.
References switch_core_set_variable().
void switch_msleep | ( | unsigned | ms | ) |
Definition at line 1494 of file switch_cpp.cpp.
References switch_sleep().
Referenced by CoreSession::get_cb_args().