diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-16 18:59:02 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-16 18:59:02 +0000 |
commit | 2efc505dda442537688b8a34a7e8b4aad62bc353 (patch) | |
tree | 5898f0e4aed424e864baeb08787a6bf3ef357e65 /main/pbx.c | |
parent | 9062f796e716e3f126bb1588f5765ad6ba1a6826 (diff) |
This fixes a problem with pattern ranges; and corrects a situation in res_features, where an extension would be created with the name Zap/51, as an example. THe / is bad because it would tend to mean that the 51 is to be cid matched.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89329 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 9b3b62934..359d2b0c9 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -868,8 +868,10 @@ static void log_match_char_tree(struct match_char *node, char *prefix) static void cli_match_char_tree(struct match_char *node, char *prefix, int fd) { char my_prefix[1024]; - - ast_cli(fd, "%s%s:%c:%d:%s%s\n", prefix, node->x, node->is_pattern ? 'Y':'N', node->specificity, node->exten? "EXTEN:":"", node->exten ? node->exten->exten : ""); + if (strlen(node->x) > 1 ) + ast_cli(fd, "%s[%s]:%c:%d:%s%s\n", prefix, node->x, node->is_pattern ? 'Y':'N', node->specificity, node->exten? "EXTEN:":"", node->exten ? node->exten->exten : ""); + else + ast_cli(fd, "%s%s:%c:%d:%s%s\n", prefix, node->x, node->is_pattern ? 'Y':'N', node->specificity, node->exten? "EXTEN:":"", node->exten ? node->exten->exten : ""); strcpy(my_prefix,prefix); strcat(my_prefix,"+ "); if (node->next_char) @@ -1084,6 +1086,7 @@ struct match_char *add_exten_to_pattern_tree(struct ast_context *con, struct ast if (pattern && *s1 == '[' && *(s1-1) != '\\') { char *s2 = buf; buf[0] = 0; + s1++; /* get past the '[' */ while (*s1 != ']' && *(s1-1) != '\\' ) { if (*s1 == '\\') { if (*(s1+1) == ']') { @@ -1110,6 +1113,7 @@ struct match_char *add_exten_to_pattern_tree(struct ast_context *con, struct ast *s2++ = *s1++; } } + *s2 = 0; /* null terminate the exploded range */ specif = strlen(buf); } else { if (*s1 == '\\') { |