]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
voicemail beep shouldn't be played till we get next message number (bug #2594)
authorRussell Bryant <russell@russellbryant.com>
Fri, 8 Oct 2004 00:05:36 +0000 (00:05 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 8 Oct 2004 00:05:36 +0000 (00:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@3942 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index fef41ac7470fe3527384a98b4d2cb8351d09b3ce..7eb2a35640a0258e9841a52376859d041b152922 100755 (executable)
@@ -1417,12 +1417,6 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
                        free_user(vmu);
                        return 0;
                }
-               if (res >= 0) {
-                       /* Unless we're *really* silent, try to send the beep */
-                       res = ast_streamfile(chan, "beep", chan->language);
-                       if (!res)
-                               res = ast_waitstream(chan, "");
-               }
                if (res < 0) {
                        free_user(vmu);
                        return -1;
@@ -1437,6 +1431,12 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, int silent, int
                                        break;
                                msgnum++;
                        } while(msgnum < MAXMSG);
+                       if (res >= 0) {
+                               /* Unless we're *really* silent, try to send the beep */
+                               res = ast_streamfile(chan, "beep", chan->language);
+                               if (!res)
+                                       res = ast_waitstream(chan, "");
+                       }       
                        if (msgnum < MAXMSG) {
                                /* Store information */
                                snprintf(txtfile, sizeof(txtfile), "%s.txt", fn);