]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
When forwarding a message, a prepend means that the filesystem will always have a...
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 2 Oct 2010 04:42:08 +0000 (04:42 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 2 Oct 2010 04:42:08 +0000 (04:42 +0000)
(closes issue #17803)
 Reported by: dpetersen
 Patches:
       20100923__issue17803.diff.txt uploaded by tilghman (license 14)
 Tested by: dpetersen

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

apps/app_voicemail.c

index 2a51105625199c113a21d8518e6ca61d9fc1fa00..80981c320a0f8afa54e84cb6c44559a3513fb9b3 100644 (file)
@@ -3934,18 +3934,12 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
                recipmsgnum++;
        } while (recipmsgnum < recip->maxmsg);
        if (recipmsgnum < recip->maxmsg - (imbox ? 0 : inprocess_count(vmu->mailbox, vmu->context, 0))) {
-               if (EXISTS(fromdir, msgnum, frompath, chan->language)) {
-                       COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
-               } else {
-                       /* For ODBC storage, if the file we want to copy isn't yet in the database, then the SQL
-                        * copy will fail. Instead, we need to create a local copy, store it, and delete the local
-                        * copy. We don't have to #ifdef this because if file storage reaches this point, there's a
-                        * much worse problem happening and IMAP storage doesn't call this function
-                        */
-                       copy_plain_file(frompath, topath);
-                       STORE(todir, recip->mailbox, recip->context, recipmsgnum, chan, recip, fmt, duration, NULL);
-                       vm_delete(topath);
-               }
+               /* If we are prepending a message for ODBC, then the message already
+                * exists in the database, but we want to force copying from the
+                * filesystem (since only the FS contains the prepend). */
+               copy_plain_file(frompath, topath);
+               STORE(todir, recip->mailbox, recip->context, recipmsgnum, chan, recip, fmt, duration, NULL);
+               vm_delete(topath);
        } else {
                ast_log(LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
                res = -1;