diff options
author | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-05 22:10:19 +0000 |
---|---|---|
committer | martinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-02-05 22:10:19 +0000 |
commit | a6d4b1d513f5718b0103f60d97dd97d0145f2626 (patch) | |
tree | f306f5c369d192f3d20422a6f5dcf53211684ea1 /res/res_monitor.c | |
parent | d6ef3f1501e6cffef316501caa60c049593a49d2 (diff) |
Add 'm' option to Monitor app to use soxmix (if available) to mix the output recording to one file.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2132 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_monitor.c')
-rwxr-xr-x | res/res_monitor.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/res/res_monitor.c b/res/res_monitor.c index 676cb3258..d64b46d57 100755 --- a/res/res_monitor.c +++ b/res/res_monitor.c @@ -24,13 +24,14 @@ static unsigned long seq = 0; 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 @@ static int start_monitor_exec(struct ast_channel *chan, void *data) char *arg = NULL; char *format = NULL; char *fname_base = NULL; + char *options = NULL; + int joinfiles = 0; int res; /* Parse arguments. */ @@ -285,13 +288,21 @@ static int start_monitor_exec(struct ast_channel *chan, void *data) 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 ); |