diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 20:31:36 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 20:31:36 +0000 |
commit | e82144f15a60469a8e44f025d5e12625dd7c667c (patch) | |
tree | 7e84711db9168ce7080b3d426d8f62cc63db6222 | |
parent | 006a2810aed05e63f73232ab150bb316ed7af203 (diff) |
Store prior to copy (closes issue #10193)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@75748 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | apps/app_voicemail.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index b292eb2fb..5b31f41e6 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -2691,6 +2691,13 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ ast_unlock_path(dir); + /* 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); + } + /* Are there to be more recipients of this message? */ while (tmpptr) { struct ast_vm_user recipu, *recip; @@ -2707,8 +2714,9 @@ static int leave_voicemail(struct ast_channel *chan, char *ext, struct leave_vm_ free_user(recip); } } + + /* Notification and disposal needs to happen after the copy, though. */ if (ast_fileexists(fn, NULL, NULL) > 0) { - STORE(dir, vmu->mailbox, vmu->context, msgnum); notify_new_message(chan, vmu, msgnum, duration, fmt, chan->cid.cid_num, chan->cid.cid_name); DISPOSE(dir, msgnum); } |