Cisco VOIP Basics – Cisco Dial Plans

by Tony Mattke on September 8, 2009



This is the third part of my Cisco voip basics series. ( Parts 1, 2 & 4 ) Our goal is to help you configure a Cisco voice gateway that you could use in your home office. This section is going to cover setting up your dial plans, and connecting to an external POTS line.

In our very first part of this series we talked about configuring a very basic dial peer as shown below. These work by matching a destination-pattern to a port. Simply stated, when the pattern is met, the call goes out that port, this works for both FXS and FXO ports.

!
dial-peer voice 100 pots
 destination-pattern 4040
 port 1/0
!

Before we move too far forward, lets establish a diagram for our voice network. The following shows our lines on voice ports 0/0 and 0/1, our analog phone for the house on voice port 1/0 and the extensions for the house.

voip-lab

In order to sent a call out an interface, we must setup a dial peer with a destination pattern that matches the number you’re going to dial. An example to match a 7 digit outgoing call here int he US might look something like this.

dial-peer voice 100 pots
 description Local Calls
 destination-pattern [2-9]..[2-9]...
 port 0/0
!

As you may remember, there are several wildcards and other symbols that can be used within the destination patterns. You may find the quite helpful in your setup at home, or in the field. Here they are again for your reference.

Wildcard Symbols Used in Destination Patterns

  • .  Indicates a single-digit placeholder. For example, 555…. matches any dialed string beginning with 555, plus at least four additional digits.
  • []  Indicates a range of digits. A consecutive range indicated with a hyphen (-), or a nonconsecutive range with a comma (,). Hyphens and commas can be used in combination ie [5-7,9].
    Note Only single-digit ranges are supported. ie [98-102] is invalid.
  • ()  Indicates a pattern; for example, 408(555). It is used in conjunction with the symbol ?, %, or +.
  • ?  Indicates that the preceding digit occurred zero or one time. Enter ctrl-v before entering ? from your keyboard.
  • %  Indicates that 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.

In addition to wildcard characters, the following characters can be used in the destination pattern.

  • Asterisk (*) and pound sign (#)—These characters on standard touch-tone dial pads can be used anywhere in the pattern. They can be used as the leading character (for example, *650), except on the Cisco 3600 series.
  • Dollar sign ($)—Disables variable-length matching. It must be used at the end of the dial string.
  • Circumflex symbol (^)—When used within brackets, allows you to eliminate a digit from consideration for dial peer matching purposes. For example, a destination pattern including [^7] would not match any string beginning with 7.

Trunk configuration

Since we have multiple lines of service in our example, we will want to setup a trunk group to allow us to dial outbound on either line. That way, your voice gateway can select either line to dial out on in case one line is in use. To join a line to a trunk group, simply add trunk-group [name] to the voice-port. In our example, we’ll be using trunk-group OUT.

voice-port 0/0
 trunk-group OUT
 connection plar opx yyyxxxzzzz   <-- incoming phone number
 description Phone Company (office)
!
voice-port 0/1
 trunk-group OUT
 connection plar opx yyyxxxzzzz
 description Vonage (home)
!

We can now use the trunk group instead of a port destination in our dial peers. Unfortunately unlike the data world, there are currently no dynamic routing protocols that propagate dial plans between telephony devices or routers. Until these protocols are created and implemented, all dial plans must be manually entered into each device. One could consider these dial plans as a list of static routes.

Dial Plans can be range from being extremely simple (preferred) to hideously complex (nightmare). There are several problems that come into play when designing a dial plan for your network. The one that is currently at the top of my list is differentiating between 10 digit long distance and 7 digit local calls. The problem here is that unlike a routing table, voice routers do not look for the most specific match by default, they simply match digits until a destination pattern is satisfied. An example might clear this up.

dial-peer voice 1001 pots
 trunkgroup OUT
 description Long Distance 11
 destination-pattern 1[2-9]..[2-9]......
 forward-digits all
!
dial-peer voice 1002 pots
 trunkgroup OUT
 description Long Distance 11
 destination-pattern [2-9]..[2-9]......
 forward-digits 7
!
dial-peer voice 1003 pots
 trunkgroup OUT
 description Local Calls
 destination-pattern [2-9]..[2-9]...
 forward-digits 7
!

If we were to dial a long distance number with the 1 + area code and etc, we would most certainly match dial peer 1001, but, if we were to dial witho