<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16682">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail: Fix phantom voicemail bug on rerecord<br><br>If users are able to press # for options while leaving<br>a message and then press 3 to rerecord the message, if<br>the caller hangs up during the rerecord prompt but before<br>Asterisk starts recording a message, then an "empty"<br>voicemail gets processed whereby an email gets sent out<br>notifying the user of a 0:00 duration message. The file<br>doesn't actually exist, so playback will fail since there<br>was no message to begin with.<br><br>This adds a check after the streaming of the rerecord<br>announcement to see if the caller has hung up. If so,<br>we bail out early so that we can clean up properly.<br><br>ASTERISK-29391 #close<br><br>Change-Id: Id965d72759a2fd3b39afb76fec08aaebebe75c31<br>---<br>M apps/app_voicemail.c<br>1 file changed, 6 insertions(+), 0 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 cb70ed6..39bfd93 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -15590,6 +15590,12 @@</span><br><span>                               }</span><br><span>                            cmd = ast_play_and_wait(chan, "beep");</span><br><span>                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (cmd == -1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                              /* User has hung up, no options to give */</span><br><span style="color: hsl(120, 100%, 40%);">+                            ast_debug(1, "User hung up before message could be rerecorded\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                          ast_filedelete(tempfile, NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+                               return cmd;</span><br><span style="color: hsl(120, 100%, 40%);">+                   }</span><br><span>                    recorded = 1;</span><br><span>                        /* After an attempt has been made to record message, we have to take care of INTRO and beep for incoming messages, but not for greetings */</span><br><span>                  if (record_gain)</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/+/16682">change 16682</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/+/16682"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: Id965d72759a2fd3b39afb76fec08aaebebe75c31 </div>
<div style="display:none"> Gerrit-Change-Number: 16682 </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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>