diff options
author | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 07:45:14 +0000 |
---|---|---|
committer | rizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-05-10 07:45:14 +0000 |
commit | c400f24164b9bd4d9e417ae964d120ebaccb28ca (patch) | |
tree | e4f3fe1ffc0ed069544ceef21daa5b183967eb93 /pbx.c | |
parent | 2b62b68b9aaba5b4a63ef948b4ea2ab14f975e54 (diff) |
document special character interpretation.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@26283 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r-- | pbx.c | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -560,6 +560,33 @@ static void pbx_destroy(struct ast_pbx *p) free(p); } +/* + * 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. + * . 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 + * and MATCHMORE. Only allowed at the end of a pattern. + * / should not appear as it is considered the separator of the CID info. + * XXX at the moment we may stop on this char. + * + * X Z N match ranges 0-9, 1-9, 2-9 respectively. + * [ denotes the start of a set of character. Everything inside + * is considered literally. We can have ranges a-d and individual + * characters. A '[' and '-' can be considered literally if they + * are just before ']'. + * XXX currently there is no way to specify ']' in a range, nor \ is + * 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. + * 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 ? + */ + /*! * \brief helper functions to sort extensions and patterns in the desired way, * so that more specific patterns appear first. @@ -722,6 +749,10 @@ static int _extension_match_core(const char *pattern, const char *data, enum ext return 0; } pattern++; /* skip leading _ */ + /* + * XXX below we stop at '/' which is a separator for the CID info. However we should + * not store '/' in the pattern at all. When we insure it, we can remove the checks. + */ while (*data && *pattern && *pattern != '/') { const char *end; |