IVRMenu Class Reference

#include <switch_cpp.h>

Collaboration diagram for IVRMenu:

[legend]

Public Member Functions

 IVRMenu (IVRMenu *main, const char *name, const char *greeting_sound, const char *short_greeting_sound, const char *invalid_sound, const char *exit_sound, const char *confirm_macro, const char *confirm_key, const char *tts_engine, const char *tts_voice, int confirm_attempts, int inter_timeout, int digit_len, int timeout, int max_failures, int max_timeouts)
virtual ~IVRMenu ()
void bindAction (char *action, const char *arg, const char *bind)
void execute (CoreSession *session, const char *name)

Protected Attributes

switch_ivr_menu_tmenu
switch_memory_pool_tpool

Detailed Description

Definition at line 81 of file switch_cpp.h.


Constructor & Destructor Documentation

IVRMenu::IVRMenu ( IVRMenu main,
const char *  name,
const char *  greeting_sound,
const char *  short_greeting_sound,
const char *  invalid_sound,
const char *  exit_sound,
const char *  confirm_macro,
const char *  confirm_key,
const char *  tts_engine,
const char *  tts_voice,
int  confirm_attempts,
int  inter_timeout,
int  digit_len,
int  timeout,
int  max_failures,
int  max_timeouts 
)

Definition at line 126 of file switch_cpp.cpp.

References main(), menu, pool, switch_assert, switch_core_new_memory_pool, switch_ivr_menu_init(), and zstr.

00142 {
00143         menu = NULL;
00144         switch_core_new_memory_pool(&pool);
00145         switch_assert(pool);
00146         if (zstr(name)) {
00147                 name = "no name";
00148         }
00149 
00150         switch_ivr_menu_init(&menu, main ? main->menu : NULL, name, greeting_sound, short_greeting_sound, invalid_sound, 
00151                                                  exit_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout,
00152                                                  digit_len, timeout, max_failures, max_timeouts, pool);
00153         
00154 
00155 }

IVRMenu::~IVRMenu (  )  [virtual]

Definition at line 157 of file switch_cpp.cpp.

References menu, pool, switch_core_destroy_memory_pool, and switch_ivr_menu_stack_free().

00158 {
00159         if (menu) {
00160                 switch_ivr_menu_stack_free(menu);
00161         }
00162         switch_core_destroy_memory_pool(&pool);
00163 }


Member Function Documentation

void IVRMenu::bindAction ( char *  action,
const char *  arg,
const char *  bind 
)

Definition at line 165 of file switch_cpp.cpp.

References SWITCH_CHANNEL_LOG, SWITCH_IVR_ACTION_NOOP, switch_ivr_menu_bind_action(), switch_ivr_menu_str2action(), SWITCH_LOG_DEBUG, SWITCH_LOG_ERROR, switch_log_printf(), SWITCH_STATUS_SUCCESS, and this_check_void.

00166 {
00167         switch_ivr_action_t ivr_action = SWITCH_IVR_ACTION_NOOP;
00168 
00169         this_check_void();
00170         
00171         if (switch_ivr_menu_str2action(action, &ivr_action) == SWITCH_STATUS_SUCCESS) {
00172                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bind %s to %s(%s)\n", bind, action, arg);
00173                 switch_ivr_menu_bind_action(menu, ivr_action, arg, bind);
00174         } else {
00175                 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid action %s\n", action);
00176         }
00177 }

void IVRMenu::execute ( CoreSession session,
const char *  name 
)

Definition at line 179 of file switch_cpp.cpp.

References switch_ivr_menu_execute(), and this_check_void.

00180 {
00181         this_check_void();
00182         switch_ivr_menu_execute(session->session, menu, (char *)name, NULL);
00183 }


Field Documentation

switch_ivr_menu_t* IVRMenu::menu [protected]

Definition at line 83 of file switch_cpp.h.

Referenced by IVRMenu(), and ~IVRMenu().

switch_memory_pool_t* IVRMenu::pool [protected]

Definition at line 84 of file switch_cpp.h.

Referenced by IVRMenu(), and ~IVRMenu().


The documentation for this class was generated from the following files:
Generated on Wed May 16 04:00:23 2012 for FreeSWITCH API Documentation by  doxygen 1.4.7