## Using Dial Peer Wildcards

As you have seen in the previous few sections, configuring dial peers (and destination patterns) without using wildcards would be extremely time consuming. By far, the most commonly used wildcard is the dot (.), which represents any dialed digit. There are a few other wildcards in addition to this that you will find useful in your configurations. Table 8.3 provides a description for these wildcards.

 Wildcard Description Period (.) Matches any dialed digit from 0-9 or the * key on the tele- phone keypad. For example, 20.. matches any number from 2000 through 2099. Plus (+) Matches one or more instances of the preceding digit. For example, 5+23 matches 5523, 55523, 555523, and so on. This trend continues up to 32 digits, which is the maximum length of a dialable number. Brackets ([]) Matches a range of digits. For example, [1-3]22 matches 122, 222, and 322. You can include a caret (A) before the entered numbers to designate a "does not match" range. For example, [A1-3]22 matches 022, 422, 522, 622, 722, 822, 922, and *22. T Matches any number of dialed digits (from 0-32 digits). Comma (,) Inserts a one-second pause between dialed digits.

Note The pound symbol (#) on a telephone keypad is not a wildcard symbol. This key immediately processes a dialed number when it is entered without waiting for additional digits.

Tip If you plan to create a dial peer using only the T wildcard as the destination pattern, Cisco recommends that you create the destination as .T. This requires a user to dial at least one digit to match the destination pattern. Otherwise, a phone left off-hook for too long without a dialed digit will match the destination pattern.

Typically, the brackets wildcard is the most difficult to understand, primarily because it is the most flexible. Take the examples shown in Table 8.4.

 Pattern Description 555[1-3]... Matches dialed numbers beginning with 555, having 1, 2, or 3 as the fourth digit, and ending in any three digits [14-6]555 Matches dialed numbers where the first digit is 1, 4, 5, or 6 and the last three digits are 555 55[59]12 Matches dialed numbers where the first two digits are 55, the third digit is 5 or 9, and the last two digits are 12

[A1-7]..[135] Matches dialed numbers where the first digit is not 1-7, the second and third digits are any number, and the last digit is 1, 3, or 5

[A1-7]..[135] Matches dialed numbers where the first digit is not 1-7, the second and third digits are any number, and the last digit is 1, 3, or 5

These wildcards are most often used when creating dial plans for PSTN access. Initially, the most logical destination pattern choice for the PSTN may seem to be 9T (9 for an outside line followed by any number of digits). The problem with this is that Cisco designed the T wildcard to match variable-length strings from 0-32 digits. When a user dials an outside number, such as 14805551212, the router configured with the T wildcard will sit silently and wait for the user to dial more digits. By default, the router will wait for additional dialed digits for 10 seconds, which is the interdigit timeout (also called the T302 timer). Although you can force the router to process the call immediately after dialing the number by pressing the pound key (#), this is not something you would want to train all your users to do.

Creating a PSTN dialing plan using wildcards other than T is not extremely difficult as long as you think through the reachable PSTN numbers. Table 8.5 provides a sample PSTN dial plan that you could use in the United States.

Chapter 8: Configuring and Verifying Gateways and Trunks 269 Table 8.5 Sample PSTN Destination Patterns for North America

 Pattern Description [2-9] Used for 7-digit dialing areas [2-9]..[2-9] Used for 10-digit dialing areas 1[2-9]..[2-9] Used for 11-digit long-distance dialing [469]11 Used for service numbers such as 411, 611, and 911 011T Used for international dialing Note Although you symbol, doing so can can manually create an international dial plan without using the T become quite tedious.

The configuration in Example 8.12 illustrates the configuration of a North American PSTN dial plan on a router. In this example, the T1 CAS voice port 1/0:1 is connected to the PSTN and internal users must dial 9 for outside PSTN access.

Example 8.12 Configuring a North American PSTN Dial Plan

 VOICE RTR(config)# dial-peer voice 90 pots VOICE _RTR(config-dial-peer)# description Service Dialing VOICE _RTR(config-dial-peer)# destination-pattern 9[469]11 VOICE _RTR(config-dial-peer)# forward-digits 3 VOICE _RTR(config-dial-peer)# port 1/0:1 VOICE _RTR(config-dial-peer)# exit VOICE RTR(config)# dial-peer voice 91 pots VOICE _RTR(config-dial-peer)# description 10-Digit Dialing VOICE _RTR(config-dial-peer)# destination-pattern 9[2-9]..[2-9] VOICE _RTR(config-dial-peer)# port 1/0:1 VOICE _RTR(config-dial-peer)# exit VOICE RTR(config)# dial-peer voice 92 pots VOICE _RTR(config-dial-peer)# description 11-Digit Dialing VOICE _RTR(config-dial-peer)# destination-pattern 91[2-9]..[2-9] VOICE _RTR(config-dial-peer)# forward-digits 11 VOICE _RTR(config-dial-peer)# port 1/0:1 VOICE _RTR(config-dial-peer)# exit VOICE RTR(config)# dial-peer voice 93 pots VOICE _RTR(config-dial-peer)# description International Dialing VOICE _RTR(config-dial-peer)# destination-pattern 9011T VOICE _RTR(config-dial-peer)# prefix 011 VOICE _RTR(config-dial-peer)# port 1/0:1 VOICE _RTR(config-dial-peer)# exit

Two commands in this syntax deal with the automatic digit stripping feature of POTS dial peers: forward-digits <number> and prefix <number>. The forward-digits <number> command allows you to specify the number of right-justified digits you wish to forward. Notice the first dial peer 90 in Example 8.12. With a destination pattern of 9[469]11, the router would automatically strip the 9 and the two 1s from the pattern before sending the call. By entering the command forward-digits 3, the router will forward the right-justified three digits (411, 611, or 911) and only strip the 9.

The prefix <number> command will add any specified digits to the front of the dialed number before routing the call. This is useful for dial peer 93 in Example 8.12. Because international numbers can be a variable length, it is impossible to tell what value to enter for the forward-digits command. By using the prefix 011 command, the automatic digit stripping feature of POTS dial peers will strip the explicitly defined 9011 digits from the pattern, and the prefix command will then add the 011 back in its place.