Skip to content

Commit 39820e3

Browse files
InterLinked1Friendly Automation
authored and
Friendly Automation
committed
app_voicemail: Emit warning if asking for nonexistent mailbox.
Currently, if VoiceMailMain is called with a mailbox, if that mailbox doesn't exist, then the application silently falls back to prompting the user for the mailbox, as if no arguments were provided. However, if a specific mailbox is requested and it doesn't exist, then no warning at all is emitted. This fixes this behavior to now warn if a specifically requested mailbox could not be accessed, before falling back to prompting the user for the correct mailbox. ASTERISK-29920 #close Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4
1 parent a2aa881 commit 39820e3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

apps/app_voicemail.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11512,10 +11512,16 @@ static int vm_execmain(struct ast_channel *chan, const char *data)
1151211512
else
1151311513
ast_copy_string(vms.username, args.argv0, sizeof(vms.username));
1151411514

11515-
if (!ast_strlen_zero(vms.username) && (vmu = find_user(&vmus, context ,vms.username)))
11516-
skipuser++;
11517-
else
11515+
if (!ast_strlen_zero(vms.username)) {
11516+
if ((vmu = find_user(&vmus, context ,vms.username))) {
11517+
skipuser++;
11518+
} else {
11519+
ast_log(LOG_WARNING, "Mailbox '%s%s%s' doesn't exist\n", vms.username, context ? "@": "", context ? context : "");
11520+
valid = 0;
11521+
}
11522+
} else {
1151811523
valid = 0;
11524+
}
1151911525
}
1152011526

1152111527
if (!valid)

0 commit comments

Comments
 (0)