diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-25 10:04:06 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-12-25 10:04:06 +0000 |
commit | ce9db2711d88d6b93a4f908892b7e1db57caf6c2 (patch) | |
tree | e18e6a9df74827f35b95f1938e3370e08b26d167 | |
parent | 3b81cc3af25b724c9c37925038efc3e612ab04d9 (diff) |
Move check for extension existence below variable inheritance, due to the possible use of an eswitch.
(closes issue #16228)
Reported by: jlaguilar
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@299624 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_local.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index a798046eb..ef06830de 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -595,12 +595,6 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) ast_cdr_update(p->chan); p->chan->cdrflags = p->owner->cdrflags; - if (!ast_exists_extension(NULL, p->chan->context, p->chan->exten, 1, p->owner->cid.cid_num)) { - ast_log(LOG_NOTICE, "No such extension/context %s@%s while calling Local channel\n", p->chan->exten, p->chan->context); - ao2_unlock(p); - return -1; - } - /* copy the channel variables from the incoming channel to the outgoing channel */ /* Note that due to certain assumptions, they MUST be in the same order */ AST_LIST_TRAVERSE(&p->owner->varshead, varptr, entries) { @@ -614,6 +608,12 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) } ast_channel_datastore_inherit(p->owner, p->chan); + if (!ast_exists_extension(p->chan, p->chan->context, p->chan->exten, 1, p->owner->cid.cid_num)) { + ast_log(LOG_NOTICE, "No such extension/context %s@%s while calling Local channel\n", p->chan->exten, p->chan->context); + ao2_unlock(p); + return -1; + } + /* Start switch on sub channel */ if (!(res = ast_pbx_start(p->chan))) ast_set_flag(p, LOCAL_LAUNCHED_PBX); |