CallerID matching

CallerID matching

You are here:
Estimated reading time: 1 min.

In some fields you can use the CallerID as a condition to execute an action (or to exclude it). This field allow certain special characters to match some parts of a Callerid.

Some examples:

  • if you enter +44, the system will match any number starting with 0044 or +44. So it will match +4412345 etc. as well;
  • if you enter 123,the system will match any number starting with 123. So it will match 123 but also 1234 and 12345;
  • if you enter 123$, only the number 123 will match;
  • if you enter ^123$|^456$, only numbers 123 and 456 will match.

Action rules are always executed in order. If you want to make an exception rule e.g.

‘all numbers starting with +44 will be routed to callgroup_X, except +4412345’

then the action with CallerID +4412345$ must be the first rule and the +44 must be the second. Otherwise, a caller with number +4412345 will match CallerID +44 and will never reach +4812345$ rule.

Details for those who are skilled in Regular expressions

The $regexp is anchored at the beginning of the CLID string, like it would be prefixed with ‘^’. This way a regular user does not need to know anything about the regular expressions for most typical use cases (matching number prefix).

$regexp – allowed values and quoting

A valid regexp for this condition is a non-empty string consisting only of the following:

  • digits: 0-9
  • letters: a-z and A-Z
  • regexp special characters: ‘.’, ‘*’, ‘|’, ‘[‘, ‘]’, ‘-‘, ‘^’, ‘$’, ‘+’, ‘{‘, ‘}’, ‘,’
  • other special characters: ‘_’
  • quotting character (can precede any of the above): \

These are valid regexp values: 123, .*123$, [1-5], .*\<abc\>, \+123, 12+3, 12{1,3}4
These are invalid: “something”, a\bc, x\\<yz, 1+23

For more information on regexp on Wikipedia

Was this article helpful?
No