summaryrefslogtreecommitdiff
path: root/pbx.c
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-09-14 22:35:53 +0000
committerMark Spencer <markster@digium.com>2004-09-14 22:35:53 +0000
commit238b9d24c608c5e195652beacc0146448a56bdce (patch)
tree0f872bb5b3ed0cb23ecdeca32d9dc71aa5e6fa22 /pbx.c
parent7457c51bc23a0c50039b92574e1122ce00f113a0 (diff)
Make sure patterns are always last (bug #2435)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/pbx.c b/pbx.c
index dd8abbd4a..2bc05ff5d 100755
--- a/pbx.c
+++ b/pbx.c
@@ -3830,7 +3830,13 @@ int ast_add_extension2(struct ast_context *con,
}
e = con->root;
while(e) {
- res= strcmp(e->exten, extension);
+ /* Make sure patterns are always last! */
+ if ((e->exten[0] != '_') && (extension[0] == '_'))
+ res = -1;
+ else if ((e->exten[0] == '_') && (extension[0] != '_'))
+ res = 1;
+ else
+ res= strcmp(e->exten, extension);
if (!res) {
if (!e->matchcid && !tmp->matchcid)
res = 0;