[asterisk-commits] qwell: branch mmichelson/trunk-digiumphones r365397 - in /team/mmichelson/tru...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 4 16:40:11 CDT 2012


Author: qwell
Date: Fri May  4 16:40:07 2012
New Revision: 365397

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=365397
Log:
Add support for folders in MixMonitor 'm' option.

(issue DPMA-68)
........

Merged revisions 365395 from http://svn.asterisk.org/svn/asterisk/certified/branches/1.8.11
........

Merged revisions 365396 from http://svn.asterisk.org/svn/asterisk/branches/10-digiumphones

Modified:
    team/mmichelson/trunk-digiumphones/   (props changed)
    team/mmichelson/trunk-digiumphones/apps/app_mixmonitor.c
    team/mmichelson/trunk-digiumphones/apps/app_voicemail.c

Propchange: team/mmichelson/trunk-digiumphones/
------------------------------------------------------------------------------
--- branch-10-digiumphones-merged (original)
+++ branch-10-digiumphones-merged Fri May  4 16:40:07 2012
@@ -1,1 +1,1 @@
-/branches/10-digiumphones:364766
+/branches/10-digiumphones:364766,365396

Propchange: team/mmichelson/trunk-digiumphones/
------------------------------------------------------------------------------
--- certified-branch-1.8.11-merged (original)
+++ certified-branch-1.8.11-merged Fri May  4 16:40:07 2012
@@ -1,1 +1,1 @@
-/certified/branches/1.8.11:364761
+/certified/branches/1.8.11:364761,365395

Modified: team/mmichelson/trunk-digiumphones/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/trunk-digiumphones/apps/app_mixmonitor.c?view=diff&rev=365397&r1=365396&r2=365397
==============================================================================
--- team/mmichelson/trunk-digiumphones/apps/app_mixmonitor.c (original)
+++ team/mmichelson/trunk-digiumphones/apps/app_mixmonitor.c Fri May  4 16:40:07 2012
@@ -117,7 +117,8 @@
 					<option name="m">
 						<argument name="mailbox" required="true" />
 						<para>Create a copy of the recording as a voicemail in the indicated <emphasis>mailbox</emphasis>(es)
-						separated by commas eg. m(1111 at default,2222 at default,...)</para>
+						separated by commas eg. m(1111 at default,2222 at default,...).  Folders can be optionally specified using
+						the syntax: mailbox at context/folder</para>
 					</option>
 				</optionlist>
 			</parameter>
@@ -252,6 +253,7 @@
 struct vm_recipient {
 	char mailbox[AST_MAX_CONTEXT];
 	char context[AST_MAX_EXTENSION];
+	char folder[80];
 	AST_LIST_ENTRY(vm_recipient) list;
 };
 
@@ -424,9 +426,10 @@
  */
 static void add_vm_recipients_from_string(struct mixmonitor *mixmonitor, const char *vm_recipients)
 {
-	/* recipients are in a single string with a format format resembling "mailbox at context,mailbox2 at context2, mailbox3 at context3" */
+	/* recipients are in a single string with a format format resembling "mailbox at context/INBOX,mailbox2 at context2,mailbox3 at context3/Work" */
 	char *cur_mailbox = ast_strdupa(vm_recipients);
 	char *cur_context;
+	char *cur_folder;
 	char *next;
 	int elements_processed = 0;
 
@@ -436,6 +439,12 @@
 			*(next++) = '\0';
 		}
 
+		if ((cur_folder = strchr(cur_mailbox, '/'))) {
+			*(cur_folder++) = '\0';
+		} else {
+			cur_folder = "INBOX";
+		}
+
 		if ((cur_context = strchr(cur_mailbox, '@'))) {
 			*(cur_context++) = '\0';
 		} else {
@@ -443,7 +452,6 @@
 		}
 
 		if (!ast_strlen_zero(cur_mailbox) && !ast_strlen_zero(cur_context)) {
-
 			struct vm_recipient *recipient;
 			if (!(recipient = ast_malloc(sizeof(*recipient)))) {
 				ast_log(LOG_ERROR, "Failed to allocate recipient. Aborting function.\n");
@@ -451,11 +459,11 @@
 			}
 			ast_copy_string(recipient->context, cur_context, sizeof(recipient->context));
 			ast_copy_string(recipient->mailbox, cur_mailbox, sizeof(recipient->mailbox));
+			ast_copy_string(recipient->folder, cur_folder, sizeof(recipient->folder));
 
 			/* Add to list */
 			ast_verb(5, "Adding %s@%s to recipient list\n", recipient->mailbox, recipient->context);
 			AST_LIST_INSERT_HEAD(&mixmonitor->recipient_list, recipient, list);
-
 		} else {
 			ast_log(LOG_ERROR, "Failed to properly parse extension and/or context from element %d of recipient string: %s\n", elements_processed, vm_recipients);
 		}
@@ -529,9 +537,11 @@
 	recording_data.call_priority = mixmonitor->call_priority;
 
 	AST_LIST_TRAVERSE(&mixmonitor->recipient_list, recipient, list) {
-		/* context and mailbox need to be set per recipient */
+		/* context, mailbox, and folder need to be set per recipient */
 		ast_string_field_set(&recording_data, context, recipient->context);
 		ast_string_field_set(&recording_data, mailbox, recipient->mailbox);
+		ast_string_field_set(&recording_data, folder, recipient->folder);
+
 		ast_verb(4, "MixMonitor attempting to send voicemail copy to %s@%s\n", recording_data.mailbox,
 			recording_data.context);
 		ast_app_copy_recording_to_vm(&recording_data);

Modified: team/mmichelson/trunk-digiumphones/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/trunk-digiumphones/apps/app_voicemail.c?view=diff&rev=365397&r1=365396&r2=365397
==============================================================================
--- team/mmichelson/trunk-digiumphones/apps/app_voicemail.c (original)
+++ team/mmichelson/trunk-digiumphones/apps/app_voicemail.c Fri May  4 16:40:07 2012
@@ -5893,7 +5893,7 @@
 	/* At this point, the actual creation of a voicemail message should be finished.
 	 * Now we just need to copy the files being recorded into the receiving folder. */
 
-	create_dirpath(dir, sizeof(dir), recipient->context, recipient->mailbox, "INBOX");
+	create_dirpath(dir, sizeof(dir), recipient->context, recipient->mailbox, recdata->folder);
 
 #ifdef IMAP_STORAGE
 	/* make recipient info into an inboxcount friendly string */




More information about the asterisk-commits mailing list