Fixed call parking, added separate paramater to allow/disallow call parking on

Zaptel interfaces (canpark=yes/no in zapata.conf), added urlbase paramater to
Monitor so that a url can optionally be included in CDR (user field), cleaned up a couple of minor things


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jim Dixon
2004-12-09 22:39:14 +00:00
parent 9f1a7379cc
commit 998621f76a
6 changed files with 82 additions and 15 deletions

View File

@@ -29,7 +29,7 @@ static unsigned long seq = 0;
static char *monitor_synopsis = "Monitor a channel";
static char *monitor_descrip = "Monitor([file_format|[fname_base]|[options]]):\n"
static char *monitor_descrip = "Monitor([file_format[:urlbase]|[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"
@@ -307,6 +307,8 @@ static int start_monitor_exec(struct ast_channel *chan, void *data)
char *fname_base = NULL;
char *options = NULL;
char *delay = NULL;
char *urlprefix = NULL;
char tmp[256];
int joinfiles = 0;
int waitforbridge = 0;
int res = 0;
@@ -315,6 +317,13 @@ static int start_monitor_exec(struct ast_channel *chan, void *data)
if (data && !ast_strlen_zero((char*)data)) {
arg = ast_strdupa((char*)data);
format = arg;
arg = strchr(format,':');
if (arg)
{
*arg++ = 0;
urlprefix = arg;
}
else arg = format;
fname_base = strchr(arg, '|');
if (fname_base) {
*fname_base = 0;
@@ -329,7 +338,14 @@ static int start_monitor_exec(struct ast_channel *chan, void *data)
}
}
}
if (urlprefix)
{
snprintf(tmp,sizeof(tmp) - 1,"%s/%s.%s",urlprefix,fname_base,
((strcmp(format,"gsm")) ? "wav" : "gsm"));
if (!chan->cdr)
chan->cdr = ast_cdr_alloc();
ast_cdr_setuserfield(chan, tmp);
}
if (waitforbridge) {
/* We must remove the "b" option if listed. In principle none of
the following could give NULL results, but we check just to