[svn-commits] mmichelson: branch 1.6.0 r135070 - in /branches/1.6.0: ./ apps/ configs/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 1 09:43:20 CDT 2008


Author: mmichelson
Date: Fri Aug  1 09:43:19 2008
New Revision: 135070

URL: http://svn.digium.com/view/asterisk?view=rev&rev=135070
Log:
Merged revisions 135067-135068 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r135067 | mmichelson | 2008-08-01 09:29:48 -0500 (Fri, 01 Aug 2008) | 13 lines

IMAP storage functioned under the assumption that folders
such as "Work" and "Family" would be subfolders of the
INBOX. This is an invalid assumption to make, but it could
be desirable to set up folders in this manner, so a new
option for voicemail.conf, "imapparentfolder" has been
added to allow for this.

(closes issue #13142)
Reported by: jaroth
Patches:
      parentfolder.patch uploaded by jaroth (license 50)


........
r135068 | mmichelson | 2008-08-01 09:42:24 -0500 (Fri, 01 Aug 2008) | 3 lines

IMAP-specific items must go in IMAP_STORAGE defines...


........

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_voicemail.c
    branches/1.6.0/configs/voicemail.conf.sample

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/apps/app_voicemail.c?view=diff&rev=135070&r1=135069&r2=135070
==============================================================================
--- branches/1.6.0/apps/app_voicemail.c (original)
+++ branches/1.6.0/apps/app_voicemail.c Fri Aug  1 09:43:19 2008
@@ -124,6 +124,7 @@
 static char imapport[8];
 static char imapflags[128];
 static char imapfolder[64];
+static char imapparentfolder[64] = "\0";
 static char greetingfolder[64];
 static char authuser[32];
 static char authpassword[42];
@@ -5100,8 +5101,13 @@
 		snprintf(spec, len, "%s%s", tmp, use_folder? imapfolder: "INBOX");
 	else if (box == GREETINGS_FOLDER)
 		snprintf(spec, len, "%s%s", tmp, greetingfolder);
-	else
-		snprintf(spec, len, "%s%s%c%s", tmp, imapfolder, delimiter, mbox(box));
+	else 	/* Other folders such as Friends, Family, etc... */
+		if (!ast_strlen_zero(imapparentfolder)) {
+			/* imapparentfolder would typically be set to INBOX */
+			snprintf(spec, len, "%s%s%c%s", tmp, imapparentfolder, delimiter, mbox(box));
+		} else {
+			snprintf(spec, len, "%s%s", tmp, mbox(box));
+		}
 }
 
 static int init_mailstream(struct vm_state *vms, int box)
@@ -8300,7 +8306,9 @@
 		ast_clear_flag(&config_flags, CONFIG_FLAG_FILEUNCHANGED);
 		ucfg = ast_config_load("users.conf", config_flags);
 	}
-
+#ifdef IMAP_STORAGE
+	ast_copy_string(imapparentfolder, "\0", sizeof(imapparentfolder));
+#endif
 	/* set audio control prompts */
 	strcpy(listen_control_forward_key, DEFAULT_LISTEN_CONTROL_FORWARD_KEY);
 	strcpy(listen_control_reverse_key, DEFAULT_LISTEN_CONTROL_REVERSE_KEY);
@@ -8447,6 +8455,9 @@
 			ast_copy_string(imapfolder, val, sizeof(imapfolder));
 		} else {
 			ast_copy_string(imapfolder, "INBOX", sizeof(imapfolder));
+		}
+		if ((val = ast_variable_retrieve(cfg, "general", "imapparentfolder"))) {
+			ast_copy_string(imapparentfolder, val, sizeof(imapparentfolder));
 		}
 		if ((val = ast_variable_retrieve(cfg, "general", "imapgreetings"))) {
 			imapgreetings = ast_true(val);

Modified: branches/1.6.0/configs/voicemail.conf.sample
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/configs/voicemail.conf.sample?view=diff&rev=135070&r1=135069&r2=135070
==============================================================================
--- branches/1.6.0/configs/voicemail.conf.sample (original)
+++ branches/1.6.0/configs/voicemail.conf.sample Fri Aug  1 09:43:19 2008
@@ -149,6 +149,11 @@
 ; If imapgreetings=yes, then specify which folder to store your greetings in. If
 ; you do not specify a folder, then INBOX will be used
 ;greetingsfolder=INBOX
+; Some IMAP server implementations store folders under INBOX instead of 
+; using a top level folder (ex. INBOX/Friends).  In this case, user
+; imapparentfolder to set the parent folder. For example, Cyrus IMAP does
+; NOT use INBOX as the parent. Default is to have no parent folder set.
+;imapparentfolder=INBOX
 ; 
 ; Users may be located in different timezones, or may have different 
 ; message announcements for their introductory message when they enter 




More information about the svn-commits mailing list