Tuesday, 23 October 2012

What is a VoIP Dial Plan?

( *xx | [3469]11 | 0 | [2-9]xxxxxx | 1xxx[2-9]xxxxxxS0 | xxxxxxxxxxxx. )

Dial Plan is a specially crafted text string, or script, that specifies how to interpret digit sequences as dialed by the VoIP user and how to convert those digit sequences into an outbound dial string to be used by your VoIP service provider (VSP) for call routing and termination.


I like to think of a dial plan as a type of "filter" that compares dialed digit sequences against the "rules" that have been specified in the dial plan script.  If the dialed digit sequence match any preset pattern or rule specified in your phone's dial plan script, your phone (ATA, IP-Phone, softphone, etc) will proceed to transmit the "validated" dial string to your VoIP service provider for call processing.

If the digits you dial do not match or pass validation by the predefined dial string script, the dial string is rejected and will not be sent to your VSP.

Generally speaking, the dial plan protects you from sending invalid dialed digit sequences to your VSP.  A dial plan can also be used to restrict calls to specified destinations.  As well, a dial plan can be crafted to prepend, append, or substitute the digits you enter into your keypad.  

Reasons for using dial plans:
  • Ensures that numbers are correctly dialed.
  • Allows various methods of speed-dialing.
  • Can be used to only allow calls to specific geographic locations.
  • Can be used to block numbers to specified destinations.

On the Cisco Linksys SPA series of phones, each outgoing line will be governed by a separately defined dial plan.  This is because each line may be registered to a different VSP (VoIP Service Provider).  Different VSP's may handle dial sequences differently or have different special dial string sequences for special call processing.  Thus, it is necessary to be able to customize each dial plan for each VSP being used.

Basic Dial Plan Syntax
A basic dial plan is comprised of a "collection" of defined sequences.  The required syntax for these collections are defined and illustrated below.

The following syntax definitions and examples are in common use for Cisco and Linksys SPA series of ATA's and IP-Phones.  Other device manufacturers may use different syntax specifications.

( )  Parentheses
The dial plan is always enclosed by a set of ( ).
i.e. ( Your dial plan goes here )

|   Vertical Bar, or Pipe symbol
Used to separate dial plan script options (digit sequences).   Can be thought of as a kind of OR operator.
e.g.  ( sequence1 OR sequence2 OR sequence3 OR etc... this example is conceptual only
e.g.  ( sequence1 | sequence2 | sequence3 | etc... )

Each sequence in the dial plan is compared against the dial string input by the user making a call.  If a match is detected, the call will be transmitted to the VSP (VoIP Service Provider).  If no sequence matches the user's input dial string, the call is blocked.

Digit Sequence Syntax
Allowed input digits are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, *, or #


Represents any single digit element from 0 through 9.
Multiple x's indicate multiple digits.
e.g. (xxxxxxxxxxx)
This example validates dialed numbers of 11-digits, only.

e.g. ( xxxxxxx | xxxxxxxxxx | xxxxxxxxxxx )
This example only allows numbers that are 7, 10, or 11 digits in dialing length.  No other sequences will be allowed, based on this dial plan.

.   Period
The period, when appended to an element, means the element preceding the period can be repeated 0 or more times.

e.g.  ( xxxx. )
This example allows three, or more, of any number digits to be sent.

In other words, there are no restrictions on what number combinations, or length, can be dialed following the minimum number of digits defined.  The digit followed by the period is an optional digit that can be repeated any number of times, including zero times (optional).  Thus, four x's followed by a period means a minimum of three digits are allowed, and more than three digits will also be allowed.

e.g.  ( xxxxxxxx. )
This example, of 8 x's, will allow a minimum dialing of 7-digits, or more.
In other words, this filter will allow calls to 7-digit, 10-digit, 11-digit, 13-digits, or more.  Actually, any number of digits of 7, or more in length, will be allowed.

[  ]  Subsets or Ranges  
The square bracket is used to limit the "range" of digits that can represent any single digit input position.  Only digits listed within the brackets will be allowed in that digit sequence position.

e.g.  ( [49]11 )
This example only allows the subset of digits 4 OR 9 to precede the digits 11.  In other words, only the sequences 411 and 911 will be allowed to be dialed.  All other 3-digit  x11 calls will be rejected.

e.g.  (  [3-8]11 )
This example will only allow 311, 411, 511, 611, 711, and 811 calls to be placed.  011, 111, 211, and 911 sequences will be rejected.

e.g.  ( [2-9]xxxxxx )
This example will only allow valid 7-digit phone numbers to be called.  In North America, 7-digit local phone numbers cannot begin with 0 OR 1.  Only 7-digit telephone numbers beginning with 2 through 9 are valid local area phone numbers.  Thus, in this example, any 7-digit sequence dialed beginning with 0 OR 1 will be rejected.

NOTE:  Not all VoIP providers allow 7-digit call routing.  Many, if not most, require a full 10-digit number dialing (including area code) before the call will be routed.  Some, even require a full 11-digit number dialing (including the North America country code of 1).  Thus, a properly crafted dial plan will facilitate this requirement.

e.g.  ( [2-9]xx[2-9]xxxxxx )
This example only allows valid 10-digit numbers to be dialed.  10-digit North American numbers must begin with the 3-digit Area Code and be followed by the 7-digit local exchange number being called.  Area codes only begin with the digits 2-9 and cannot begin with 0 or 1.  Thus, this dial plan example prevents misdialing or incorrectly dialing a standard format North American phone number that requires the inclusion of the area code.

e.g.  ( [2-9]xxxxxx | [2-9]xx[2-9]xxxxxx )
This example only allows 7-digit OR 10-digit number dialing for typical North America calls.

e.g.  ( [2-9]xxxxxx | [2-9]xx[2-9]xxxxxx | 1[2-9]xx[2-9]xxxxxx )
This example requires all numbers dialed to be 7, OR 10, OR 11 digits in length.  Otherwise, the calls will be rejected by the dial plan filter processing.

NOTE:  Spaces between dial plan elements are allowed and ignored.  Using spaces in your dial plan script may enhance readability and will not cause any effect on call processing or interpretation.

!  Number Barring
Placing the exclamation symbol at the end of a digit sequence will explicitly block that sequence from being transmitted.

e.g.  ( 411! | xxx | 1900xxxxxxx! | 1[2-9]xx[2-9]xxxxxx )
This dial plan will block 411 information calls even though all other 3-digit dialing is allowed.
As well, this plan will block all 1900 area premium services calls from being dialed, while at the same time allowing all other 11-digit long distance dialing to proceed.

Implicit Sequences
The SPA series of VoIP devices implicitly appends the vertical code sequences (2-digit * Star Codes) entered in the Regional parameters settings to the end of the device's dial plan for both Line-1 and Line-2.
What this means, is that you don't really need to specify 2-digit star code validation in the dial plan string.

As well, if "Enable_IP_Dialing" is enabled on the device, IP dialing is also accepted on the applicable phone line (Line-1, Line-2).

< : >   Subsequence Substitution

A sub-sequence of keys (possibly empty) can be automatically replaced with a different sub-sequence when your dial string sequence is preceded with angle bracket notation.

< "optional input" : "substitution string" > "element to be matched"
e.g.:   <  :403>xxxxxxx

Thus, the above example will cause a prepended substitution of digits (in this case, 403) before the number you are matching, which is: xxxxxxx.  Thus, any 7-digit number dialed will be prepended with 403, resulting in a transmitted number of 403xxxxxxx .

For example, lets say my VoIP provider requires all North America numbers to be dialed as 11-digit numbers.  Yet, I want to be able to dial numbers in my local area code as 7-digit numbers.  For this example, lets assume my area code is 250 (and North America country code is 1).  Now, the dial plan sequence will be written as:   ( < : 1250>xxxxxxx ) .

However, to correctly format this sequence for legitimate North American dialing, it needs to be modified as follows:
( < : 1250 >[2-9]xxxxxx )
Now, when I dial any 7-digit number, it will be prepended with 1250.  Thus, if I were to dial 555-1212, the resulting dial string to be sent would be 1-250-555-1212.

Timers and Digit Sequence Transmission Timing
There are various timing elements involved in the processing of your dialed calls.

Interdigit_Long_Timer
The Interdigit_Long_Timer specifies the maximum time delay allowed between dialed digits (expressed in seconds) when no candidate digit sequence has been matched against the dial plan.

Typically, this will be the time delay you experience when taking your phone off-hook before you are eventually greeted with the "fast busy signal".  The Long Timer will also time-out if you stop dialing in the middle of dialing a phone number and wait too long before proceeding to enter the next digit.  The default Interdigit_Long_Timer  delay is typically 10 seconds.

Interdigit_Short_Timer
The Interdigit_Short_Timer specifies the maximum time delay allowed between dialed digits (expressed in seconds) when at least one candidate digit sequence is complete, as dialed.  At the end of the timer delay, the number dialed will be immediately transmitted to your VSP.

The Interdigit_Short_Timer ensures that your dialed number is transmitted in a timely manner - as long as you dialed a valid number that matches one of your dial plan sequences.  The default Interdigit_Short_Timer delay is 3 seconds.

#
Send Immediate using the pound or hash key: #
When the # key is pressed following a series of dialed digits, it will cause the immediate processing of the dial string.  It will bypass any delays imposed by the Interdigit Timers.

e.g.:  If you dial 411# , the Interdigit delay is bypassed and the 411 string is immediately processed. without delay.

S0
Send Immediate (zero delay) when a match is encountered between the input dial string and the dial plan sequence that is matched, where S0 is specified.  Essentially, bypasses the default Interdigit Short Timer delay for faster call process, such as in the case of a 911 emergency call.
e.g.:  ( 911S0 | 1[2-9]xx[2-9]xxxxxx )



Dial Plan Examples


PAP2T, SPA2102, and SPA504G Default Dial Plan
(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)


CallCentric Recommended Dial Plan:
(*xxx|*75xx|[49]11|0|00|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.|**275*x.)


Notes:

Update (June 12, 2013)
I have just discovered a problem with CallCentric's previously recommended "dial plan" string that matches:
1xxx[2-9]xxxxxxS0

You may want to remove the S0 at the end of the 11-digit North American dialing string, to read as:
1xxx[2-9]xxxxxx

The dial string works just fine when dialing 11-digit North American phone numbers.  But, the problem NOW arises when dialing CallCentric in-network 14-digit Extension numbers.  Because CallCentric extension numbers (sub-accounts - recently implemented) begin with the digit 1 and append the 11-digit CallCentric number with an additional 3-digit "extension" number (for a total of 14-digits to dial), the S0 will cause the ATA or IP-Phone to "dial immediate" after it matches 11-digits (as designed).  But, this now creates a problem when dialing the CallCentric 14-digit sub-account numbers.  The solution is to just remove the S0 "send immediate" syntax from the 11-digit dial plan segment.