mod_protovm: Adding basic callback functionnality

This commit is contained in:
Marc Olivier Chouinard 2011-07-09 00:06:03 -04:00
parent b0e0dd2280
commit 8105f79e62
2 changed files with 9 additions and 0 deletions

View File

@ -210,6 +210,14 @@ void mtvm_menu_main(switch_core_session_t *session, vmivr_profile_t *profile) {
mt_api_execute(session, profile->api_msg_save, cmd); mt_api_execute(session, profile->api_msg_save, cmd);
msg_saved = SWITCH_TRUE; msg_saved = SWITCH_TRUE;
} else if (!strcasecmp(action, "callback")) { /* CallBack caller */
const char *cid_num = switch_event_get_header(phrase_params, "VM-Message-Caller-Number");
if (cid_num) {
/* TODO add detection for private number */
switch_core_session_execute_exten(session, cid_num, "XML", profile->domain);
} else {
/* TODO Some error msg that the msg doesn't contain a caller number */
}
} else if (!strncasecmp(action, "menu:", 5)) { /* Sub Menu */ } else if (!strncasecmp(action, "menu:", 5)) { /* Sub Menu */
void (*fPtr)(switch_core_session_t *session, vmivr_profile_t *profile) = mtvm_get_menu_function(action+5); void (*fPtr)(switch_core_session_t *session, vmivr_profile_t *profile) = mtvm_get_menu_function(action+5);
if (fPtr) { if (fPtr) {

View File

@ -58,6 +58,7 @@
<key dtmf="7" action="delete_msg" variable="VM-Key-Main-Delete-File" /> <!-- Same key for undelete if it already deleted --> <key dtmf="7" action="delete_msg" variable="VM-Key-Main-Delete-File" /> <!-- Same key for undelete if it already deleted -->
<key dtmf="8" action="menu:std_forward" variable="VM-Key-Main-Forward" /> <key dtmf="8" action="menu:std_forward" variable="VM-Key-Main-Forward" />
<key dtmf="3" action="save_msg" variable="VM-Key-Main-Save-File" /> <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="5" action="menu:std_preference" />
</keys> </keys>
</menu> </menu>