From: Mark Spencer Date: Thu, 3 Jun 2004 23:16:55 +0000 (+0000) Subject: Fix handling when MONITOR_EXEC is unspecified X-Git-Tag: 1.0.0-rc1~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269507ad59038cbca296cf0a03dd00fad5fb65a1;p=thirdparty%2Fasterisk.git Fix handling when MONITOR_EXEC is unspecified git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3141 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_monitor.c b/res/res_monitor.c index 26308584f3..8137c874dd 100755 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -233,8 +233,10 @@ int ast_monitor_stop( struct ast_channel *chan, int need_lock ) soxmix = 1; } snprintf(tmp, sizeof(tmp), "%s %s/%s-in.%s %s/%s-out.%s %s/%s.%s &", execute, dir, name, format, dir, name, format, dir, name, format); - if (soxmix) - snprintf(tmp2,sizeof(tmp2), "%s& rm -f %s/%s-* &",tmp, dir ,name); /* remove legs when done mixing */ + if (soxmix) { + snprintf(tmp2,sizeof(tmp2), "( %s && rm -f %s/%s-* ) &",tmp, dir ,name); /* remove legs when done mixing */ + strncpy(tmp, tmp2, sizeof(tmp) - 1); + } ast_verbose("monitor executing %s\n",tmp); if (ast_safe_system(tmp) == -1) ast_log(LOG_WARNING, "Execute of %s failed.\n",tmp);