aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-10 23:32:52 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-10 23:32:52 +0000
commitf3527da49e8310cb0cbc2eccf14ed7814a506f72 (patch)
treeb7c98eb1f127d2979f68b271bf6f09a88a6a9464 /apps
parent58a41b0008b8b17e96bba1959bb8e07b7e2e50fe (diff)
Forwarding a message with IMAP storage was storing the message in the sender's box instead of the forwarded mailbox.
(closes issue #10138, reported and patched by jaroth) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@74476 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_voicemail.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 1177ccd77..891acf1ee 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -3949,6 +3949,7 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
char *temp;
char todir[256];
int todircount=0;
+ struct vm_state *dstvms;
#endif
char username[70]="";
int res = 0, cmd = 0;
@@ -4139,7 +4140,19 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st
/* should not assume "fmt" here! */
save_body(body,vms,"2",fmt);
- STORE(todir, vmtmp->mailbox, vmtmp->context, vms->curmsg, chan, vmtmp, fmt, duration, vms);
+ /* get destination mailbox */
+ dstvms = get_vm_state_by_mailbox(vmtmp->mailbox,0);
+ if (dstvms) {
+ init_mailstream(dstvms, 0);
+ if (!dstvms->mailstream) {
+ ast_log (LOG_ERROR,"IMAP mailstream for %s is NULL\n",vmtmp->mailbox);
+ } else {
+ STORE(todir, vmtmp->mailbox, vmtmp->context, dstvms->curmsg, chan, vmtmp, fmt, duration, dstvms);
+ run_externnotify(vmtmp->context, vmtmp->mailbox);
+ }
+ } else {
+ ast_log (LOG_ERROR,"Could not find state information for mailbox %s\n",vmtmp->mailbox);
+ }
char *myserveremail = serveremail;
if (!ast_strlen_zero(vmtmp->serveremail))