Features/Dial Plan/XML

From Snom User Wiki

(Difference between revisions)
Jump to: navigation, search
m (Sample North American dial pla:: typo)
m (Sample North American dial plan:)
Line 26: Line 26:
== Example ==
== Example ==
-
===Sample North American dial plan:===
+
===Sample North American Dial Plan===
  <DIALPLAN>
  <DIALPLAN>

Revision as of 09:04, 19 June 2007

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.

How to Create a XML Dialplan

  1. Using an ASCII editor, open a new file.
  2. Type <DIALPLAN> to indicate the start of the dial plan template.
  3. For each of the numbering schemes that you wish to define, add the following string to the template, each starting on a separate line: <TEMPLATE MATCH=”pattern” Timeout=”sec” User=”type” Rewrite=”altstrng” where:
    • MATCH=”pattern” is the dial pattern to match. While entering the pattern: use a period (.) to match any character or use an asterisk (*) to match one or more characters. 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.
  4. If desired, specify at the end of each string where comment defines the type of plan (for example, Long Distance or Corporate Dial Plan).
  5. When completed, specify </DIALPLAN> to indicate the end of the dial plan template.
  6. Give the file a name of 'dialplan.xml'.

Example

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>

Factory Default (empty) Dial Plan

<?xml version="1.0" encoding="utf-8"?>
<DIALPLAN>
    <!-- test dp-->    
    <TEMPLATE MATCH="" Timeout="" Scheme="sip" User="Phone" Rewrite="" />
    <!TEMPLATE MATCH="........." Timeout="" Scheme="sip" User="Phone" Rewrite=".........." />
    <!-- test dp-->        
</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>
Personal tools
Interoperability