aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-11 07:49:12 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-11 07:49:12 +0000
commit5bf6a9a7409469dd5556b6d6b16b0c6f156d4394 (patch)
treea4b3002a31de77a02d113e3c7e8d43a459e0ae59 /pbx.c
parenta89e611e5e0dff5b29b30594b0506e58efb4f436 (diff)
fix behaviour for earlymatch and matchmore.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26719 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/pbx.c b/pbx.c
index 8aae28a88..b458e1742 100644
--- a/pbx.c
+++ b/pbx.c
@@ -913,8 +913,6 @@ static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
struct ast_include *i;
struct ast_sw *sw;
- struct ast_exten *earlymatch = NULL;
-
/* Initialize status if appropriate */
if (q->stacklen == 0) {
q->status = STATUS_NO_CONTEXT;
@@ -952,14 +950,11 @@ static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
/* 0 on fail, 1 on match, 2 on earlymatch */
if (match && (!eroot->matchcid || matchcid(eroot->cidmatch, callerid))) {
- if (match == 2 && action == E_MATCHMORE && !earlymatch) {
- /* Match an extension ending in '!'.
- * As far as I can tell the decision in this case is final
- * and we should just return NULL to mark failure
- * (and get rid of the earlymatch variable and the associated
- * processing outside the loop).
+ if (match == 2 && action == E_MATCHMORE) {
+ /* We match an extension ending in '!'.
+ * The decision in this case is final and is NULL (no match).
*/
- earlymatch = eroot;
+ return NULL;
} else {
if (q->status < STATUS_NO_PRIORITY)
q->status = STATUS_NO_PRIORITY;
@@ -983,13 +978,6 @@ static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
}
}
}
- if (earlymatch) {
- /* Bizarre logic for E_MATCHMORE. We return zero to break out
- of the loop waiting for more digits, and _then_ match (normally)
- the extension we ended up with. We got an early-matching wildcard
- pattern, so return NULL to break out of the loop. */
- return NULL;
- }
/* Check alternative switches */
AST_LIST_TRAVERSE(&tmp->alts, sw, list) {
struct ast_switch *asw = pbx_findswitch(sw->name);