Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Setting Up Freeswitch On Debian 5 (Lenny)


Introduction

FreeSWITCH is an open-source telephony platform designed to facilitate the creation of voice and chat driven products scaling from a soft-phone up to a soft-switch. It can be used as a simple switching engine, a PBX, a media gateway or a media server to host IVR applications using simple scripts or XML to control the callflow.

Setup environment

OS: Linux
Distribution: Debian 5 (Lenny)
Date: 12/11/2009
Prerequisite: minimal install
Freeswitch version: 1.0.4

 

When/Where to use Freeswitch

Scenarios where freeswitch fits in:

Rating & Routing Server
Transcoding B2BUA
IVR & Announcement Server
Conference Server
Voicemail Server
SBC (Session Border Controller)
Basic Topology Hiding Session Border Controller
Zaptel, Sangoma, Rhino, PIKA Hardware Support (Analog and PRI)
And, of course, a PBX

 

Downloading Source

Debian lenny does not come with binaries of Freeswitch. Therefore we would be using “svn” repositories to build the binaries.

cd /usr/src
sudo apt-get install subversion build-essential autoconf automake libtool libncurses5 libncurses5-dev

svn checkout http://svn.freeswitch.org/svn/freeswitch/trunk freeswitch

This will download the source code from the web( ~311 Mb in size). Make sure you have Internet access.If you are behind proxy. Set the proxy in /root/.subversion/servers.

 

Building Binaries

cd freeswitch

Run the following command to check for any dependencies that may exist.

dpkg-checkbuilddeps

I needed these. Your requirements may vary. Fulfill them.

aptitude install automake1.9 unixodbc-dev libasound2-dev libcurl3-openssl-dev \
libcurl4-openssl-dev libssl-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev \
libdb-dev libgnutls-dev libtiff4-dev libmemcache-dev memcached libx11-dev

Start building the packages.

dpkg-buildpackage -rfakeroot

Note: During the building process still need Internet access. (The scripts fetch stuff fromt the web.)

Building process should take around 12 hours on a Pentium 4 with 1Gb ram & this should produce following debian packages (definitions listed only).

Description:

Freeswitch – The FreeSWITCH open source telephony platform

freeswitch-codec-passthru-amr – Pass through AMR Codec support for the FreeSWITCH(TM)

freeswitch-codec-passthru-g7231 – Pass through g723.1 Codec support for the FreeSWITCH(TM)

freeswitch-codec-passthru-g729 – Pass through g729 Codec support for the FreeSWITCH(TM)

freeswitch-dbg – The FreeSWITCH(TM) open source telephony platform Debug symbols

freeswitch-dev – Development Package for the FreeSWITCH(TM)

freeswitch-lang-de – German language files for the FreeSWITCH(TM)

freeswitch-lang-en – English language files for the FreeSWITCH(TM)

freeswitch-lang-es – Spanish language files for the FreeSWITCH(TM)

freeswitch-lang-fr – French language files for the FreeSWITCH(TM)

freeswitch-lang-it – Italian language files for the FreeSWITCH(TM)

freeswitch-lang-nl – Dutch language files for the FreeSWITCH(TM)

freeswitch-lua – A lua engine for FreeSWITCH(TM)

freeswitch-perl – A perl engine for FreeSWITCH(TM)

freeswitch-sounds-en-us-callie-16000 – English language files for the FreeSWITCH(TM) (16000)

freeswitch-sounds-en-us-callie-32000 – English language files for the FreeSWITCH(TM) (32000)

freeswitch-sounds-en-us-callie-8000 – English language files for the FreeSWITCH(TM)

freeswitch-sounds-music-8000 – Music on hold files for the FreeSWITCH(TM) (8000)

freeswitch-spidermonkey – A Javascript engine for FreeSWITCH(TM)

Installing the freeswitch debs:

Install all the packages. Alternatively you may skip installing other language packages except English (i.e. Freeswitch-lang-en).

dpkg -i freeswitch*.deb

This takes around 125 MB of storage

Configuration

Enable the daemon.

vi /etc/default/freeswitch

and change the parameter to “true”.

FREESWITCH_ENABLED="true"

Start the freeswitch daemon:

/etc/init.d/freeswitch start

Basic configuration is done.

To verfiy if freeswitch is running/listening, run lsof command. You should see freeswitch listening.

lsof -i udp

 

Configuration layout

 Function Location 
 SIP accounts /opt/freeswitch/conf/directory/*.*
 VoIP Gateways (Trunks) /opt/freeswitch/conf/sip_profiles/external
 Dialplan /opt/freeswitch/conf/dialplan/default/*
 Configure Telephony Cards  /opt/freeswitch/conf/autoload_configs/openzap.conf.xml

 

Creating a test extension:

Head over to this folder: /opt/freeswitch/conf/directory/default. This folder contains the extensions parameters for the default/Internal profile.

cd /opt/freeswitch/conf/directory/default

We will create an extension 3333 with password 4321.

vim /usr/local/freeswitch/conf/directory/default/3333.xml

Paste this into it.

<include>
  <user id="3333" mailbox="3333">
    <params>
      <param name="password" value="4321"/>
      <param name="vm-password" value="1000"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="3333"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension 3333"/>
      <variable name="effective_caller_id_number" value="3333"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
  </user>
</include>

Save & exit.

chown freeswitch:www-data 3333.xml

Configure your hard/softphone & the phone LCD/interface should state that you have 1 registered account. If it doesn’t restart the freeswitch or more elegantly reload the configuration of freeswitch.

Reloading configuration. Run this on the freeswitch cli (i.e /opt/freeswitch/bin/fs_cli):

freeswitch@internal> reloadxml

or

/etc/init.d/freeswitch restart

Congratulations. You are done.

 

Todo:

Trunking/Gateway
DB backend

 

References:

http://debian.org
http://wiki.freeswitch.org/wiki/Default_config
http://wiki.freeswitch.org/wiki/Getting_Started_Guide
http://www.fredshack.com/docs/freeswitch.html
http://freeswitch411.info/forum/index.php?topic=18.0
http://wiki.freeswitch.org/wiki/Rosetta_stone
http://wiki.freeswitch.org/wiki/Acl

Comments

comments