]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_protovm: Adding basic callback functionnality
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 9 Jul 2011 04:06:03 +0000 (00:06 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Sat, 9 Jul 2011 04:06:03 +0000 (00:06 -0400)
src/mod/applications/mod_protovm/menu.c
src/mod/applications/mod_protovm/protovm.conf.xml

index d48e5473c8e068fccdd6ca4c2ec9366639617a78..3cd22a58841f78c42f6bc67ac022d2bcc2ceacdd 100644 (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);
 
                                        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 */
                                        void (*fPtr)(switch_core_session_t *session, vmivr_profile_t *profile) = mtvm_get_menu_function(action+5);
                                        if (fPtr) {
index 852f6686e1451c3c917093457b5976787d51f743..dc47f1e95c5602f611dae6feedd0b825d4de6c5c 100644 (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="8" action="menu:std_forward" variable="VM-Key-Main-Forward" />
                                <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" />
                        </keys>
                        </menu>