aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-09 14:12:26 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-09 14:12:26 +0000
commit737799dcdf12adf59c9cd4e20998196419141b4d (patch)
tree32a1c972076270c81e0d95e0da45712ccc291bcf /channel.c
parent1b1186d189096dc6f172d3f1b0847300a83114da (diff)
Fix helper app
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1622 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rwxr-xr-xchannel.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/channel.c b/channel.c
index 094a8a330..e6a543745 100755
--- a/channel.c
+++ b/channel.c
@@ -1509,15 +1509,10 @@ struct ast_channel *__ast_request_and_dial(char *type, int format, void *data, i
while( (var = strtok_r(NULL, "|", &tmp)) ) {
pbx_builtin_setvar( chan, var );
} /* /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)
ast_set_callerid(chan, oh->callerid, 1);
if (oh->account && *oh->account)
ast_cdr_setaccount(chan, oh->account);
- chan->priority = oh->priority;
}
if (callerid && strlen(callerid))
ast_set_callerid(chan, callerid, 1);
@@ -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);
} else
ast_log(LOG_NOTICE, "Unable to request channel %s/%s\n", type, (char *)data);
- if (chan && (chan->_state == AST_STATE_UP))
- state = AST_CONTROL_ANSWER;
+ if (chan) {
+ /* 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)
*outstate = state;
if (chan && res <= 0) {