<p>Kevin Harwell <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18055">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail: Emit warning if asking for nonexistent mailbox.<br><br>Currently, if VoiceMailMain is called with a mailbox, if that<br>mailbox doesn't exist, then the application silently falls back<br>to prompting the user for the mailbox, as if no arguments were<br>provided.<br><br>However, if a specific mailbox is requested and it doesn't exist,<br>then no warning at all is emitted.<br><br>This fixes this behavior to now warn if a specifically<br>requested mailbox could not be accessed, before falling back to<br>prompting the user for the correct mailbox.<br><br>ASTERISK-29920 #close<br><br>Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4<br>---<br>M apps/app_voicemail.c<br>1 file changed, 9 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index 6dec471..49d30e0 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -11512,10 +11512,16 @@</span><br><span> else</span><br><span> ast_copy_string(vms.username, args.argv0, sizeof(vms.username));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!ast_strlen_zero(vms.username) && (vmu = find_user(&vmus, context ,vms.username)))</span><br><span style="color: hsl(0, 100%, 40%);">- skipuser++;</span><br><span style="color: hsl(0, 100%, 40%);">- else</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!ast_strlen_zero(vms.username)) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if ((vmu = find_user(&vmus, context ,vms.username))) {</span><br><span style="color: hsl(120, 100%, 40%);">+ skipuser++;</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_log(LOG_WARNING, "Mailbox '%s%s%s' doesn't exist\n", vms.username, context ? "@": "", context ? context : "");</span><br><span style="color: hsl(120, 100%, 40%);">+ valid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span> valid = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> if (!valid)</span><br><span></span><br></pre><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18055">change 18055</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/18055"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: Ib4093b88cd661a2cabc5d685777d4e2f0ebd20a4 </div>
<div style="display:none"> Gerrit-Change-Number: 18055 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>