Last post we looked at dial-peers and the syntax that is needed to address endpoints. In this segment I want to explore the concept of creating destination-pattern that would be used on H.323 or SIP gateways to forward a call out of a POTS (Plain old Telephone System) port to the PSTN. In order to accomplish this, we will need to use variables to represent numbers that can be reached.
The possible variables that could be used are:
. — represents a single number position in which the range of numbers would be 0 through 9 including # and *.
, — this is used for pausing before dialing additional digits
[ ] — used to indicate a range of numbers in which only one single digit is matched from this range. For instance [02-9] would match the following possibilities, 0 2 3 4 5 6 7 8 and 9. Notice in the example 1 is not included in the range.
[^ ] — this is used to indicate an exclusion range of numbers. For instance [^289] would match 0 1 8 and 9 since it is not part of this exclusion range. Exclusions are rarely used in destination-patterns to match numbers.
? — Indicates that the preceding digit occurred zero or one time. It is important to remember to enter ctrl-v before entering ? from your keyboard.
% — value is used to indicate the preceding digit occurred zero or more times. This functions the same as the “*” used in regular expression.
+ — Indicates that the preceding digit occurred one or more times.
T — Indicates the interdigit timeout. The router pauses to collect additional dialed digits.
Now let’s see how we can build destination patterns with these variable types to represent the NANP (North American Numbering Plan).
First, we want to include all the service codes within the NANP which would be 211 311 411 511 611 711 811 and 911. The pattern on the gateway would be [2-9]11.
For seven digit dialing sequence we would include potentially two patterns:
[2-9][02-9]….. and [2-9].[02-9]…. the purpose behind this is not to overlap static emergency numbers that are set in the dial-plan being 911 and 9911. The second statement would use a trunk access code of 9 if used.
For 10 digit local dialing we would simply add the area code directly. So for the San Diego Area, two patterns would look like: 619[2-9]…… and 858[2-9]…… the reason for [2-9] at the beginning of the NANP prefix is making sure the rule that the area code or prefix cannot begin with a 0 or 1. 0 would indicate operator request and 1 for long distance service.
For long distance you would use 1[2-9]..[2-9]…… making sure you included enough . to build a total of 11 digits.
The last pattern will be used to call countries with varying dial-plan lengths like Europe. This would look like: 011T in which ‘011’ is the North American request for international access and the T would keep collecting digits until the interdigit timer would go into effect which would be approximately 10 seconds for most gateways.
Next blog we will address incoming versus outgoing dial-peers and how it is used to bring up call legs.
Author: Joe Parlas
Variables used with destination patterns