summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJeff Peeler <jpeeler@digium.com>2011-01-07 19:58:52 +0000
committerJeff Peeler <jpeeler@digium.com>2011-01-07 19:58:52 +0000
commitac11bca7c0877a86c5b676e97af4ebbc990ac669 (patch)
treeb1a3315fbdc05dd630d0a2ace2bd8d373020b534 /apps
parentb2a70b4065f1baf9f7c7b88127780aeb6bd94b0e (diff)
Merged revisions 301047 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8 ................ r301047 | jpeeler | 2011-01-07 13:58:30 -0600 (Fri, 07 Jan 2011) | 15 lines Merged revisions 301046 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r301046 | jpeeler | 2011-01-07 13:57:42 -0600 (Fri, 07 Jan 2011) | 8 lines Fix regression causing forwarding voicemails to not work with file storage. I had actually already fixed this in 295200 in 1.4 and thought it wasn't missing in the other branches for some reason. (closes issue #18358) Reported by: cabal95 ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 14e11fdc4..754bfa040 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -5224,12 +5224,20 @@ static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int i
recipmsgnum = last_message_index(recip, todir) + 1;
if (recipmsgnum < recip->maxmsg - (imbox ? 0 : inprocess_count(vmu->mailbox, vmu->context, 0))) {
make_file(topath, sizeof(topath), todir, recipmsgnum);
- /* 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, NULL);
- vm_delete(topath);
+#ifndef ODBC_STORAGE
+ if (EXISTS(fromdir, msgnum, frompath, chan->language)) {
+ COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
+ } else {
+#endif
+ /* 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, NULL);
+ vm_delete(topath);
+#ifndef ODBC_STORAGE
+ }
+#endif
} else {
ast_log(AST_LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
res = -1;