diff -Nur --exclude=RCS --exclude=CVS --exclude=SCCS --exclude=BitKeeper --exclude=ChangeSet master/apps/app_dial.c dial_channel_group/apps/app_dial.c --- master/apps/app_dial.c 2004-10-03 10:10:45 -07:00 +++ dial_channel_group/apps/app_dial.c 2004-10-03 09:37:15 -07:00 @@ -43,7 +43,7 @@ static char *synopsis = "Place a call and connect to the current channel"; static char *descrip = -" Dial(Technology/resource[&Technology2/resource2...][|timeout][|options][|URL]):\n" +" Dial(Technology/resource[&Technology2/resource2...][|timeout][|options][|URL][|group]):\n" "Requests one or more channels and places specified outgoing calls on them.\n" "As soon as a channel answers, the Dial app will answer the originating\n" "channel (if it needs to be answered) and will bridge a call with the channel\n" @@ -92,6 +92,7 @@ " In addition to transferring the call, a call may be parked and then picked\n" "up by another user.\n" " The optional URL will be sent to the called party if the channel supports it.\n" +" The optional group will be assigned to the created channel (as in SetGroup).\n" " This application sets the following channel variables upon completion:\n" " DIALEDTIME Time from dial to answer\n" " ANSWEREDTIME Time for actual call\n" @@ -438,6 +439,7 @@ char *newnum; char *l; char *url=NULL; /* JDG */ + char *group=NULL; struct ast_var_t *current; struct varshead *headp, *newheadp; struct ast_var_t *newvar; @@ -493,6 +495,11 @@ *url = '\0'; url++; ast_log(LOG_DEBUG, "DIAL WITH URL=%s_\n", url); + group = strchr(url, '|'); + if (group) { + *group = '\0'; + group++; + } } else ast_log(LOG_DEBUG, "SIMPLE DIAL (NO URL)\n"); /* /JDG */ @@ -831,6 +838,9 @@ tmp->chan->adsicpe = chan->adsicpe; /* pass the digital flag */ ast_dup_flag(tmp->chan, chan, AST_FLAG_DIGITAL); + /* set the channel's group, if requested */ + if (group && !ast_strlen_zero(group)) + ast_app_group_set_channel(tmp->chan, group); /* Place the call, but don't wait on the answer */ res = ast_call(tmp->chan, numsubst, 0);