RTS API Documentation  1.10.11
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)
 

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 ( 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 162 of file switch_cpp.cpp.

References menu, EventConsumer::pool, switch_assert, switch_core_destroy_memory_pool, switch_core_new_memory_pool, SWITCH_DECLARE_CONSTRUCTOR, switch_ivr_menu_init(), switch_ivr_menu_stack_free(), and zstr.

179 {
180  menu = NULL;
183  if (zstr(name)) {
184  name = "no name";
185  }
186 
187  switch_ivr_menu_init(&menu, main ? main->menu : NULL, name, greeting_sound, short_greeting_sound, invalid_sound,
188  exit_sound, transfer_sound, confirm_macro, confirm_key, tts_engine, tts_voice, confirm_attempts, inter_timeout,
189  digit_len, timeout, max_failures, max_timeouts, pool);
190 
191 
192 }
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core&#39;s master pool.
Definition: switch_core.h:633
#define zstr(x)
Definition: switch_utils.h:314
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.
switch_ivr_menu_t * menu
Definition: switch_cpp.h:85
const char *const name
Definition: switch_cJSON.h:250
#define switch_assert(expr)

◆ ~ IVRMenu()

virtual IVRMenu::~ IVRMenu ( )
virtual

Member Function Documentation

◆ bindAction()

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

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

203 {
205 
206  this_check_void();
207 
208  if (switch_ivr_menu_str2action(action, &ivr_action) == SWITCH_STATUS_SUCCESS) {
209  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "bind %s to %s(%s)\n", bind, action, arg);
210  switch_ivr_menu_bind_action(menu, ivr_action, arg, bind);
211  } else {
212  switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid action %s\n", action);
213  }
214 }
#define SWITCH_CHANNEL_LOG
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_menu_t * menu
Definition: switch_cpp.h:85
switch_ivr_action_t
Definition: switch_ivr.h:806
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.

◆ execute()

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

Definition at line 216 of file switch_cpp.cpp.

References CoreSession::session, switch_ivr_menu_execute(), and this_check_void.

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

Field Documentation

◆ menu

switch_ivr_menu_t* IVRMenu::menu
protected

Definition at line 85 of file switch_cpp.h.

Referenced by IVRMenu().

◆ pool

switch_memory_pool_t* IVRMenu::pool
protected

Definition at line 86 of file switch_cpp.h.


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