From 755696dcd0b9144754a914129e80116da1ebdbd8 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Wed, 9 Apr 2014 21:43:23 +0000 Subject: [PATCH 1/1] 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) ........ Merged revisions 412048 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412050 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- CHANGES | 3 +++ apps/app_mixmonitor.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 382f0f7..f5f6524 100644 --- a/CHANGES +++ b/CHANGES @@ -128,6 +128,9 @@ AMI 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 ------------------ diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c index 4fe629d..a5d383c 100644 --- a/apps/app_mixmonitor.c +++ b/apps/app_mixmonitor.c @@ -208,6 +208,11 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") would apply if invoked from the MixMonitor application. For a list of available options, see the documentation for the mixmonitor application. + + Will be executed when the recording is over. + Any strings matching ^{X} will be unescaped to X. + All variables will be evaluated at the time MixMonitor is called. + This action records the audio on the current channel to the specified file. @@ -1292,6 +1297,7 @@ static int manager_mixmonitor(struct mansession *s, const struct message *m) 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; @@ -1314,7 +1320,7 @@ static int manager_mixmonitor(struct mansession *s, const struct message *m) 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); -- 1.7.9.5