[asterisk-commits] mogorman: trunk r50958 - in /trunk: ./ apps/app_voicemail.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon Jan 15 14:12:57 MST 2007


Author: mogorman
Date: Mon Jan 15 15:12:56 2007
New Revision: 50958

URL: http://svn.digium.com/view/asterisk?view=rev&rev=50958
Log:
Merged revisions 50957 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.4

................
r50957 | mogorman | 2007-01-15 15:08:07 -0600 (Mon, 15 Jan 2007) | 12 lines

Merged revisions 50946 via svnmerge from 
https://svn.digium.com/svn/asterisk/branches/1.2

........
r50946 | mogorman | 2007-01-15 14:44:53 -0600 (Mon, 15 Jan 2007) | 4 lines

Solves issue with forwarding voicemails from folders other than inbox.
patch by anthonyl.


........

................

Modified:
    trunk/   (props changed)
    trunk/apps/app_voicemail.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=50958&r1=50957&r2=50958
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Mon Jan 15 15:12:56 2007
@@ -2678,7 +2678,7 @@
 #endif
 #ifndef IMAP_STORAGE
 /* copy message only used by file storage */
-static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt)
+static int copy_message(struct ast_channel *chan, struct ast_vm_user *vmu, int imbox, int msgnum, long duration, struct ast_vm_user *recip, char *fmt, char *dir)
 {
 	char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
 	const char *frombox = mbox(imbox);
@@ -2687,8 +2687,12 @@
 	ast_log(LOG_NOTICE, "Copying message from %s@%s to %s@%s\n", vmu->mailbox, vmu->context, recip->mailbox, recip->context);
 
 	create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "INBOX");
-
-	make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
+	
+	if (!dir)
+		make_dir(fromdir, sizeof(fromdir), vmu->context, vmu->mailbox, frombox);
+	else
+		ast_copy_string(fromdir, dir, sizeof(fromdir));
+
 	make_file(frompath, sizeof(frompath), fromdir, msgnum);
 	make_dir(todir, sizeof(todir), recip->context, recip->mailbox, frombox);
 
@@ -3191,7 +3195,7 @@
 							context++;
 						}
 						if ((recip = find_user(&recipu, context, exten))) {
-							copy_message(chan, vmu, 0, msgnum, duration, recip, fmt);
+							copy_message(chan, vmu, 0, msgnum, duration, recip, fmt, dir);
 							free_user(recip);
 						}
 					}
@@ -4192,7 +4196,7 @@
 				sendmail(myserveremail, vmtmp, todircount, vmtmp->context, vmtmp->mailbox, S_OR(chan->cid.cid_num, NULL), S_OR(chan->cid.cid_name, NULL), vms->fn, fmt, duration, attach_user_voicemail, chan, NULL);
 
 #else
-				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt);
+				copy_message(chan, sender, 0, curmsg, duration, vmtmp, fmt, dir);
 #endif
 				saved_messages++;
 				AST_LIST_REMOVE_CURRENT(&extensions, list);



More information about the asterisk-commits mailing list