From 9aef593e58aa4762d5b6938f3036074cf0b02305 Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Fri, 27 Jun 2008 00:15:54 +0000 Subject: The monitor-join option for queues was deprecated in favor of using MixMonitor to mix audio. However, it was pointed out to me that because of this, the command set for the MONITOR_EXEC variable is ignored as well. This means that people can't do their own custom mixing commands at the end of recordings in order to make, for instance, stereo recordings of calls. With this patch, app_queue will set the "joinfiles" variable for the channel's monitor if MONITOR_EXEC is not zero-length. This means that for normal audio mixing, MixMonitor is still the preferred choice, but we allow custom mixing to be done with the two Monitor streams if desired. (closes issue #12923) Reported by: snyfer git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@125649 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_queue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/app_queue.c b/apps/app_queue.c index 5bdf72fb9..536b3b2e9 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -3539,8 +3539,9 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce /* Begin Monitoring */ if (qe->parent->monfmt && *qe->parent->monfmt) { if (!qe->parent->montype) { + char *monexec, *monargs; ast_debug(1, "Starting Monitor as requested.\n"); - if (pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC") || pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS")) + if ((monexec = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC")) || (monargs = pbx_builtin_getvar_helper(qe->chan, "MONITOR_EXEC_ARGS"))) which = qe->chan; else which = peer; @@ -3553,6 +3554,9 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce snprintf(tmpid, sizeof(tmpid), "chan-%lx", ast_random()); ast_monitor_start(which, qe->parent->monfmt, tmpid, 1, X_REC_IN | X_REC_OUT); } + if (!ast_strlen_zero(monexec)) { + ast_monitor_setjoinfiles(which, 1); + } } else { mixmonapp = pbx_findapp("MixMonitor"); -- cgit v1.2.3