aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-06 16:51:21 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-06 16:51:21 +0000
commita4c4257ac1ae5b983a65863f0c610822ee0623f3 (patch)
tree41e2c8ef1e050d024797670d2a96dfd88af4e25e /channels
parent8985564814f493bd6af68a8657d00724227b1c23 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@146711 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_local.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 1c4eaf56b..fa396bce4 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -483,6 +483,11 @@ 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);
+ 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) {
@@ -617,15 +622,22 @@ static struct local_pvt *local_alloc(const char *data, int format)
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;
}