[asterisk-commits] bbryant: trunk r321538 - in /trunk: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 1 15:11:15 CDT 2011


Author: bbryant
Date: Wed Jun  1 15:11:08 2011
New Revision: 321538

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=321538
Log:
Merged revisions 321537 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r321537 | bbryant | 2011-06-01 16:10:02 -0400 (Wed, 01 Jun 2011) | 8 lines
  
  This patch fixes an issue with using the wrong voicemail folders with greetings.
  
  (closes issue #17871)
  Reported by: edhorton
  Patches: 
        digium_bug_17871_2 uploaded by fhackenberger (license 592)
  Tested by: edhorton, fhackenberger
........

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

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

Modified: trunk/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_voicemail.c?view=diff&rev=321538&r1=321537&r2=321538
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Jun  1 15:11:08 2011
@@ -2177,11 +2177,16 @@
 	int ret; /* for better error checking */
 	char *imap_flags = NIL;
 	int msgcount = (messagecount(vmu->context, vmu->mailbox, "INBOX") + messagecount(vmu->context, vmu->mailbox, "Old"));
-
-    /* Back out early if this is a greeting and we don't want to store greetings in IMAP */
-    if (msgnum < 0 && !imapgreetings) {
-        return 0;
-    }
+	int box = NEW_FOLDER;
+
+	/* Back out early if this is a greeting and we don't want to store greetings in IMAP */
+	if (msgnum < 0) {
+		if(!imapgreetings) {
+			return 0;
+		} else {
+			box = GREETINGS_FOLDER;
+		}
+	}
 
 	if (imap_check_limits(chan, vms, vmu, msgcount)) {
 		return -1;
@@ -2264,9 +2269,9 @@
 	}
 	((char *) buf)[len] = '\0';
 	INIT(&str, mail_string, buf, len);
-	ret = init_mailstream(vms, NEW_FOLDER);
+	ret = init_mailstream(vms, box);
 	if (ret == 0) {
-		imap_mailbox_name(mailbox, sizeof(mailbox), vms, NEW_FOLDER, 1);
+		imap_mailbox_name(mailbox, sizeof(mailbox), vms, box, 1);
 		ast_mutex_lock(&vms->lock);
 		if(!mail_append_full(vms->mailstream, mailbox, imap_flags, NIL, &str))
 			ast_log(LOG_ERROR, "Error while sending the message to %s\n", mailbox);




More information about the asterisk-commits mailing list