|
|
|
@ -2009,17 +2009,31 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
|
|
|
|
|
struct ast_channel *monitor_chans[2];
|
|
|
|
|
struct ast_channel *active_channel;
|
|
|
|
|
int res = 0, ready = 0;
|
|
|
|
|
struct timeval started;
|
|
|
|
|
int x, len = 0;
|
|
|
|
|
char *disconnect_code = NULL, *dialed_code = NULL;
|
|
|
|
|
|
|
|
|
|
if (!(chan = ast_request(type, format, data, &cause))) {
|
|
|
|
|
ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
|
|
|
|
|
switch(cause) {
|
|
|
|
|
case AST_CAUSE_BUSY:
|
|
|
|
|
state = AST_CONTROL_BUSY;
|
|
|
|
|
break;
|
|
|
|
|
case AST_CAUSE_CONGESTION:
|
|
|
|
|
state = AST_CONTROL_CONGESTION;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((chan = ast_request(type, format, data, &cause))) {
|
|
|
|
|
ast_set_callerid(chan, cid_num, cid_name, cid_num);
|
|
|
|
|
ast_string_field_set(chan, language, language);
|
|
|
|
|
ast_channel_inherit_variables(caller, chan);
|
|
|
|
|
pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", caller->name);
|
|
|
|
|
|
|
|
|
|
if (!ast_call(chan, data, timeout)) {
|
|
|
|
|
struct timeval started;
|
|
|
|
|
int x, len = 0;
|
|
|
|
|
char *disconnect_code = NULL, *dialed_code = NULL;
|
|
|
|
|
if (ast_call(chan, data, timeout)) {
|
|
|
|
|
ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ast_indicate(caller, AST_CONTROL_RINGING);
|
|
|
|
|
/* support dialing of the featuremap disconnect code while performing an attended tranfer */
|
|
|
|
@ -2131,26 +2145,13 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
|
|
|
|
|
|
|
|
|
|
ast_poll_channel_del(caller, chan);
|
|
|
|
|
|
|
|
|
|
} else
|
|
|
|
|
ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);
|
|
|
|
|
} else {
|
|
|
|
|
ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
|
|
|
|
|
switch(cause) {
|
|
|
|
|
case AST_CAUSE_BUSY:
|
|
|
|
|
state = AST_CONTROL_BUSY;
|
|
|
|
|
break;
|
|
|
|
|
case AST_CAUSE_CONGESTION:
|
|
|
|
|
state = AST_CONTROL_CONGESTION;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
ast_indicate(caller, -1);
|
|
|
|
|
if (chan && ready) {
|
|
|
|
|
if (chan->_state == AST_STATE_UP)
|
|
|
|
|
state = AST_CONTROL_ANSWER;
|
|
|
|
|
res = 0;
|
|
|
|
|
} else if(chan) {
|
|
|
|
|
} else if (chan) {
|
|
|
|
|
res = -1;
|
|
|
|
|
ast_hangup(chan);
|
|
|
|
|
chan = NULL;
|
|
|
|
|