Reduce indentation level of ast_feature_request_and_dial

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Mark Michelson 17 years ago
parent 31e068ade2
commit 62130ba876

@ -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 *monitor_chans[2];
struct ast_channel *active_channel; struct ast_channel *active_channel;
int res = 0, ready = 0; 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_set_callerid(chan, cid_num, cid_name, cid_num);
ast_string_field_set(chan, language, language); ast_string_field_set(chan, language, language);
ast_channel_inherit_variables(caller, chan); ast_channel_inherit_variables(caller, chan);
pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", caller->name); pbx_builtin_setvar_helper(chan, "TRANSFERERNAME", caller->name);
if (!ast_call(chan, data, timeout)) { if (ast_call(chan, data, timeout)) {
struct timeval started; ast_log(LOG_NOTICE, "Unable to call channel %s/%s\n", type, (char *)data);
int x, len = 0; }
char *disconnect_code = NULL, *dialed_code = NULL;
ast_indicate(caller, AST_CONTROL_RINGING); ast_indicate(caller, AST_CONTROL_RINGING);
/* support dialing of the featuremap disconnect code while performing an attended tranfer */ /* support dialing of the featuremap disconnect code while performing an attended tranfer */
@ -2131,20 +2145,7 @@ static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *call
ast_poll_channel_del(caller, chan); ast_poll_channel_del(caller, chan);
} else done:
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;
}
}
ast_indicate(caller, -1); ast_indicate(caller, -1);
if (chan && ready) { if (chan && ready) {
if (chan->_state == AST_STATE_UP) if (chan->_state == AST_STATE_UP)

Loading…
Cancel
Save