[svn-commits] jrose: branch 10 r345488 - in /branches/10: ./ apps/app_voicemail.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Nov 16 08:49:47 CST 2011


Author: jrose
Date: Wed Nov 16 08:49:43 2011
New Revision: 345488

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=345488
Log:
Guarantee messages go into the right folders with multiple recipients

Before, using the U flag in Voicemail with multiple recipients would put urgent messages
in the INBOX folder for all users past the first thanks to a bug with the message
copying function. This would also cause messages to fail to be sent if the INBOX
directory hadn't been created for that mailbox yet.

(closes issue ASTERISK-18245)
Reported by: Matt Jordan

(closes issue ASTERISK-18246)
Reported by: Matt Jordan
........

Merged revisions 345487 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/apps/app_voicemail.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/apps/app_voicemail.c?view=diff&rev=345488&r1=345487&r2=345488
==============================================================================
--- branches/10/apps/app_voicemail.c (original)
+++ branches/10/apps/app_voicemail.c Wed Nov 16 08:49:43 2011
@@ -5303,24 +5303,27 @@
 {
 	char fromdir[PATH_MAX], todir[PATH_MAX], frompath[PATH_MAX], topath[PATH_MAX];
 	const char *frombox = mbox(vmu, imbox);
+	const char *userfolder;
 	int recipmsgnum;
 	int res = 0;
 
 	ast_log(AST_LOG_NOTICE, "Copying message from %s@%s to %s@%s\n", vmu->mailbox, vmu->context, recip->mailbox, recip->context);
 
 	if (!ast_strlen_zero(flag) && !strcmp(flag, "Urgent")) { /* If urgent, copy to Urgent folder */
-		create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "Urgent");
+		userfolder = "Urgent";
 	} else {
-		create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "INBOX");
-	}
-	
+		userfolder = "INBOX";
+	}
+
+	create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, userfolder);
+
 	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, "INBOX");
+	make_dir(todir, sizeof(todir), recip->context, recip->mailbox, userfolder);
 
 	if (vm_lock_path(todir))
 		return ERROR_LOCK_PATH;
@@ -6037,7 +6040,7 @@
 					while (tmpptr) {
 						struct ast_vm_user recipu, *recip;
 						char *exten, *cntx;
-					
+
 						exten = strsep(&tmpptr, "&");
 						cntx = strchr(exten, '@');
 						if (cntx) {




More information about the svn-commits mailing list