diff options
-rw-r--r-- | apps/app_voicemail.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index ddf3e1ec8..34c3c04ef 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -236,8 +236,9 @@ static AST_LIST_HEAD_STATIC(vmstates, vmstate); #define VM_SEARCH (1 << 14) #define VM_TEMPGREETWARN (1 << 15) /*!< Remind user tempgreeting is set */ #define VM_MOVEHEARD (1 << 16) /*!< Move a "heard" message to Old after listening to it */ -#define ERROR_LOCK_PATH -100 +#define ERROR_LOCK_PATH -100 #define ERROR_MAILBOX_FULL -200 +#define OPERATOR_EXIT 300 enum { @@ -4624,7 +4625,7 @@ transfer: pbx_builtin_setvar_helper(chan, "VMSTATUS", "USEREXIT"); } ast_free(tmp); - return 0; + return OPERATOR_EXIT; } /* Allow all other digits to exit Voicemail and return to the dialplan */ @@ -8371,7 +8372,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; } @@ -8421,9 +8422,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 @@ -8614,13 +8614,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); |