[asterisk-commits] tilghman: branch 1.6.1 r146715 - in /branches/1.6.1: ./ channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 6 11:54:46 CDT 2008


Author: tilghman
Date: Mon Oct  6 11:54:45 2008
New Revision: 146715

URL: http://svn.digium.com/view/asterisk?view=rev&rev=146715
Log:
Merged revisions 146713 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r146713 | tilghman | 2008-10-06 11:52:14 -0500 (Mon, 06 Oct 2008) | 16 lines
  
  Merged revisions 146711 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r146711 | tilghman | 2008-10-06 11:51:21 -0500 (Mon, 06 Oct 2008) | 9 lines
    
    Check whether an extension exists in the _call method, rather than the _alloc
    method, because we need to evaluate the callerid (since that data affects
    whether an extension exists).
    (closes issue #13343)
     Reported by: efutch
     Patches: 
           20080915__bug13343.diff.txt uploaded by Corydon76 (license 14)
     Tested by: efutch
  ........
................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_local.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.1/channels/chan_local.c?view=diff&rev=146715&r1=146714&r2=146715
==============================================================================
--- branches/1.6.1/channels/chan_local.c (original)
+++ branches/1.6.1/channels/chan_local.c Mon Oct  6 11:54:45 2008
@@ -515,6 +515,11 @@
 	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);
+		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) {
@@ -660,15 +665,22 @@
 
 	tmp->reqformat = format;
 
+#if 0
+	/* We can't do this check here, because we don't know the CallerID yet, and
+	 * the CallerID could potentially affect what step is actually taken (or
+	 * even if that step exists). */
 	if (!ast_exists_extension(NULL, tmp->context, tmp->exten, 1, NULL)) {
 		ast_log(LOG_NOTICE, "No such extension/context %s@%s creating local channel\n", tmp->exten, tmp->context);
 		tmp = local_pvt_destroy(tmp);
 	} else {
+#endif
 		/* Add to list */
 		AST_LIST_LOCK(&locals);
 		AST_LIST_INSERT_HEAD(&locals, tmp, list);
 		AST_LIST_UNLOCK(&locals);
-	}
+#if 0
+	}
+#endif
 	
 	return tmp;
 }




More information about the asterisk-commits mailing list