[Asterisk-cvs] asterisk/res res_monitor.c,1.7,1.8

martinp at lists.digium.com martinp at lists.digium.com
Thu Feb 5 16:01:35 CST 2004


Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv7628/res

Modified Files:
	res_monitor.c 
Log Message:
Add 'm' option to Monitor app to use soxmix (if available) to mix the output recording to one file.


Index: res_monitor.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_monitor.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- res_monitor.c	3 Feb 2004 16:57:00 -0000	1.7
+++ res_monitor.c	5 Feb 2004 22:10:19 -0000	1.8
@@ -24,13 +24,14 @@
 
 static char *monitor_synopsis = "Monitor a channel";
 
-static char *monitor_descrip = "Monitor\n"
+static char *monitor_descrip = "Monitor([file_format|[fname_base]|[options]]):\n"
 	"Used to start monitoring a channel. The channel's input and output\n"
 	"voice packets are logged to files until the channel hangs up or\n"
 	"monitoring is stopped by the StopMonitor application.\n"
-	"The option string may contain the following arguments: [file_format|[fname_base]]\n"
 	"	file_format -- optional, if not set, defaults to \"wav\"\n"
-	"	fname_base -- if set, changes the filename used to the one specified.\n";
+	"	fname_base -- if set, changes the filename used to the one specified.\n"
+	"	options:\n"
+	"		'm' - when the recording ends mix the two leg files into one using 'soxmix' utility which has to be installed on the system.\n";
 
 static char *stopmonitor_synopsis = "Stop monitoring a channel";
 
@@ -275,6 +276,8 @@
 	char *arg = NULL;
 	char *format = NULL;
 	char *fname_base = NULL;
+	char *options = NULL;
+	int joinfiles = 0;
 	int res;
 	
 	/* Parse arguments. */
@@ -285,13 +288,21 @@
 		if( fname_base ) {
 			*fname_base = 0;
 			fname_base++;
+			if ((options = strchr(fname_base, '|'))) {
+				*options = 0;
+				options++;
+				if (strchr(options, 'm'))
+					joinfiles = 1;
+			}
 		}
+		
 	}
 
 	res = ast_monitor_start( chan, format, fname_base, 1 );
 	if( res < 0 ) {
 		res = ast_monitor_change_fname( chan, fname_base, 1 );
 	}
+	ast_monitor_setjoinfiles(chan, joinfiles);
 
 	if( arg ) {
 		free( arg );




More information about the svn-commits mailing list