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.
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.
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 without the 1 as many modern systems allow these days dial plan 1003 would always match before 1002 even has a chance. This is our dilemma. Luckily I've already taken the time to figure out a simple solution.
dial-peer voice 1001 pots trunkgroup OUT description Long Distance destination-pattern 1?[2-9]..[2-9]...... forward-digits all ! dial-peer voice 1002 pots trunkgroup OUT description Local Calls destination-pattern .T forward-digits 7 ! dial-peer voice 1003 pots description International destination-pattern 011T port 0/0 !
By using the T wildcard in our local call destination pattern, we wait until our caller is done dialing until we process the call. Our long distance destination pattern matches long distance calls with our without a 1 before our area code. (Note: Enter Ctrl-V before entering ? from your keyboard ) Using this method does impose a delay while the system waits for additional digits. We can tune this down to just a couple seconds with the following command.
telephony-service timeouts interdigit 2 !
This completes our outbound calling, but we also need to implement a dial plan for the inbound calls. Our ephone-dn lines do not need dial-peers, as the number we setup there will be automatically be used. But our home phone needs a incoming dial-peer.
dial-peer voice 100 pots destination-pattern 50 port 1/0 !
This allows our Vonage line to ring our cordless phone, but unfortunately brings me to our next problem. Ringing both the ephone-dn 55 and the home extension 50 at the same time. Normally this is done using an SCCP controlled port using STCAPP. That method is not supported on anything affordable for us to use. (only newer ISRs support this feature for some reason) Luckily I found a Cisco Voip Guru named Paolo Bevilacqua that wrote a tcl script that allows us to implement a broadcast group. I'll detail how to setup the script in the conclusion to the series.
Network engineer currently servicing the enterprise data center market. I started working on networks in the ’90s and still feel like that was just a few years ago. Jack of all trades, master of none; I love to learn about everything. Feel free to ask me about photography, woodworking, nhra, watches, or even networking! — For feedback, please leave a comment on the article in question, and I’ll gladly moderate it several weeks later. For everything else including fan mail or death threats, contact me via twitter.