Supported Pattern Syntax

This topic describes the syntax supported in dial patterns, DID patterns, and Caller ID patterns, and provides examples to help you understand and configure patterns.

Pattern

A pattern can be an exact number, a special character, or a combination of numbers and special characters to match specific numbers.

The following table lists the special characters supported for pattern.

Character Description Example
X Match any digit from 0 to 9. 9XXX matches numbers from 9000 to 9999.
Z Match any digit from 1 to 9. 9ZZZ matches numbers from 9001 to 9999.
N Match any digit from 2 to 9. 9NNN matches numbers from 9002 to 9999.
[###] Match any digit enclosed in brackets.
Note: You can use - to specify a range of digits.
  • [123] matches 1, 2, or 3.
  • [12345-9] matches 1, 2, 3, 4, 5, 6, 7, 8, or 9.
. Match one or more digits. 9011. matches any number starting with 9011, excluding 9011 itself.
!

Match zero or more digits.

9011! matches any number starting with 9011, including 9011 itself.

{{.Ext}} placeholder

{{.Ext}} placeholder represents an extension number in a pattern and allows the pattern to dynamically match different extension numbers. It must be used together with a specific number.

Placeholder Description Example
{{.Ext}} Represent extension number. 550{{.Ext}} matches numbers starting with 550, where the digits after 550 correspond to extension number. It can be used in inbound routes to route calls to corresponding extensions, or in outbound routes as an extension-based Outbound Caller ID.
Inbound Route
When DID Pattern is set to Match DID Pattern to Users and 550{{.Ext}} is configured as the DID pattern, the followings can be achieved:
  • When callers dial 5503301, the call is routed to extension 3301.
  • When callers dial 5503302, the call is routed to extension 3302.
Outbound Route
When 550{{.Ext}} is configured as Outbound Caller ID, the followings can be achieved:
  • When users make outbound calls from extension 3301, 5503301 is used as the Outbound Caller ID.
  • When users make outbound calls from extension 3302, 5503302 is used as the Outbound Caller ID.