[Asterisk-code-review] app_voicemail: Emit warning if asking for nonexistent mailbox. (asterisk[16])
N A
asteriskteam at digium.com
Wed Feb 23 11:31:37 CST 2022
N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/18053 )
Change subject: app_voicemail: Emit warning if asking for nonexistent mailbox.
......................................................................
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
---
M apps/app_voicemail.c
1 file changed, 9 insertions(+), 3 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/18053/1
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 32d867d..336c781 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -11617,10 +11617,16 @@
else
ast_copy_string(vms.username, args.argv0, sizeof(vms.username));
- if (!ast_strlen_zero(vms.username) && (vmu = find_user(&vmus, context ,vms.username)))
- skipuser++;
- else
+ if (!ast_strlen_zero(vms.username)) {
+ if ((vmu = find_user(&vmus, context ,vms.username))) {
+ skipuser++;
+ } else {
+ ast_log(LOG_WARNING, "Mailbox '%s%s%s' doesn't exist\n", vms.username, context ? "@": "", context ? context : "");
+ valid = 0;
+ }
+ } else {
valid = 0;
+ }
}
if (!valid)
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/18053
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4
Gerrit-Change-Number: 18053
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220223/266696fd/attachment.html>
More information about the asterisk-code-review
mailing list