[asterisk-commits] tilghman: branch 1.4 r289873 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Oct 1 23:42:14 CDT 2010


Author: tilghman
Date: Fri Oct  1 23:42:08 2010
New Revision: 289873

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=289873
Log:
When forwarding a message, a prepend means that the filesystem will always have a better copy.

(closes issue #17803)
 Reported by: dpetersen
 Patches: 
       20100923__issue17803.diff.txt uploaded by tilghman (license 14)
 Tested by: dpetersen

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=289873&r1=289872&r2=289873
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Fri Oct  1 23:42:08 2010
@@ -3934,18 +3934,12 @@
 		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;




More information about the asterisk-commits mailing list