]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Move check for extension existence below variable inheritance, due to the possible...
authorTilghman Lesher <tilghman@meg.abyt.es>
Sat, 25 Dec 2010 10:04:06 +0000 (10:04 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Sat, 25 Dec 2010 10:04:06 +0000 (10:04 +0000)
(closes issue #16228)
 Reported by: jlaguilar

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@299624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_local.c

index a798046eb9870cab9af6b31826bdc3eda3ae71fa..ef06830de4f53a2ed53a762994f7b26ee6c52c6f 100644 (file)
@@ -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);