Dial plan
From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia
Contents |
[edit] Defining the dial plan
A dial plan establishes the expected length and format of a typical, valid telephone number. When a user dials a number that has the same length and format as a predefined dial plan, the phone can recognize that dialing pattern and route it to the appropriate SIP address automatically when it is complete.
In the U.S., some typical dial plans include:
- Internal extension numbers of two, three, or four digits.
- Local numbers of seven digits, which may be preceded by a 9 if required to access an outside line.
- Long distance numbers of eleven digits, consisting of a 1, then a three-digit area code, then a seven-digit number; Preceded by a 9 if required.
- International numbers of any length starting with 011 and preceded by a 9 if required
[edit] Dial plan syntax
The syntax used to identify a dial plan in a digit map is adapted from RFC 2705.
To specify a |
Enter the following |
Result |
|---|---|---|
| Digit | | Identifies a specific digit (do not use #) |
| Range | | Identifies any digit dialed that is included in the range |
| Range | | Specifies a range as a comma separated list |
| Wildcard | | x matches any single digit that is dialed |
| Wildcard | | . matches an arbitrary number of digits |
| Timer | | Indicates that an additional time out period of 4 seconds should take place before automatic dialing starts |
Some dial plan examples using the above syntax look as follows:
For calls to |
Users dial |
Dial plan |
|---|---|---|
| Internal Extension | | xx |
| Local Number | | 9xxxxxxxT |
| Emergency | | 911 |
| Local Operators | | 90T |
| Long Distance | | 91xxxxxxxxxx |
| International | | 9011x.T |
[edit] Setting up a dial plan
Using the browser-based interface, choose Administration, then Phone Configuration. In the text box for digit maps, you specify the dial plan first, before a separating space and colon.
If you edit the user-config file directly, you enter the dial plan after the parameter name and a period (.) as follows:
PHONESET_DIGITMAP.9xxxxxxxT :
You supply the SIP address that corresponds to this dial plan after the colon. See below for more information on supplying a SIP address. You can enter each of the dial plans for your PHONESET_DIGITMAP configuration parameter on an individual line, or you can concatenate several dial plans into a single string. To do so, you separate each dial plan with a vertical bar or “pipe” character (|), and enclose the complete string in parentheses. For example, this single string describes an example dial plan:
(xx|9xxxxxxxT|911|90|91xxxxxxxxxx|9011x.T) :
However, all of the dial plans in a concatenated string map to the same SIP address. To map dialing plans to different SIP addresses, you can set them up individually, or set up different concatenated subsets like this:
(xx|9xxxxxxxT) : (911) : (90|91xxxxxxxxxx|9011x.T) :
Where each subset will map to a different SIP address.
Tip: Set the PHONESET_DIALPLAN_LENGTH parameter to a value equal to the longest dial plan you define for the PHONESET_DIGITMAP parameter.
[edit] SIP addresses for digit maps
The address portion of a PHONESET_DIGITMAP value identifies a SIP Proxy Server, SIP Redirect Server, SIP gateway, or SIP phone. For example, these dial plans map to different SIP addresses:
In the user-config file you enter these values after the parameter name: PHONESET_DIGITMAP.0 : sip:operator@mycompany.com PHONESET_DIGITMAP.411 : sip:helpdesk@mycompany.com PHONESET_DIGITMAP.(911|9911) : sip:911@10.1.1.123 PHONESET_DIGITMAP.9xxxxxxxT : sip:{digits}@localservice.net
Note: If you set up a digit map for an emergency number, consider supplying the IP address of a gateway within your enterprise as the SIP address. This procedure minimizes reliance on a DNS server or SIP proxy in an emergency.
Supplying the SIP address portion of a digit map is optional: if you do not supply a specific SIP address for one or more of your defined dial plans, the phone uses the SIP server address defined for the phone’s SIP_DIRECTORY_SERVERS parameter as the SIP address for all calls that match that dial plan.
For example, in an environment with the Directory Server sip:sip.your.domain, this sample digit map specifies the address of the Directory Server as the SIP address:
9xxxx : sip:{digits}@sip.pingtel.net
The same result is accomplished by the following definition:
9xxxx :
[edit] {digits} and {vdigits}
As the example above shows, you have the option to supply the string {digits} as a part of any SIP address to represent the complete string of dialed digits. When a user dials a number that matches the dial plan, the dialed digits are substituted for this placeholder to establish the SIP address.
For example, with the browser-based interface, you can set up digit maps as follows:
9xxxxxxxT : sip:{digits}@localservice.net
91xxxxxxxxxx : sip:{digits}@longdistanceprovider.net
When a user dials to get an outside line and a local number, such as 9 375-4226, the call is addressed as: sip:93754226@localservice.net Alternatively, if you include {vdigits} in a digit map only unspecified digits are substituted into the SIP address.
For example:
9xxxxxxxT : sip:{vdigits}@localservice.net
By using {vdigits} instead of {digits}, when a user dials 9 375-4226 the call is addressed without the 9 as: sip:3754226@localservice.net
[edit] To set up a digit map
When you enter digit maps using the browser-based interface, you type each dial plan on an individual line using the format: dial plan, space, colon (:), space, SIP address. Dial plans that use the same SIP address can be concatenated. Generally, you will need to set up different PHONESET_DIGITMAP values for each of the SIP addresses in use by your organization.
ll
