Freeswitch R14: SIP Trunk Provisioning Guide
Freeswitch R14: SIP Trunk Provisioning Guide
R14
ABSTRACT
FreeSWITCH is a freely distributed soft switch that can be configured as an IP PBX; it is
supported by a wide variety of operating systems to include MS Windows, FreeBSD, Solaris,
and all Linux distributions. This document covers FreeSWITCH 1.2 interoperation with
MegaPath R14 SIP trunks. For the purpose of instruction, a brief explanation of the
installation process is provided for the Debian 6.0 Linux distribution. This document covers
FreeSWITCH deployed downstream of a third-party firewall and of an Edgemarc SIP ALG.
INTRODUCTION......................................................... 1
1. INSTALLATION ....................................................... 1
2. STANDARD FIREWALL ................................................ 3
2.1 DIAL PLAN .........................................................
2.1.1 OUTBOUND DIAL PLAN.............................................
2.1.2 INBOUND DIAL PLAN .............................................
2.2 SIP PROFILE .......................................................
2.3 ACCESS CONTROL .....................................................
2.4 DIRECTORY (USER EXTENSIONS) ..........................................
2.5 CHECKING THE SIP TRUNK REGISTRATION....................................
3
3
4
5
6
7
8
INTRODUCTION
FreeSWITCH is a freely distributed softswitch that can be configured as IP PBX. FreeSWITCH
has grown in popularity among the open source community and has become the prevalent
SIP telephony engine in many SIP server open source projects. FreeSWITCH runs a wide
variety of operating systems to include MS Windows, FreeBSD, Solaris, and all Linux
distributions.
For the purpose of instruction, a brief explanation of the installation process is provided for
the Debian 6.0 Linux distribution.
This documents provides the basic configuration parameters for MegaPath R14 SIP trunks
FreeSWITCH 1.2 deployed downstream of a third-party firewall and downstream of an
Edgemarc SIP application-layer gateway.
It should be noted that all FreeSWITCH configurations files are XML files.
For additional information regarding FreeSWITCH, see http://www.freeswitch.org/.
1. INSTALLATION
This installation guide assumes a fresh install of Debian 6.0 (squeeze).
1. From the command line with root privileges, install the following Debian packages:
autoconf
automake
g++
git-core
libjpeg62-dev
libncurses5-dev
libtool
make
python-dev
gawk
pkg-config
dnsutils
psmisc
tcpdump
2. Change to the directory /usr/local/src and issue the following commands to download
and bootstrap the latest 1.2 source:
git clone git://git.freeswitch.org/freeswitch.git
cd freeswitch
./bootstrap.sh
3. Compile the source:
./configure
Make
4. Install FreeSWITCH:
make all install cd-sounds-install cd-moh-install
1
The following section describes a dial plan for local, toll-free, and long-distance outbound
calls, using regular expression for dial-pattern matching.
NOTES:
The gateway all calls are routed to is the gateway named speakeasy and this
gateway name is configured later on in the SIP profile XML file used to configure
the R14 SIP trunk.
The authentication username associated with the R14 trunk is demotrunk02.
The authentication password associated with the R14 trunk is h3g3m0nyn0w.
The DID associated with the R14 SIP trunk in this example is 312-533-4875.
/usr/local/freeswitch/conf/dialplan/default/00_dialplan.xml
<include>
<extension name="local">
<condition field="destination_number" expression="^([0-9]{7})$">
<action application="set"
data="effective_caller_id_number=${effective_caller_id_number}"/>
<action application="set"
data="effective_caller_id_name=${effective_caller_id_name}"/>
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/gateway/speakeasy/312$1"/>
</condition>
</extension>
<extension name="tollfree">
</groups>
</domain>
</include
Once setup as a pointer, the user extension itself can be configured; all user extensions by
default are under /usr/local/freeswitch/conf/directory/default.
IMPORTANT: Ensure that the caller-ID number is set to a DID associated with the R14 SIP
trunk, as the proper caller-ID number is required by the R14 SIP trunk in order to establish
an outbound call.
/usr/local/freeswitch/conf/directory/default/1500.xml
<include>
<user id="1500">
<params>
<param name="password" value="$${default_password}"/>
<param name="vm-password" value="1500"/>
</params>
<variables>
<variable name="user_context" value="default"/>
<variable name="effective_caller_id_name" value="1500"/>
<variable name="effective_caller_id_number" value="3125334875"/>
<variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
<variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
<variable name="callgroup" value="x-labs"/>
</variables>
</user>
</include>
The gateway all calls are routed to is the gateway named speakeasy and this
gateway name is configured later on in the SIP profile XML file used to configure
the R14 SIP trunk.
The authentication username associated with the R14 trunk is demotrunk02.
The authentication password associated with the R14 trunk is h3g3m0nyn0w.
The DID associated with the R14 SIP trunk in this example is 312-533-4875.
/usr/local/freeswitch/conf/dialplan/default/00_dialplan.xml
<include>
<extension name="local">
<condition field="destination_number" expression="^([0-9]{7})$">
<action application="set"
data="effective_caller_id_number=${effective_caller_id_number}"/>
<action application="set"
data="effective_caller_id_name=${effective_caller_id_name}"/>
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/gateway/speakeasy/312$1"/>
</condition>
</extension>
<extension name="tollfree">
<condition field="destination_number"
expression="^(1(8(0{2}|8{2}|7{2}|6{2})\d{7}))$">
<action application="set"
data="effective_caller_id_number=${effective_caller_id_number}"/>
<action application="set"
data="effective_caller_id_name=${effective_caller_id_name}"/>
<action application="set" data="no_media=true"/>
<action application="bridge" data="sofia/gateway/speakeasy/$2"/>
</condition>
9
name="proxy" value="172.16.1.1"/>
name="expire-seconds" value="3600"/>
name="register" value="true"/>
name="register-transport" value="udp"/>
name="retry-seconds" value="10"/>
12
13
14
15
16
17