Index: res/res_monitor.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v retrieving revision 1.14 diff -u -r1.14 res_monitor.c --- res/res_monitor.c 3 Jun 2004 23:44:43 -0000 1.14 +++ res/res_monitor.c 4 Jun 2004 17:12:18 -0000 @@ -172,8 +172,6 @@ /* Stop monitoring a channel */ int ast_monitor_stop( struct ast_channel *chan, int need_lock ) { - char *execute=NULL; - int soxmix =0; if(need_lock) { if(ast_mutex_lock(&chan->lock)) { ast_log(LOG_WARNING, "Unable to lock channel\n"); @@ -219,7 +217,9 @@ } } - if (chan->monitor->joinfiles && !ast_strlen_zero(execute) && strlen(chan->monitor->filename_base)) { + if (chan->monitor->joinfiles && strlen(chan->monitor->filename_base)) { + char *execute=NULL; + int soxmix = 0; char tmp[1024]; char tmp2[1024]; char *format = !strcasecmp(chan->monitor->format,"wav49") ? "WAV" : chan->monitor->format; @@ -235,10 +235,11 @@ } 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) { + tmp[strlen(tmp) - 2] = '\0'; /* remove & */ 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); + ast_log(LOG_DEBUG, "monitor executing %s\n",tmp); if (ast_safe_system(tmp) == -1) ast_log(LOG_WARNING, "Execute of %s failed.\n",tmp); }