/* 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;
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");