[asterisk-commits] jrose: branch 1.8-digiumphones r361088 - /branches/1.8-digiumphones/apps/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Apr 3 16:03:07 CDT 2012


Author: jrose
Date: Tue Apr  3 16:03:01 2012
New Revision: 361088

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361088
Log:
Make m option for mixmonitor delete the source file once it is finished copying to vm.

Review: https://reviewboard.asterisk.org/r/1842/

Modified:
    branches/1.8-digiumphones/apps/app_mixmonitor.c

Modified: branches/1.8-digiumphones/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8-digiumphones/apps/app_mixmonitor.c?view=diff&rev=361088&r1=361087&r2=361088
==============================================================================
--- branches/1.8-digiumphones/apps/app_mixmonitor.c (original)
+++ branches/1.8-digiumphones/apps/app_mixmonitor.c Tue Apr  3 16:03:01 2012
@@ -97,8 +97,9 @@
 					</option>
 					<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)
+						<para>Create a copy of the recording as a voicemail in each indicated <emphasis>mailbox</emphasis>
 						separated by commas eg. m(1111 at default,2222 at default,...)</para>
+						<note><para>The recording will be deleted once all the copies are made.</para></note>
 					</option>
 				</optionlist>
 			</parameter>
@@ -390,6 +391,8 @@
 {
 	struct vm_recipient *recipient = NULL;
 	struct ast_vm_recording_data recording_data;
+	char filename[PATH_MAX];
+
 	if (ast_string_field_init(&recording_data, 512)) {
 		ast_log(LOG_ERROR, "Failed to string_field_init, skipping copy_to_voicemail\n");
 		return;
@@ -413,6 +416,12 @@
 		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);
+	}
+
+	/* Delete the source file */
+	snprintf(filename, sizeof(filename), "%s.%s", mixmonitor->filename, ext);
+	if (remove(filename)) {
+		ast_log(LOG_ERROR, "Failed to delete recording source file %s\n", filename);
 	}
 
 	/* Free the string fields for recording_data before exiting the function. */




More information about the asterisk-commits mailing list