Features/Dial Plan/XML

From Snom User Wiki

Jump to: navigation, search

Contents

Overview

The following explanation refers to:

Dial plans enable the snom SIP phone to support automatic dialing and automatic generation of a secondary dial tone. If a single dial plan is to be used for a system of phones, the dial plan is best specified in the default configuration file that is used to provision the phone in the beginning. When creating a dial plan, remember the following:

  • Dial plans must be in an .xml format and be stored on your phone or provisioned through http or tftp server.
  • <dialplan> indicates the start of a dialplan and </dialplan> indicates the end of a plan.
  • Rules are matched from start to finish with the longest matching rule taken as the one to use.

Syntax/How to Create a XML Dialplan

XML Dial plan can be placed either

<?xml version="1.0" encoding="utf-8" ?>
 <settings>
  <phone-settings></phone-settings>
  <functionKeys></functionKeys>
  <tbook></tbook>
  <uploads></uploads>
  <certificates></certificates>
  <dialplan e="2">
   <!--Example North American Dialplan-->
   <TEMPLATE MATCH="0" Timeout="1" User="Phone"/> 
   <TEMPLATE MATCH="9,011*" Timeout="6" User="Phone"/> 
   <TEMPLATE MATCH="9,0" Timeout="1" User="Phone"/> 
   <TEMPLATE MATCH="9,11" Timeout="0" User="Phone" Rewrite="9911"/> 
   <TEMPLATE MATCH="9,.11" Timeout="0" User="Phone"/> 
   <TEMPLATE MATCH="9,101..............." Timeout="0" User="Phone"/> 
   <TEMPLATE MATCH="9,10.............." Timeout="0" User="Phone"/> 
   <TEMPLATE MATCH="9,10*" Timeout="6" User="Phone"/>  
   <TEMPLATE MATCH="9,1.........." Timeout="0" User="Phone"/> 
   <TEMPLATE MATCH="9,......." Timeout="0" User="Phone"/> 
   <TEMPLATE MATCH="*" Timeout="15"/> 
  </dialplan>
 </settings>
<?xml version="1.0" encoding="utf-8"?>
<dialplan e="2">
 <!--Example North American Dialplan-->
 <TEMPLATE MATCH="0" Timeout="1" User="Phone"/> 
 <TEMPLATE MATCH="9,011*" Timeout="6" User="Phone"/> 
 <TEMPLATE MATCH="9,0" Timeout="1" User="Phone"/> 
 <TEMPLATE MATCH="9,11" Timeout="0" User="Phone" Rewrite="9911"/> 
 <TEMPLATE MATCH="9,.11" Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,101..............." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,10.............." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,10*" Timeout="6" User="Phone"/>  
 <TEMPLATE MATCH="9,1.........." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,......." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="*" Timeout="15"/> 
</dialplan>

where the following attributes are allowed:

  • e="2" defines that unicode-values inside xml-escapes (e.g. & # 6 4 ;) may be greater than 255.
  • MATCH=”pattern” is the dial pattern to match. While entering the pattern: numbers 0-9, * and # represent the keys on the phone that are entered. Use a period (.) to match any key. An asterisk (*) at the very end of the pattern matches one or more characters. Matching just the * key without interference with the wildcard character is done by escaping it with a backslash "\*". To have the phone generate a secondary dial tone when the part of the template matches, use a comma (,).
  • Timeout=”sec” is the number of seconds before a timeout will occur and the number will be dialed as entered by the user. To have the number dial immediately, specify 0.
  • User=”type” is the either IP or Phone. Enter User=phone or User=IP to have the tag automatically added to the dialed number. Currently User=phone is supported.
  • Rewrite=”altstrng” is the alternate string to be dialed instead of what the user enters. This field can be left empty.
  • identity=”number” is the identity that is used to establish the call. If no identity is given, the active identity is used.
  • If desired, specify at the end of each string where comment defines the type of plan (for example, Long Distance or Corporate Dial Plan).
  • Special note on dialplan nomenclature:
  1. The special characters supported in 'match' include '.' for any digit between 0-9.
  2. '*' as a wildcard for all charcaters and digits.
  3. '[' & ']' to specify a range for single digit input e.g. match="[4-7].." would mean any three digit number where the first digit is either 4, 5, 6 or 7 i.e. 4-7 inclusive of both limits.
  4. ',' is used to indicate secondary local dialtone. It often follows a digit usually 9 or 0.
  5. The closest logical match through all the dialplans would be selected for ay given input match. Ascending or descending order does not over rule this feature.
  6. If one doesn't want to specify a timeout, rewrite or user; either leave them empty or do not include them at all. In this case the default for all would be used.
  7. The dialplan attributes can be saved either in capital or small letters. The phone would internally store them in lower case.

Examples

  • Factory default (empty) XML dial plan:
<dialplan>
</dialplan>
  • Example XML dial plan file, e.g. http://domain/snom3x0/dialplan.xml
<?xml version="1.0" encoding="utf-8"?>
<dialplan>
  <template match="0" timeout="4" scheme="sip" user="phone" rewrite="" />
  <template match="00" timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="011............" timeout="4" scheme="sip" user="phone" rewrite="" />
  <template match="*79" timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="*234" timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="9,......." timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="424#" timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="...#" timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="[7-9].." timeout="0" scheme="sip" user="phone" rewrite="" />
  <template match="*[5-7][1-9]" timeout="0" scheme="sip" user="phone" rewrite="" /> 
</dialplan>
  • Sample North American Dial Plan
<dialplan>
 <TEMPLATE MATCH="0" Timeout="1" User="Phone"/> 
 <TEMPLATE MATCH="9,011*" Timeout="6" User="Phone"/> 
 <TEMPLATE MATCH="9,0" Timeout="1" User="Phone"/> 
 <TEMPLATE MATCH="9,11" Timeout="0" User="Phone" Rewrite="9911"/> 
 <TEMPLATE MATCH="9,.11" Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,101..............." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,10.............." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,10*" Timeout="6" User="Phone"/>  
 <TEMPLATE MATCH="9,1.........." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="9,......." Timeout="0" User="Phone"/> 
 <TEMPLATE MATCH="*" Timeout="15"/> 
</dialplan>
  • Working Sample Dial Plan
<?xml version="1.0" encoding="utf-8"?>
<dialplan>
 <Title>US Asterisk</Title>
 <TEMPLATE MATCH="25." Timeout="0" Scheme="sip" User="Phone" Rewrite="252" />
 <!-- test dp-->
 <TEMPLATE MATCH="\*.." Timeout="0" Scheme="sip" User="Phone" />
 <!-- Feature Access-->
 <TEMPLATE MATCH="9,763......." Timeout="0" Scheme="sips" User="Phone" Rewrite="763......." />
 <!-- Local 10 digit-->
 <TEMPLATE MATCH="9,612......." Timeout="0" User="Phone" Rewrite="612......." />
 <!-- Local 10 digit-->
 <TEMPLATE MATCH="9,651......." Timeout="0" User="Phone" Rewrite="651......." />
 <!-- Local 10 digit-->
 <TEMPLATE MATCH="9,952......." Timeout="0" User="Phone" Rewrite="952......." />
 <!-- Local 10 digit-->
 <TEMPLATE MATCH="9,0" Timeout="3" User="Phone" Rewrite="0" />
 <!-- Local operator-->
 <TEMPLATE MATCH="9,00" Timeout="0" User="Phone" Rewrite="00" />
 <!-- LD Operator-->
 <TEMPLATE MATCH="9,01*" Timeout="3" User="Phone" Rewrite="01%1" />
 <!-- International calls-->
 <TEMPLATE MATCH="9,011*" Timeout="3" User="Phone" Rewrite="011%1" />
 <!-- International calls-->
 <TEMPLATE MATCH="9,0.........." Timeout="0" User="Phone" Rewrite="0.........." />
 <!-- Operator assisted-->
 <TEMPLATE MATCH="9,.11" Timeout="0" Scheme="tel" User="Phone" Rewrite=".11" />
 <!-- Service numbers -->
 <TEMPLATE MATCH="9,101....1.........." Timeout="0" User="Phone" Rewrite="101....1.........." />
 <!-- Equal Access Service-->
 <TEMPLATE MATCH="9,101....0.........." Timeout="0" User="Phone" Rewrite="101....0.........." />
 <!-- Equal Access Service-->
 <TEMPLATE MATCH="9,1.........." Timeout="0" User="Phone" Rewrite="1.........." />
 <!-- Long Distance-->
 <TEMPLATE MATCH="9,......." Timeout="0" User="Phone" Rewrite="612......." />
 <!--  7 Digit Dialing-->
 <TEMPLATE MATCH="7.." Timeout="3" User="Phone" />
 <!-- Call Parking-->
 <TEMPLATE MATCH="1." Timeout="5" User="Phone" Rewrite="612548561." />
 <!-- Extension Dialing-->
 <TEMPLATE MATCH="611" Timeout="0" User="Phone" Rewrite="6519990888" />
 <!-- Sound Choice Comm Help -->
 <TEMPLATE MATCH="*" Timeout="15" />
 <!-- Anything else -->
</dialplan>

Backward compatibility to Regular Expression Dialplan from > V7.1.28

Previosuly used configuration parameters "user_dp_str" & "user_dp_exp" can be used again to setup "Regular Expression Dial Plans" for each SIP identity. This can be done either through provisioning or via the web user interface. If a corresponding "Regular Expression Dial Plans" for the outgoing SIP identity is not found, then the universal basic xml digitmap explained above will be used (if set).

Personal tools
Interoperability