diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 84b1f31017..9b89a66398 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -6607,13 +6607,22 @@ static int vm_options(struct ast_channel *chan, struct ast_vm_user *vmu, struct cmd = 't'; break; default: - cmd = ast_play_and_wait(chan, "vm-options"); - if (!cmd) + snprintf(prefile, sizeof(prefile), "%s%s/%s/temp", VM_SPOOL_DIR, vmu->context, vms->username); + if (ast_fileexists(prefile, NULL, NULL)) { + cmd = ast_play_and_wait(chan, "vm-tmpexists"); + } + if (!cmd) { + cmd = ast_play_and_wait(chan, "vm-options"); + } + if (!cmd) { cmd = ast_waitfordigit(chan, 6000); - if (!cmd) + } + if (!cmd) { retries++; - if (retries > 3) + } + if (retries > 3) { cmd = 't'; + } } } if (cmd == 't')