aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 07:45:14 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-10 07:45:14 +0000
commitc400f24164b9bd4d9e417ae964d120ebaccb28ca (patch)
treee4f3fe1ffc0ed069544ceef21daa5b183967eb93 /pbx.c
parent2b62b68b9aaba5b4a63ef948b4ea2ab14f975e54 (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.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 9080e4d81..24aa3febd 100644
--- a/pbx.c
+++ b/pbx.c
@@ -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;