aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-16 20:08:39 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-16 20:08:39 +0000
commit7fcacaee7f6cb2c12c93a787ec015247f0200375 (patch)
tree9ab66857d733f1381a12fd1309f72994b02adee4 /main/pbx.c
parent23abb459414aac23edaa8ae2f61be3723606d090 (diff)
Merged revisions 164801 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r164801 | murf | 2008-12-16 13:04:46 -0700 (Tue, 16 Dec 2008) | 36 lines (closes issue #14076) Reported by: toc Tested by: murf OK, Well this issue has had its share of flip-flopping. I found the following: 1. the code in question, in ext_cmp1 in pbx.c, would not allow two extensions that vary only by any dashes contained within them, to be defined in the same context. 2. for input dialstrings, dashes are NOT ignored. So, skipping them when sorting patterns seemed a bit silly. Thus, you might declare ext 891 in a context, but if you try dialing 8-9-1, it will NOT match 891. So, I proposed to remove the code from ext_cmp1 to skip the spaces and dashes. Just kept us from declaring 891 and 8-9-1 in the same context, forcing users to generate otherwise uselessly obfuscated dialplan code to get the same effect. Then, I tried out 1.4, and found that: 1. you can declare 891 and 8-9-1 in the same context! 2. You can't define 891, and have 8-9-1 match it! Nor can you define 8-9-1, and have 891 match it! So, it appears that my proposal simply restores the pbx to behaving as it did in 1.4. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@164803 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 719cc5fcd..d41000ba4 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -1620,8 +1620,6 @@ static void destroy_pattern_tree(struct match_char *pattern_tree) /* pattern tre
* Special characters used in patterns:
* '_' underscore is the leading character of a pattern.
* In other position it is treated as a regular char.
- * ' ' '-' space and '-' are separator and ignored. Why? so
- * patterns like NXX-XXX-XXXX or NXX XXX XXXX will work.
* . one or more of any character. Only allowed at the end of
* a pattern.
* ! zero or more of anything. Also impacts the result of CANMATCH
@@ -1644,8 +1642,7 @@ static void destroy_pattern_tree(struct match_char *pattern_tree) /* pattern tre
* considered specially.
*
* When we compare a pattern with a specific extension, all characters in the extension
- * itself are considered literally with the only exception of '-' which is considered
- * as a separator and thus ignored.
+ * itself are considered literally.
* XXX do we want to consider space as a separator as well ?
* XXX do we want to consider the separators in non-patterns as well ?
*/
@@ -1682,8 +1679,7 @@ static int ext_cmp1(const char **p)
/* load, sign extend and advance pointer until we find
* a valid character.
*/
- while ( (c = *(*p)++) && (c == ' ' || c == '-') )
- ; /* ignore some characters */
+ c = *(*p)++;
/* always return unless we have a set of chars */
switch (toupper(c)) {