DialPlan Component
A version of this page is also available for
4/8/2010
The dial plan defines a set of dialing rules to convert user dialed strings (from the Phone Application, Dialer or Contacts) into a format which is understood by the SIP server. Additionally the OEM can define a display string which is user friendly, can be used throughout the User Interface and is independent of the dial string used at the lower level.
A dial plan consists of a header and a set of rules.
Dial Plan Header
The header can include a <host> tag which enables you to represent the address of the host server with a token (e.g. $host$). The token can be substituted for the host address in a rule. This facilitates updating the rules quickly when the host address changes. The $host$
token can be associated with one of the following:
- An IP address. (for example, 192.168.50.9)
- A domain name. (for example, fourthcoffee.com)
- One of two predefined values:
#use_sipsrv_address#
- Specifies that the host address is the address of the active SIP server (main or backup SIP server)#use_sipsrv_host_name#
- Specifies that the host address is the domain portion of the user’s URI (provisioned user account)
The following example shows a Dial Plan header:
<dialplan-header>
<host>192.168.50.9</host>
</dialplan-header>
Dial Plan Rule
Each rule consists of a pattern and one or more formatting templates. The pattern is a regular expression which specifies the set of strings that a user or network provided string will be compared against to find a match. A formatting template specifies the format of the string to be sent to the SIP server, or the format of the string to be displayed to the user. Possible formatting templates are:
- “Dial”: Use this template to format the string into a URI which will be sent in the SIP INVITE. This template is optional. If it is not included in the rule then the phone number will be sent as entered.
- “Display”: Use this template to format the string into what is displayed to the user in the phone applications. This template is optional. If it is not included in the rule then the phone number will be displayed as entered
- “Transfer”: Use this template to format the string into what is sent in the “Refer-To:” header of a SIP REFER transaction. If this is not present, it is assumed that the “Dial” expression has the correct template.
Additionally, each rule can have a "restrict" clause. You can use the restrict clause to disallow calls made over VoIP, Cell or SMS (or all).
The following example shows a Dial Plan rule:
<rule pattern="(\d{1,3})\*(\d{1,3})\*(\d{1,3})\*(\d{1,3})" dial="\1.\2.\3.\4" display="\1.\2.\3.\4" restrict="Cell,SMS" />
The rule pattern indicates a match for strings, entered by the user, that consist of 4 groups of 1 to 3 numeric characters separated by asterisks (for example: "111*555*21*123", "127*0*0*1", etc). The dial and display templates convert the matched string to IP address format (for example '111.555.21.123') by specifying that the "match groups" should appear in the same order entered by the user and should be separated by a ".". For more information about Match groups see Dial Plan Dial Plan Regular Expression Engine - Language Summary. Finally the Restrict clause disallows cell or SMS calls.