Skip to content
Snippets Groups Projects
Commit 7198e000 authored by Mark Spencer's avatar Mark Spencer
Browse files

Fix helper app

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1622 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 1b19a2b1
Branches
Tags
No related merge requests found
...@@ -1509,15 +1509,10 @@ struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, i ...@@ -1509,15 +1509,10 @@ struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, i
while( (var = strtok_r(NULL, "|", &tmp)) ) { while( (var = strtok_r(NULL, "|", &tmp)) ) {
pbx_builtin_setvar( chan, var ); pbx_builtin_setvar( chan, var );
} /* /JDG */ } /* /JDG */
if (oh->context && *oh->context)
strncpy(chan->context, oh->context, sizeof(chan->context) - 1);
if (oh->exten && *oh->exten)
strncpy(chan->exten, oh->exten, sizeof(chan->exten) - 1);
if (oh->callerid && *oh->callerid) if (oh->callerid && *oh->callerid)
ast_set_callerid(chan, oh->callerid, 1); ast_set_callerid(chan, oh->callerid, 1);
if (oh->account && *oh->account) if (oh->account && *oh->account)
ast_cdr_setaccount(chan, oh->account); ast_cdr_setaccount(chan, oh->account);
chan->priority = oh->priority;
} }
if (callerid && strlen(callerid)) if (callerid && strlen(callerid))
ast_set_callerid(chan, callerid, 1); ast_set_callerid(chan, callerid, 1);
...@@ -1561,8 +1556,18 @@ struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, i ...@@ -1561,8 +1556,18 @@ struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, i
ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data); ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
} else } else
ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data); ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
if (chan && (chan->_state == AST_STATE_UP)) if (chan) {
state = AST_CONTROL_ANSWER; /* Final fixups */
if (oh) {
if (oh->context && *oh->context)
strncpy(chan->context, oh->context, sizeof(chan->context) - 1);
if (oh->exten && *oh->exten)
strncpy(chan->exten, oh->exten, sizeof(chan->exten) - 1);
chan->priority = oh->priority;
}
if (chan->_state == AST_STATE_UP)
state = AST_CONTROL_ANSWER;
}
if (outstate) if (outstate)
*outstate = state; *outstate = state;
if (chan && res <= 0) { if (chan && res <= 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment