]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(closes issue #10194)
authorRussell Bryant <russell@russellbryant.com>
Fri, 3 Aug 2007 20:14:06 +0000 (20:14 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 3 Aug 2007 20:14:06 +0000 (20:14 +0000)
Reported by: blitzrage
Patches:
      bug0010194 uploaded by vovochka
Tested by: blitzrage

Fix a problem when you call Voicemail() with multiple mailboxes specified and
ODBC_STORAGE is in use.  The audio part of the message was only given to the
first mailbox specified.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78101 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index 79bb81eb0b98a93dce3adf264a30abd63bc37fcf..d49c84eb84fee7ebc3d4fb8e2f4fd3476070a386 100644 (file)
@@ -3925,8 +3925,15 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
                attach_user_voicemail = ast_test_flag(vmu, VM_ATTACH);
                if (!ast_strlen_zero(vmu->serveremail))
                        myserveremail = vmu->serveremail;
+               
+               if (attach_user_voicemail)
+                       RETRIEVE(todir, msgnum);
+
                /*XXX possible imap issue, should category be NULL XXX*/
                sendmail(myserveremail, vmu, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, fn, fmt, duration, attach_user_voicemail, chan, category);
+
+               if (attach_user_voicemail)
+                       DISPOSE(todir, msgnum);
        }
 
        if (!ast_strlen_zero(vmu->pager)) {