[asterisk-commits] tilghman: branch 1.4 r299624 - /branches/1.4/channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 25 10:04:08 UTC 2010


Author: tilghman
Date: Sat Dec 25 04:04:06 2010
New Revision: 299624

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299624
Log:
Move check for extension existence below variable inheritance, due to the possible use of an eswitch.

(closes issue #16228)
 Reported by: jlaguilar

Modified:
    branches/1.4/channels/chan_local.c

Modified: branches/1.4/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/channels/chan_local.c?view=diff&rev=299624&r1=299623&r2=299624
==============================================================================
--- branches/1.4/channels/chan_local.c (original)
+++ branches/1.4/channels/chan_local.c Sat Dec 25 04:04:06 2010
@@ -595,12 +595,6 @@
 	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) {
@@ -613,6 +607,12 @@
 		}
 	}
 	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)))




More information about the asterisk-commits mailing list