aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-03 14:32:57 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-03 14:32:57 +0000
commit936e3289f41f165c115e6d8104de47036f64d22f (patch)
tree0b708d49168ecf99a046fe87ba6ad1f39a4ec5fa /apps
parent56b53681d9f80482c23bce4eb5aa4c0974fe105f (diff)
Merged revisions 140860 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r140860 | mmichelson | 2008-09-03 09:31:33 -0500 (Wed, 03 Sep 2008) | 17 lines Merged revisions 140850 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r140850 | mmichelson | 2008-09-03 09:29:15 -0500 (Wed, 03 Sep 2008) | 9 lines Fix voicemail forwarding when using ODBC storage. (closes issue #13387) Reported by: moliveras Patches: 13387.patch uploaded by putnopvut (license 60) Tested by: putnopvut, moliveras ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@140867 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index beeed87d6..350a744c0 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4397,7 +4397,18 @@ 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) {
make_file(topath, sizeof(topath), todir, recipmsgnum);
- COPY(fromdir, msgnum, todir, recipmsgnum, recip->mailbox, recip->context, frompath, topath);
+ 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);
+ }
} else {
ast_log(AST_LOG_ERROR, "Recipient mailbox %s@%s is full\n", recip->mailbox, recip->context);
}
@@ -5809,7 +5820,6 @@ static int vm_forwardoptions(struct ast_channel *chan, struct ast_vm_user *vmu,
snprintf(duration_buf, 11, "%ld", *duration);
if (!ast_variable_update(msg_cat, "duration", duration_buf, NULL, 0)) {
config_text_file_save(textfile, msg_cfg, "app_voicemail");
- STORE(curdir, vmu->mailbox, context, curmsg, chan, vmu, vmfmts, prepend_duration, vms, NULL);
}
}