]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4775 --resolve use vars voicemail_callback_dialplan and voicemail_callback_context
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 30 Oct 2012 20:33:35 +0000 (15:33 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 30 Oct 2012 20:33:35 +0000 (15:33 -0500)
src/mod/applications/mod_voicemail/mod_voicemail.c

index 8e58bfbac5d654a0ca45c47d1f996e35ef5615e2..e6ce3aecf03b9e218836d71c1c107d2a2f6d134a 100644 (file)
@@ -1604,7 +1604,18 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t
                                *cc.buf = '\0';
                                goto play_file;
                        } else if (!strcmp(input, profile->callback_key)) {
-                               switch_core_session_execute_exten(session, cbt->cid_number, profile->callback_dialplan, profile->callback_context);
+                               const char *callback_dialplan;
+                               const char *callback_context;
+
+                               if (!(callback_dialplan = switch_channel_get_variable(channel, "voicemail_callback_dialplan"))) {
+                                       callback_dialplan = profile->callback_dialplan;
+                               }
+
+                               if (!(callback_context = switch_channel_get_variable(channel, "voicemail_callback_context"))) {
+                                       callback_context = profile->callback_context;
+                               }
+
+                               switch_core_session_execute_exten(session, cbt->cid_number, callback_dialplan, callback_context);
                        } else if (!strcmp(input, profile->forward_key)) {
                                char *cmd = NULL;
                                char *new_file_path = NULL;