Dial Plan Matching Priority

The device employs a "best-match" method instead of a "first-match" method to match the source or destination numbers to prefixes configured in the Dial Plan.

The matching order is done digit-by-digit and from left to right.

The best match-priority is listed below in chronological order:

1. Specific prefix.
2. "x" wildcard, which denotes any digit (0 through 9).
3. Number range.
4. "n" wildcard, which denotes a number from 2 through 9.
5. "z" wildcard, which denotes a number from 1 through 9.
6. Suffix, where the longest digits is first matched, for example, ([001-999]) takes precedence over ([01-99]) which takes precedence over ([1-9]).
7. "." (dot), which denotes any single character.

For example, the following table shows best matching priority for an incoming call with prefix number "5234":

Dial Plan Best Match Priority

Dial Plan Prefix

Best Match Priority (Where 1 is Highest)

5234

1

523x

2

523[2-6]

3

523n

4

523z

5

523(4)

6

523.

7

When number ranges are used in Dial Plan rules (comma-separated standalone numbers or hyphenated range), best match priority is as follows:

Dial Plan rules with ranges of multiple standalone numbers: The device chooses the matching rule in the Dial Plan Rule table that has the lowest row index number (i.e., listed higher up in the table). For example, if the prefix number of an incoming call is "110" and you have configured the below rules, the device chooses Index #0 because it has the lowest row index number (even though more numbers match the incoming call prefix number).

Index

Prefix

0

[1,3,5]

1

[110,120]

Dial Plan rules with ranges of contiguous numbers and the amount of possible matched numbers is identical: The device chooses the matching rule in the Dial Plan Rule table that has the lowest row index number (i.e., listed higher up in the table). For example, if the prefix number of an incoming call is "110" and you have configured the below rules (each rule has a range of 3 possible matching numbers), the device chooses Index #0 because it has the lowest row index number (even though more numbers match the incoming call prefix number).

Index

Prefix

0

[1-3]

1

[10-12]

Dial Plan rules with ranges of contiguous number and the amount of possible matched numbers is different: The device chooses the matching rule in the Dial Plan Rule table that has the least amount of numbers. For example, if the prefix number of an incoming call is "110" and you have configured the below rules (Index #0 with 7 possible matched numbers and Index #1 with 3 possible matched numbers), the device chooses Index #1 because it has less numbers.

Index

Prefix

0

[1-7]

1

[10-12]

Dial Plan rules with ranges of contiguous number and multiple standalone numbers: The device chooses the matching rule in the Dial Plan Rule table that has the standalone number range (not contiguous range). For example, if the prefix number of an incoming call is "110" and you have configured the below rules (Index #0 is a standalone number range and Index #1 a contiguous range), the device chooses Index #0 because it is the standalone number range.

Index

Prefix

0

[1,2,3,4,5]

1

[1-3]

Additional examples of best match priority for Dial Plan rules configured with a specific number and optionally followed by the "x" notation or prefix or suffix range are shown below:

For incoming calls with prefix number "5234", the rule with tag B is chosen (more specific for digit "4"):

Index

Prefix

Tag

0

523x

A

1

5234

B

For incoming calls with prefix number "5234", the rule with tag A is chosen (see match priority above):

Index

Prefix

Tag

0

523x

A

1

523[1-9]

B

For incoming calls with prefix number "53211111", the rule with tag B is chosen (more specific for fourth digit):

Index

Prefix

Tag

0

532[1-9]1111

A

1

5321

B

For incoming calls with prefix number "53124", the rule with tag B is chosen (more specific for digit "1"):

Index

Prefix

Tag

0

53([2-4])

A

1

531(4)

B

For incoming calls with prefix number "321444", the rule with tag A is chosen and for incoming calls with prefix number "32144", the rule with tag B is chosen:

Index

Prefix

Tag

0

321xxx

A

1

321

B

For incoming calls with prefix number "5324", the rule with tag B is chosen (prefix is more specific for digit "4"):

Index

Prefix

Tag

0

532[1-9]

A

1

532[2-4]

B

For incoming calls with prefix number "53124", the rule with tag C is chosen (longest suffix - C has three digits, B two digits and A one digit):

Index

Prefix

Tag

0

53([2-4])

A

1

53([01-99])

B

2

53([001-999])

C

For incoming calls with prefix number "53124", the rule with tag B is chosen (suffix is more specific for digit "4"):

Index

Prefix

Tag

0

53([2-4])

A

1

53(4)

B