FreeSWITCH API Documentation
1.7.0
|
#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), 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_swigable_cpp.h.
#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_swigable_cpp.h.
#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_swigable_cpp.h.
#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_swigable_cpp.h.
#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_swigable_cpp.h.
typedef struct input_callback_state input_callback_state_t |
enum session_flag_t |
Enumerator | |
---|---|
S_HUP | |
S_FREE | |
S_RDLOCK | |
S_HUP | |
S_FREE | |
S_RDLOCK |
Definition at line 129 of file switch_swigable_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 1394 of file switch_cpp.cpp.
References switch_input_args_t::buf, switch_input_args_t::input_callback, 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().
void console_clean_log | ( | char * | msg | ) |
Definition at line 1375 of file switch_cpp.cpp.
References SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, switch_log_printf(), and switch_str_nil.
Referenced by consoleCleanLog().
void console_log | ( | char * | level_str, |
char * | msg | ||
) |
Definition at line 1351 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().
void console_log2 | ( | char * | level_str, |
char * | file, | ||
char * | func, | ||
int | line, | ||
char * | msg | ||
) |
Definition at line 1363 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().
void consoleCleanLog | ( | char * | msg | ) |
void consoleLog | ( | char * | level_str, |
char * | msg | ||
) |
void consoleLog2 | ( | char * | level_str, |
char * | file, | ||
char * | func, | ||
int | line, | ||
char * | msg | ||
) |
Definition at line 1341 of file switch_cpp.cpp.
References console_log2().
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 1451 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::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 1380 of file switch_cpp.cpp.
References switch_simple_email(), and SWITCH_TRUE.
char* getGlobalVariable | ( | char * | var_name | ) |
Definition at line 1325 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 1428 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::setHangupHook().
bool running | ( | void | ) |
void setGlobalVariable | ( | char * | var_name, |
char * | var_val | ||
) |
Definition at line 1320 of file switch_cpp.cpp.
References switch_core_set_variable().
void switch_msleep | ( | unsigned | ms | ) |