FreeSWITCH API Documentation  1.7.0
Public Member Functions | Protected Attributes
IVRMenu Class Reference

#include <switch_cpp.h>

+ Collaboration diagram for IVRMenu:

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 *transfer_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)
 
 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 *transfer_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 83 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 *  transfer_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 161 of file switch_cpp.cpp.

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

178 {
179  menu = NULL;
182  if (zstr(name)) {
183  name = "no name";
184  }
185 
186  switch_ivr_menu_init(&menu, main ? main->menu : NULL, name, greeting_sound, short_greeting_sound, invalid_sound,
187  exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout,
188  digit_len, timeout, max_failures, max_timeouts, pool);
189 
190 
191 }
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
Definition: switch_core.h:631
switch_ivr_menu_t * menu
Definition: switch_cpp.h:85
#define zstr(x)
Definition: switch_utils.h:281
switch_memory_pool_t * pool
Definition: switch_cpp.h:86
switch_status_t switch_ivr_menu_init(switch_ivr_menu_t **new_menu, switch_ivr_menu_t *main, const char *name, const char *greeting_sound, const char *short_greeting_sound, const char *invalid_sound, const char *exit_sound, const char *transfer_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, switch_memory_pool_t *pool)
Create a new menu object.
#define switch_assert(expr)
IVRMenu::~IVRMenu ( )
virtual

Definition at line 193 of file switch_cpp.cpp.

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

194 {
195  if (menu) {
197  }
199 }
switch_ivr_menu_t * menu
Definition: switch_cpp.h:85
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
Definition: switch_core.h:640
switch_memory_pool_t * pool
Definition: switch_cpp.h:86
switch_status_t switch_ivr_menu_stack_free(switch_ivr_menu_t *stack)
free a stack of menu objects.
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 *  transfer_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::~IVRMenu ( )
virtual

Member Function Documentation

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

Definition at line 201 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.

202 {
204 
205  this_check_void();
206 
207  if (switch_ivr_menu_str2action(action, &ivr_action) == SWITCH_STATUS_SUCCESS) {
208  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bind %s to %s(%s)\n", bind, action, arg);
209  switch_ivr_menu_bind_action(menu, ivr_action, arg, bind);
210  } else {
211  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid action %s\n", action);
212  }
213 }
#define SWITCH_CHANNEL_LOG
switch_ivr_menu_t * menu
Definition: switch_cpp.h:85
switch_status_t switch_ivr_menu_bind_action(switch_ivr_menu_t *menu, switch_ivr_action_t ivr_action, const char *arg, const char *bind)
switch_ivr_menu_bind_action: Bind a keystroke to an action.
#define this_check_void()
Definition: switch_cpp.h:13
switch_ivr_action_t
Definition: switch_ivr.h:773
switch_status_t switch_ivr_menu_str2action(const char *action_name, switch_ivr_action_t *action)
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.
void IVRMenu::bindAction ( char *  action,
const char *  arg,
const char *  bind 
)
void IVRMenu::execute ( CoreSession session,
const char *  name 
)
void IVRMenu::execute ( CoreSession session,
const char *  name 
)

Definition at line 215 of file switch_cpp.cpp.

References switch_ivr_menu_execute(), and this_check_void.

216 {
217  this_check_void();
218  switch_ivr_menu_execute(session->session, menu, (char *)name, NULL);
219 }
switch_ivr_menu_t * menu
Definition: switch_cpp.h:85
switch_core_session_t * session
Definition: switch_cpp.h:223
switch_status_t switch_ivr_menu_execute(switch_core_session_t *session, switch_ivr_menu_t *stack, char *name, void *obj)
Execute a menu.
#define this_check_void()
Definition: switch_cpp.h:13

Field Documentation

switch_ivr_menu_t * IVRMenu::menu
protected

Definition at line 85 of file switch_cpp.h.

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

switch_memory_pool_t * IVRMenu::pool
protected

Definition at line 86 of file switch_cpp.h.

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


The documentation for this class was generated from the following files: