]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Voicemail transfer to operator should occur immediately, not after main menu.
authorJeff Peeler <jpeeler@digium.com>
Tue, 4 May 2010 18:46:46 +0000 (18:46 +0000)
committerJeff Peeler <jpeeler@digium.com>
Tue, 4 May 2010 18:46:46 +0000 (18:46 +0000)
There were two scenarios in the advanced options that while using the
operator=yes and review=yes options, the transfer occurred only after exiting
the main menu (after sending a reply or leaving a message for an extension).
Now after the audio is processed for the reply or message the transfer occurs
immediately as expected.

ABE-2107
ABE-2108

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@260923 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index c8bf5b4dcbd2dd6dd8195c94018c90ba0cbb775e..03dd532a823d178bc5b0ff87e51ace15e3946087 100644 (file)
@@ -212,6 +212,7 @@ static struct vmstate *vmstates = NULL;
 #define VM_TEMPGREETWARN (1 << 15)  /*!< Remind user tempgreeting is set */
 #define ERROR_LOCK_PATH  -100
 #define ERROR_MAILBOX_FULL     -200
+#define OPERATOR_EXIT          300
 
 
 enum {
@@ -4275,7 +4276,7 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                        free_user(vmu);
                        pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT");
                }
-               return 0;
+               return OPERATOR_EXIT;
        }
        if (res < 0) {
                free_user(vmu);
@@ -7764,7 +7765,7 @@ static int vm_execmain(struct ast_channel *chan, void *data)
                                case '1': /* Reply */
                                        if (vms.lastmsg > -1 && !vms.starting) {
                                                cmd = advanced_options(chan, vmu, &vms, vms.curmsg, 1, record_gain);
-                                               if (cmd == ERROR_LOCK_PATH) {
+                                               if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
                                                        res = cmd;
                                                        goto out;
                                                }
@@ -7816,9 +7817,8 @@ static int vm_execmain(struct ast_channel *chan, void *data)
                                case '5': /* Leave VoiceMail */
                                        if (ast_test_flag(vmu, VM_SVMAIL)) {
                                                cmd = forward_message(chan, context, &vms, vmu, vmfmts, 1, record_gain);
-                                               if (cmd == ERROR_LOCK_PATH) {
+                                               if (cmd == ERROR_LOCK_PATH || cmd == OPERATOR_EXIT) {
                                                        res = cmd;
-                                                       ast_log(LOG_WARNING, "forward_message failed to lock path.\n");
                                                        goto out;
                                                }
                                        } else
@@ -8010,13 +8010,14 @@ out:
        if (res > -1) {
                ast_stopstream(chan);
                adsi_goodbye(chan);
-               if (valid) {
+               if (valid && res != OPERATOR_EXIT) {
                        if (silentexit)
                                res = ast_play_and_wait(chan, "vm-dialout");
                        else 
                                res = ast_play_and_wait(chan, "vm-goodbye");
-                       if (res > 0)
-                               res = 0;
+               }
+               if ((valid && res > 0) || res == OPERATOR_EXIT) {
+                       res = 0;
                }
                if (useadsi)
                        ast_adsi_unload_session(chan);