This article is one in a series to assist in the setup, troubleshooting, and maintenance of Cisco Small Business products.
The SPA allows each line to be configured with a distinct dial plan. The Dial Plan specifies how to interpret digit sequences dialed by the user, and how to convert those sequences into an outbound dial string.
The SPA syntax for the dial plan closely resembles the corresponding syntax specified by MGCP and MEGACO. Some extensions are added that are useful in an end-point.
The dial plan functionality is regulated by the following configurable parameters:
Dial_Plan ( and )
Other timers are configurable via parameters, but do not directly pertain to the dial plan itself. They are discussed elsewhere in this document.
Getting to Know Interdigit Long Timer
The Interdigit_Long Timer specifies the default maximum time (in seconds) allowed between dialed digits, when no candidate digit sequence is as yet complete (see discussion of Dial_Plan parameter for an explanation of candidate digit sequences).
Getting to Know Interdigit Short Timer
The Interdigit_Short_Timer specifies the default maximum time (in seconds) allowed between dialed digits, when at least one candidate digit sequence is complete as dialed (see discussion of Dial_Plan parameter for an explanation of candidate digit sequences).
Getting to know Dial Plan and Dial Plan
The Dial_Plan parameters contain the actual dial plan scripts for each of lines 1 and 2.
Getting to Know Dial Plan Digit Sequences
The plans contain a series of digit sequences, separated by the | character.? The collection of sequences is enclosed in parentheses, (' and ').
When a user dials a series of digits, each sequence in the dial plan is tested as a possible match.? The matching sequences form a set of candidate digit sequences. As more digits are entered by the user, the set of candidates diminishes until only one or none are valid.
Any one of a set of terminating events triggers the SPA to either accept the user-dialed sequence, or transmit it to initiate a call, or else reject it as invalid. The terminating events are:
No candidate sequences remain
The number is rejected.
Only one candidate sequence remains, and it has been matched completely
The number is accepted and transmitted after any transformations indicated by the dial plan, unless the sequence is barred by the dial plan (barring is discussed later), in which case the number is rejected.
o A timeout occurs: the digit sequence is accepted and transmitted as dialed if incomplete, or transformed as per the dial plan if complete.
o An explicit 'send' (user presses the '#' key): the digit sequence is accepted and transmitted as dialed if incomplete, or transformed as per the dial plan if complete.
The timeout duration depends on the matching state.? If no candidate sequences are as yet complete (as dialed), the Interdigit_Long_Timeout applies. If a candidate sequence is complete, but there exists one or more incomplete candidates, then the Interdigit_Short_Timeout applies.
White space is ignored, and may be used for readability.
Getting to Know Digit Sequence Syntax
Each digit sequence within the dial plan consists of a series of elements, which are individually matched to the keys pressed by the user. Elements can be one of the following:
Individual keys '0', '1', '2' . . . '9', '*', '#'.
The letter 'x' matches any one numeric digit ('0' .. '9')
A subset of keys within brackets (allows ranges): '[' set ']' (e.g.  means '3' or '8' or '9')
o Numeric ranges are allowed within the brackets: digit '-' digit (e.g. [2-9] means '2' or '3' or ... or '9')
o Ranges can be combined with other keys: e.g. [235-8*] means '2' or '3' or '5' or '6' or '7' or '8' or '*'.
Getting to Know Element Repetition
Any element can be repeated zero or more times by appending a period ('.' character) to the element. Hence, "01." matches "0", "01", "011", "0111", ... etc.
Getting to Know Subsequence Substitution
A subsequence of keys (possibly empty) can be automatically replaced with a different subsequence using an angle bracket notation: '<' dialed-subsequence ':' transmitted-subsequence '>'. So, for example, "<8:1650>xxxxxxx" would match "85551212" and transmit "16505551212".
Getting to Know Intersequence Tones
An outside line dial tone can be generated within a sequence by appending a ',' character between digits. Thus, the sequence "9, 1xxxxxxxxxx" sounds an "outside line" dial tone after the user press "9", until "1" is pressed.
Getting to Know Number Barring
A sequence can be barred (rejected) by placing a '!' character at the end of the sequence. Thus, "1900xxxxxxx!" automatically rejects all 900 area code numbers from being dialed.
Getting to Know Interdigit Timer Master Override
The long and short interdigit timers can be changed in the dial plan (affecting a specific line) by preceding the entire plan with the following syntax:
Long interdigit timer: 'L' ':' delay-value ','
Short interdigit timer: 'S' ':' delay-value ','
Thus, "L=8,( . . . )" would set the interdigit long timeout to 8 seconds for the line associated with this dial plan. And, "L:8,S:4,( . . . )" would override both the long and the short timeout values.
Getting to Know Local Timer Overrides
The long and short timeout values can be changed for a particular sequence starting at a particular point in the sequence. The syntax for long timer override is: 'L' delay-value ' '. Note the terminating space character.? The specified delay-value is measured in seconds. Similarly, in order to change the short timer override, use: 'S' delay-value <space>.
Getting to Know Pause
A sequence may require an explicit pause of some duration before continuing to dial digits, in order for the sequence to match. The syntax for this is similar to the timer override syntax: 'P' delay-value <space>. The delay-value is measured in seconds.
This syntax allows for the implementation of Hot-Line and Warm-Line services. In order to achieve this, one sequence in the plan must start with a pause, with a 0 delay for a Hot Line, and a non-zero delay for a Warm Line.
Getting to Know Implicit Sequences
The SPA implicitly appends the vertical code sequences entered in the Regional parameter settings to the end of the dial plan for both line 1 and line 2. Likewise, if Enable_IP_Dialing is enabled, then IP dialing is also accepted on the associated line.
This dial plan accepts only US-style 1 + area-code + local-number, with no restrictions on the area code and number:
This also allows seven-digit US-style dialing, and automatically inserts a 1 + 212 (local area code) in the transmitted number:
For an office environment, the following plan requires a user to dial 8 as a prefix for local calls and 9 as a prefix for long distance. In either case, an "outside line" tone is played after the initial 8 or 9, and neither prefix is transmitted when initiating the call.
The following allows only placing international calls (011 call), with an arbitrary number of digits past a required five digit minimum, and also allows calling an international call operator (00). In addition, it lengthens the default short interdigit timeout to four seconds.
The following allows only US-style 1 + area-code + local-number, but disallows area codes and local numbers starting with 0 or 1. It also allows 411, 911, and operator calls (0).
This allows US-style long distance, but blocks 9xx area codes:
This allows arbitrary long distance dialing, but explicitly blocks the 947 area code:
This implements a Hot Line phone, which automatically calls 1 212 5551234:
This provides a Warm Line to a local office operator (1000) after five seconds, unless a four-digit extension is dialed by the user:
Dial Plan Breakdown
A general Dial plan looks like (assume the numbers are subscripts):
<a:b> is basically a substitution syntax for stuff dialed at the beginning of the dial plan. This is an optional part of the plan.
Some examples include:
<8:1415> Replace a dialed "8" with "1415" (e.g. if user dials 84286511, we send 14154286511).
<:1415> Insert a "1415" into the number dialed
<9,:> When a 9 is dialed, present a second dialtone. The "9" is not sent.
<9:> If an initial 9 is dialed, don't send it.
c is a string of characters that restricts what digits can be dialed. This is a required part of the plan.
These characters can be:
* means the star (asterisk) key
# means the pound (hash) key
x means a single digit (0 through 9)
[x-y] means any digits x through y.
[xy] means the digits x and y (can put any number of digits here)
. means repeat the previously listed digit type zero or more times. For example x. means "zero or more digits," xx. means "one or more digits."
S0 is usually used at the end of a dial plan string that says "immediately dial when matched." Used for things like 911.
! is used at the end of the dial plan and it means "immediately reject the number dialed." Used to block, say, 900 numbers.
A few examples:
[2-9]xxxxxx matches typical 7-digit dialing in the US;
011xx. matches North American style International dialing (011 followed by one or more digits);
11S0 matches either 411 or 911 and immediately dials (doesn't wait for digit timeout).
<:@gwX> is specific to the SPA3102, SPA400, SPA3000, SPA9000 and means "dial out this gateway." This is an optional part of the plan.
This is specific to the SPA3000 and is optional. Basically it means "if you match the dial plan listed, dial out this gateway." If nothing is specified in this part of the SPA3000 dial plan on line 1, dial out via the VoIP provider defined on Line 1. The gateways are defined in the Gateway Accounts section of the Line 1 tab. gw0 is special and means "dial out the PSTN port."
gwX can also be replaced by a list of parameters that represent what's listed in the Gateway Accounts section. See the SPA Users Guide for more details.
For an example from the SPA3000 configuration Wizard, which uses most of these items:
This breaks down as follows:
211, 311, 411, 511, 611, 711, and 911 are routed out the PSTN Line (gw0).
An arbitrary number of digits, which will be routed out the Line 1 VoIP Provider configuration;
Dial * then dial one or more digits (routed out Line 1 VoIP Provider);
Dial ** then dial one or more digits (routed out Line 1 VoIP Provider);
Dial #1 then dial one or more digits (routed out Gateway 1 Provider (gw1));
Dial #9 then dial one or more digits (routed out PSTN Line);
Dial #9* then two digits (routed out PSTN Line, i.e. for star codes).