[Freeswitch-svn] [commit] r6850 - freeswitch/trunk/scripts/contrib/trixter/dialplan

Freeswitch SVN trixter at freeswitch.org
Mon Dec 17 20:23:27 EST 2007


Author: trixter
Date: Mon Dec 17 20:23:27 2007
New Revision: 6850

Added:
   freeswitch/trunk/scripts/contrib/trixter/dialplan/
   freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.nl.xml
   freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.us.xml
   freeswitch/trunk/scripts/contrib/trixter/dialplan/localized.dialplan.xml

Log:
Adding a unified localized dialplan with NL and US example, this should work for most places on the globe



Added: freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.nl.xml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.nl.xml	Mon Dec 17 20:23:27 2007
@@ -0,0 +1,25 @@
+<!-- include this in the USER DIRECTORY variables section -->
+
+<!-- this is the default gateway to send calls to if enum fails -->
+<variable name="default_gateway" value="asterlink.com"/>
+
+<!-- the country code, only numeric -->
+<variablename="default_country_code" value="31"/>
+
+<!-- variable for international dialing -->
+<variable name="default_international_prefix" value="00"/>
+
+<!-- variable for local prefix -->
+<variablename="default_local_prefix" value="20"/>
+
+<!-- What matches international dialing -->
+<variable name="default_international_regexp" value="^${international_prefix}(\d+)$"/>
+
+<!-- What matches a domestic out of area call -->
+<variable name="default_domestic_regexp" value="^0([1-9]\d+)$"/>
+
+<!-- What matches a local same area call -->
+<variable name="default_local_regexp" value="^([1-9]\d+)$"/>
+
+<!-- What is dialed for direct routed stuff like emergency numbers -->
+<variable name="default_emergency_number" value="^112$"/>

Added: freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.us.xml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/dialplan/dialplan.us.xml	Mon Dec 17 20:23:27 2007
@@ -0,0 +1,25 @@
+<!-- include this in the USER DIRECTORY variables section -->
+
+<!-- this is the default gateway to send calls to if enum fails -->
+<variable name="default_gateway" value="asterlink.com"/>
+
+<!-- the country code, only numeric -->
+<variablename="default_country_code" value="1"/>
+
+<!-- variable for international dialing -->
+<variable name="default_international_prefix" value="011"/>
+
+<!-- variable for local prefix/area code -->
+<variablename="default_local_prefix" value="800"/>
+
+<!-- What matches international dialing -->
+<variable name="default_international_regexp" value="^${international_prefix}(\d+)$"/>
+
+<!-- What matches a domestic out of area call -->
+<variable name="default_domestic_regexp" value="^1?([2-9]\d{2}[2-9]\d{6})$"/>
+
+<!-- What matches a local same area call -->
+<variable name="default_local_regexp" value="^([2-9]\d{6})$"/>
+
+<!-- What is dialed for direct routed stuff like emergency numbers -->
+<variable name="default_emergency_number" value="^\d11$"/>

Added: freeswitch/trunk/scripts/contrib/trixter/dialplan/localized.dialplan.xml
==============================================================================
--- (empty file)
+++ freeswitch/trunk/scripts/contrib/trixter/dialplan/localized.dialplan.xml	Mon Dec 17 20:23:27 2007
@@ -0,0 +1,65 @@
+<!--
+    This is a fairly generic dialing plan for emergency, local, national and international calling
+    The user is required to have regexps defined as variables, either globals or per user
+
+    VARS:
+    default_gateway                telco.com
+    default_country_code           31
+    default_international_prefix   00 for EU  011 for US
+
+    default_international_regexp   ^${international_prefix}(\d+)$
+    default_domestic_regexp        ^0([1-9\d+)$
+    default_local_regexp           ^([1-9]\d+)$
+    default_emergency_number       ^112$ in EU  ^911$ in NANPA (or looser ^\d11$ to get 611, 411, etc)
+    
+-->
+<context name="INT-Numbering-Plan">
+
+ <!--
+  For international
+ -->
+ <extension name="INT-International">
+   <condition field="destination_number" expression="^${default_international_regexp}$">
+     <action application="set" data="continue_on_fail=true"/>
+     <action application="set" data="hangup_after_bridge=true"/>
+     <action application="enum" data="$1"/>
+     <action application="bridge" data="${enum_auto_route}"/>
+     <action application="bridge" data="sofia/gateway/${default_gateway}/${default_international_prefix}$1"/>
+   </condition>
+ </extension>
+
+ <!--
+  For in country but out of area
+ -->
+ <extension name="INT-Domestic_out_of_area">
+   <condition field="destination_number" expression="${default_domestic_regexp}">
+     <action application="set" data="continue_on_fail=true"/>
+     <action application="set" data="hangup_after_bridge=true"/>
+     <action application="enum" data="${default_country_code}$1"/>
+     <action application="bridge" data="${enum_auto_route}"/>
+     <action application="bridge" data="sofia/gateway/${default_gateway}/${default_country_code}$1"/>
+   </condition>
+ </extension>
+
+ <!--
+     For same city calls
+ -->
+ <extension name="INT_Local">
+   <condition field="destination_number" expression="${default_local_regexp}">
+     <action application="set" data="continue_on_fail=true"/>
+     <action application="set" data="hangup_after_bridge=true"/>
+     <action application="enum" data="${default_country_code}${default_local_prefix}$1"/>
+     <action application="bridge" data="${enum_auto_route}"/>
+     <action application="bridge" data="sofia/gateway/${default_gateway}/${default_country_code}${default_local_prefix}$1"/>
+   </condition>
+ </extension>
+
+ <!--
+     Emergency service - verify your provider really supports this
+ -->
+ <extension name="INT_Emergency_Service">
+   <condition field="destination_number" expression="${default_emergency_number}">
+     <action application="bridge" data="sofia/gateway/${default_gateway}/$1"/>
+   </condition>
+ </extension>
+</context>



More information about the Freeswitch-svn mailing list