]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 75748 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Wed, 18 Jul 2007 20:40:18 +0000 (20:40 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Wed, 18 Jul 2007 20:40:18 +0000 (20:40 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r75748 | tilghman | 2007-07-18 15:31:36 -0500 (Wed, 18 Jul 2007) | 2 lines

Store prior to copy (closes issue #10193)

........

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

apps/app_voicemail.c

index c3827747de74e2b36e4b8875374fe4117ff7cf1b..fe44aafa35b83216f29d872a12e846ca63200b1e 100644 (file)
@@ -3132,6 +3132,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
 
                                        ast_unlock_path(dir);
 #ifndef IMAP_STORAGE
+                                       /* We must store the file first, before copying the message, because
+                                        * ODBC storage does the entire copy with SQL.
+                                        */
+                                       if (ast_fileexists(fn, NULL, NULL) > 0) {
+                                               STORE(dir, vmu->mailbox, vmu->context, msgnum, chan, vmu, fmt, duration, vms);
+                                       }
+
                                        /* Are there to be more recipients of this message? */
                                        while (tmpptr) {
                                                struct ast_vm_user recipu, *recip;
@@ -3149,8 +3156,8 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_
                                                }
                                        }
 #endif
+                                       /* Notification and disposal needs to happen after the copy, though. */
                                        if (ast_fileexists(fn, NULL, NULL)) {
-                                               STORE(dir, vmu->mailbox, vmu->context, msgnum, chan, vmu, fmt, duration, vms);
                                                notify_new_message(chan, vmu, msgnum, duration, fmt, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL));
                                                DISPOSE(dir, msgnum);
                                        }