Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

switch_cpp.h File Reference


Data Structures

class  IVRMenu
class  API
struct  input_callback_state
class  Stream
class  Event
class  CoreSession

Defines

#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");}} while(0)
#define sanity_check(x)   do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,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_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
#define init_vars()   do { allocated = 0; session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; xml_cdr_text = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)

Typedefs

typedef 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 consoleLog (char *level_str, char *msg)
void consoleCleanLog (char *msg)
void console_log (char *level_str, char *msg)
void console_clean_log (char *msg)
void bridge (CoreSession &session_a, CoreSession &session_b)
 bridge the audio of session_b into session_a
 SWITCH_DECLARE_NONSTD (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.

Variables

void * input
void switch_input_type_t itype
void switch_input_type_t void * buf
void switch_input_type_t void
unsigned int 
buflen


Define Documentation

 
#define init_vars  )     do { allocated = 0; session = NULL; channel = NULL; uuid = NULL; tts_name = NULL; voice_name = NULL; xml_cdr_text = NULL; memset(&args, 0, sizeof(args)); ap = NULL; caller_profile.source = "mod_unknown"; caller_profile.dialplan = ""; caller_profile.context = ""; caller_profile.caller_id_name = ""; caller_profile.caller_id_number = ""; caller_profile.network_addr = ""; caller_profile.ani = ""; caller_profile.aniii = ""; caller_profile.rdnis = ""; caller_profile.username = ""; on_hangup = NULL; memset(&cb_state, 0, sizeof(cb_state)); hook_state = CS_NEW; } while(0)
 

#define sanity_check  )     do { if (!(session && allocated)) { switch_log_printf(SWITCH_CHANNEL_LOG,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_LOG,SWITCH_LOG_ERROR, "session is not initalized\n"); return;}} while(0)
 

#define this_check  )     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");}} while(0)
 


Typedef Documentation

typedef struct input_callback_state input_callback_state_t
 


Enumeration Type Documentation

enum session_flag_t
 

Enumeration values:
S_HUP 
S_FREE 
S_RDLOCK 
00116              {
00117         S_HUP = (1 << 0),
00118         S_FREE = (1 << 1),
00119         S_RDLOCK = (1 << 2)
00120 } session_flag_t;


Function Documentation

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

00975 {
00976     switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bridge called, session_a uuid: %s\n", session_a.get_uuid());
00977         switch_input_callback_function_t dtmf_func = NULL;
00978         switch_input_args_t args;
00979 
00980         session_a.begin_allow_threads();
00981         args = session_a.get_cb_args();  // get the cb_args data structure for session a
00982         dtmf_func = args.input_callback;   // get the call back function
00983         switch_ivr_multi_threaded_bridge(session_a.session, session_b.session, dtmf_func, args.buf, args.buf);
00984         session_a.end_allow_threads();
00985 
00986 }

void console_clean_log char *  msg  ) 
 

00969 {
00970     switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN,SWITCH_LOG_DEBUG, "%s", switch_str_nil(msg));
00971 }

void console_log char *  level_str,
char *  msg
 

00957 {
00958     switch_log_level_t level = SWITCH_LOG_DEBUG;
00959     if (level_str) {
00960         level = switch_log_str2level(level_str);
00961                 if (level == SWITCH_LOG_INVALID) {
00962                         level = SWITCH_LOG_DEBUG;
00963                 }
00964     }
00965     switch_log_printf(SWITCH_CHANNEL_LOG, level, "%s", switch_str_nil(msg));
00966 }

void consoleCleanLog char *  msg  ) 
 

00952 {
00953         return console_clean_log(msg);
00954 }

void consoleLog char *  level_str,
char *  msg
 

00947 {
00948         return console_log(level_str, msg);
00949 }

SWITCH_DECLARE_NONSTD switch_status_t   ) 
 

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.

00089 {
00090         switch_size_t nwrite;
00091         FILE *out = switch_core_get_console();
00092 
00093         if (out) {
00094                 nwrite = fwrite(data, datalen, 1, out);
00095                 if (nwrite != datalen) {
00096                         return SWITCH_STATUS_FALSE;
00097                 }
00098                 return SWITCH_STATUS_SUCCESS;
00099         }
00100 
00101         return SWITCH_STATUS_FALSE;
00102 }

Here is the call graph for this function:


Variable Documentation

void switch_input_type_t void* buf
 

void switch_input_type_t void unsigned int buflen
 

void* input
 

void switch_input_type_t itype
 


Generated on Mon May 26 22:06:52 2008 for FreeSWITCH by  doxygen 1.3.9.1