[asterisk-commits] mmichelson: branch 12 r412048 - in /branches/12: CHANGES apps/app_mixmonitor.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Apr 9 15:32:45 CDT 2014


Author: mmichelson
Date: Wed Apr  9 15:32:36 2014
New Revision: 412048

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=412048
Log:
Add a Command header to the AMI Mixmonitor action.

This fixes a parsing error that occurred during the processing of
the AMI action. The error did not result in MixMonitor itself
misbehaving, but it could result in the AMI response not giving
correct information back.

The new header allows for one to specify a post-process command
to run when recording finishes. Previously, in order to do this,
the post-process command would have to be placed at the end of
the Options: header. 

Patches: mixmonitor_command_2.patch by jhardin (License #6512)


Modified:
    branches/12/CHANGES
    branches/12/apps/app_mixmonitor.c

Modified: branches/12/CHANGES
URL: http://svnview.digium.com/svn/asterisk/branches/12/CHANGES?view=diff&rev=412048&r1=412047&r2=412048
==============================================================================
--- branches/12/CHANGES (original)
+++ branches/12/CHANGES Wed Apr  9 15:32:36 2014
@@ -45,6 +45,9 @@
    used to set the UniqueId on creation.  The other id is assigned to the
    second channel when dialing LOCAL, or defaults to appending ;2 if only
    the single Id is given.
+ 
+ * The Mixmonitor action now has a "Command" header that can be used to
+   indicate a post-process command to run once recording finishes.
 
 RealTime
 ------------------

Modified: branches/12/apps/app_mixmonitor.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_mixmonitor.c?view=diff&rev=412048&r1=412047&r2=412048
==============================================================================
--- branches/12/apps/app_mixmonitor.c (original)
+++ branches/12/apps/app_mixmonitor.c Wed Apr  9 15:32:36 2014
@@ -208,6 +208,11 @@
 				would apply if invoked from the MixMonitor application. For a list of
 				available options, see the documentation for the mixmonitor application. </para>
 			</parameter>
+			<parameter name="Command">
+				<para>Will be executed when the recording is over.
+				Any strings matching <literal>^{X}</literal> will be unescaped to <variable>X</variable>.
+				All variables will be evaluated at the time MixMonitor is called.</para>
+			</parameter>
 		</syntax>
 		<description>
 			<para>This action records the audio on the current channel to the specified file.</para>
@@ -1272,6 +1277,7 @@
 	const char *id = astman_get_header(m, "ActionID");
 	const char *file = astman_get_header(m, "File");
 	const char *options = astman_get_header(m, "Options");
+	const char *command = astman_get_header(m, "Command");
 	char *opts[OPT_ARG_ARRAY_SIZE] = { NULL, };
 	struct ast_flags flags = { 0 };
 	char *uid_channel_var = NULL;
@@ -1294,7 +1300,7 @@
 		ast_app_parse_options(mixmonitor_opts, &flags, opts, ast_strdupa(options));
 	}
 
-	snprintf(args, sizeof(args), "%s,%s", file, options);
+	snprintf(args, sizeof(args), "%s,%s,%s", file, options, command);
 
 	res = mixmonitor_exec(c, args);
 




More information about the asterisk-commits mailing list