/* Initialize Menu Configs */
populate_profile_menu_event(profile, &sub_menu);
- id = mtvm_menu_get_input_set(session, profile, sub_menu, "X.", "#" /* TODO Conf terminate input key */);
+ id = mtvm_menu_get_input_set(session, profile, sub_menu, "X.");
if (id) {
const char *cmd = switch_core_session_sprintf(session, "%s %s %s %s %s %s %s%s%s", profile->api_profile, profile->domain, profile->id, profile->current_msg_uuid, profile->domain, id, prepend_filepath?" ":"", prepend_filepath?prepend_filepath:"" );
if (mt_api_execute(session, profile->api_msg_forward, cmd) == SWITCH_STATUS_SUCCESS) {
char *password;
vmivr_menu_profile_t menu = { "std_set_password" };
- password = mtvm_menu_get_input_set(session, profile, menu, "XXX." /* TODO Conf Min 3 Digit */, "#" /* TODO Conf terminate input key */);
+ /* Initialize Menu Configs */
+ populate_profile_menu_event(profile, &menu);
+
+ password = mtvm_menu_get_input_set(session, profile, menu, "XXX." /* TODO Conf Min 3 Digit */);
/* TODO Add Prompts to tell if password was set and if it was not */
if (password) {
char *cmd = switch_core_session_sprintf(session, "%s %s %s %s", profile->api_profile, profile->domain, profile->id, password);
mt_api_execute(session, profile->api_pref_password_set, cmd);
+
}
free_profile_menu_event(&menu);
void mtvm_menu_authenticate(switch_core_session_t *session, vmivr_profile_t *profile) {
switch_channel_t *channel = switch_core_session_get_channel(session);
- vmivr_menu_profile_t menu = { "std_authenticate" };
+ vmivr_menu_profile_t menu = { "std_authenticate" };
int retry;
const char *auth_var = NULL;
/* Initialize Menu Configs */
/* Initialize Menu Configs */
populate_profile_menu_event(profile, &sub_menu);
- id = mtvm_menu_get_input_set(session, profile, sub_menu, "X." /* TODO Conf Min 3 Digit */, "#" /* TODO Conf terminate input key */);
+ id = mtvm_menu_get_input_set(session, profile, sub_menu, "X." /* TODO Conf Min 3 Digit */);
free_profile_menu_event(&sub_menu);
}
if (!password) {
/* Initialize Menu Configs */
populate_profile_menu_event(profile, &sub_menu);
- password = mtvm_menu_get_input_set(session, profile, sub_menu, "X." /* TODO Conf Min 3 Digit */, "#" /* TODO Conf terminate input key */);
+ password = mtvm_menu_get_input_set(session, profile, sub_menu, "X." /* TODO Conf Min 3 Digit */);
free_profile_menu_event(&sub_menu);
}
cmd = switch_core_session_sprintf(session, "%s %s %s %s", profile->api_profile, profile->domain, id, password);
/* Initialize Menu Configs */
populate_profile_menu_event(profile, &menu);
- result = mtvm_menu_get_input_set(session, profile, menu, "X", NULL);
+ result = mtvm_menu_get_input_set(session, profile, menu, "X");
if (result)
gnum = atoi(result);
/* Initialize Menu Configs */
populate_profile_menu_event(profile, &menu);
- result = mtvm_menu_get_input_set(session, profile, menu, "X", NULL);
+ result = mtvm_menu_get_input_set(session, profile, menu, "X");
if (result)
gnum = atoi(result);
free_profile_menu_event(&menu);
}
-char *mtvm_menu_get_input_set(switch_core_session_t *session, vmivr_profile_t *profile, vmivr_menu_profile_t menu, const char *input_mask, const char *terminate_key) {
+char *mtvm_menu_get_input_set(switch_core_session_t *session, vmivr_profile_t *profile, vmivr_menu_profile_t menu, const char *input_mask) {
char *result = NULL;
int retry;
-
+ const char *terminate_key = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
if (!menu.event_keys_dtmf || !menu.event_phrases) {
return result;
}
+ terminate_key = switch_event_get_header(menu.event_keys_action, "ivrengine:terminate_entry");
+
for (retry = MAX_ATTEMPT; switch_channel_ready(channel) && retry > 0; retry--) {
dtmf_ss_t loc;
char *dtmfa[16] = { 0 };
/* Find the last entry and append this one to it */
for (i=0; dtmfa[i] && i < 16; i++){
}
- dtmfa[i] = (char *) input_mask;
+ dtmfa[i] = (char *) input_mask;
captureMenuInitialize(&loc, dtmfa);
- if (terminate_key)
- loc.terminate_key = terminate_key[0]; /* TODO Make this load from the configuration */
+ if (terminate_key) {
+ loc.terminate_key = terminate_key[0];
+ }
captureMenu(session, &loc, switch_event_get_header(menu.event_phrases, "instructions"), NULL, phrase_params, NULL, DEFAULT_IVR_TIMEOUT);
if (loc.result == RES_TIMEOUT) {
<phrase name="instructions" value="enter_id@protovm" />
</phrases>
<keys>
- <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" /> <!-- TODO Make the ivrengine: parsed and the key configurable -->
+ <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" />
</keys>
</menu>
<phrase name="instructions" value="enter_pass@protovm" />
</phrases>
<keys>
- <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" /> <!-- TODO Make the ivrengine: parsed and the key configurable -->
+ <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" />
</keys>
</menu>
<key dtmf="3" action="save_msg" variable="VM-Key-Main-Save-File" />
<key dtmf="2" action="callback" variable="VM-Key-Main-Callback" />
<key dtmf="5" action="menu:std_preference" />
+ <key dtmf="#" action="return" /> <!-- TODO Might Conflict with future fast-forward -->
</keys>
</menu>
<key dtmf="2" action="menu:std_select_greeting_slot" variable="VM-Key-Choose-Greeting" />
<key dtmf="3" action="menu:std_record_name" variable="VM-Key-Record-Name" />
<key dtmf="6" action="menu:std_set_password" variable="VM-Key-Change-Password" />
- <key dtmf="0" action="return" variable="VM-Key-Main-Menu" />
+ <key dtmf="#" action="return" variable="VM-Key-Main-Menu" />
</keys>
</menu>
<phrase name="invalid_extension" value="invalid_extension@protovm" />
</phrases>
<keys>
+ <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" />
</keys>
</menu>
<phrase name="instructions" value="enter_pass@protovm" />
</phrases>
<keys>
+ <key dtmf="#" action="ivrengine:terminate_entry" variable="VM-Key-Terminator" />
</keys>
</menu>
</menus>