[tr064] Normalize numbers in phonebook entries (#9733)
* [tr064] Normalize numbers in phone book entries. Phone book numbers and numbers to be looked up might be formatted differently (real world example: '+49 (12345) 67890' vs. '01234567890' (where the former is phonebook formatting and the latter is the format transmitted by the avmfritz binding). Make sure such formatting differences do not cause lookup mismatches. Signed-off-by: Danny Baumann <dannybaumann@web.de>
This commit is contained in:
@@ -168,6 +168,7 @@ The default is to use all available phonebooks from the specified thing.
|
||||
In case the format of the number in the phonebook and the format of the number from the channel are different (e.g. regarding country prefixes), the `matchCount` parameter can be used.
|
||||
The configured `matchCount` is counted from the right end and denotes the number of matching characters needed to consider this number as matching.
|
||||
A `matchCount` of `0` is considered as "match everything".
|
||||
Matching is done on normalized versions of the numbers that have all characters except digits, '+' and '*' removed.
|
||||
|
||||
## Rule Action
|
||||
|
||||
@@ -178,7 +179,8 @@ The phonebooks of a `fritzbox` thing can be used to lookup a number from rules v
|
||||
`phonebook` and `matchCount` are optional parameters.
|
||||
You can omit one or both of these parameters.
|
||||
The configured `matchCount` is counted from the right end and denotes the number of matching characters needed to consider this number as matching.
|
||||
A `matchCount` of `0` is considered as "match everything" and is used as default if no other value is given.
|
||||
A `matchCount` of `0` is considered as "match everything" and is used as default if no other value is given.
|
||||
As in the phonebook profile, matching is done on normalized versions of the numbers that have all characters except digits, '+' and '*' removed.
|
||||
The return value is either the phonebook entry (if found) or the input number.
|
||||
|
||||
Example (use all phonebooks, match 5 digits from right):
|
||||
|
||||
Reference in New Issue
Block a user