FreeSwitch Introduction, Prerequisites for Installation,Installtion and Directory Structure

1. Definition of the Freeswitch :- Freeswitch is an OpenSource software for communications platform for the creation of voice and chat driven products. It can be used as switching engine, a PBX, and a media gateway or media server to host IVR application.
2. Prerequisites for Installation:- Prerequisites are mentioned on the freeswitch website which are “www.freeswitch.org”.
Prerequisites For RHEL/CentOS :

i. subversion
ii. autoconf
iii. automake
iv. libtool
v. gcc-c++
vi. ncurses-devel
vii. make
viii. zlib
ix. expat-devel
x. zlib-devel
xi. unixODBC-devel
xii. openssl-devel
xiii. gnutls-devel
xiv. libogg-devel
xv. libvorbis
xvi. curl-devel
For Fedora 9 and 10 there is a problem with the mod_xml_curl, mention in the website that fedora has a broken libcurl shipped with yum and you will end up with an unloadable mod_xml_curl.
so the solution is to compile freeswitch without –without-libcurl switch so freeswitch will then download and install its own libcurl and then you can link the mod_xml_curl module with that.

The above packages can be installed via yum bellow is the syntax.

#yum install Package-name (all small letters)

Prerequisites for Debian OS:

i. build-essential
ii. subversion
iii. subversion-tools
iv. automake
v. gcc-4.1
vi. autoconf
vii. make
viii. wget
ix. Libtool
x. g++
xi. libncurses5
xii. libncurses5-dev
xiii. libgdbm-dev
xiv. libdb4.4-dev
xv. libperl-dev
xvi. zlib1g-dev
xvii. python2.5 (If python integration is needed)
xviii. python2.5-dev
xix. libgnutls-dev
xx. libtiff4-dev
xxi. libx11-dev

The above all packages can be installed via apt-get below is the syntax.

$sudo apt-get install “package-name”

Some times there is error of segmentation fault with ubunto so there is a problem of ncurses package
Solutions is

$apt-get install ncurses-devel
$cd libs/libedit
$make clean
$cd ../..
$make clean
$make install
3. Installation:-

i. First we need to download new and stable release which is 1.0.6.
ii. Untar by “tar xvf freeswitch-1.0.6.tar.gz”
iii. Go to source of “freeswitch-1.0.6”
iv. ./configure
v. make
vi. make check
vii. make install

By default freeswitch installation directory is /usr/local/freeswitch.

To run freeswitch in its default configuration go to /usr/local/freeswitch/bin/

cd /usr/local/freeswitch/bin
Now run
./freeswitch
It will give freeswitch command prompt now you can run here freeswitch commands, your system is now up and running.
Configure your xlite phone with extension 1000 and password 1234 and it will work.

Path for the extension is /usr/local/freeswitch/conf/directory/default/1000.xml
Path for the default dialplan is /usr/local/freeswitch/conf/dialplan/default.xml
To stop freeswitch run “shutdown” from the freeswitch command line

Default Dialing extension
i. call Between 1000 and 1001 dialing respective extensions
ii. Dial 4000 to login to your voicemail box
iii. 870 – Redial last called number from this extension
iv. Eavesdrop 88+[ext] (“1,2,3”)
v. Dial 5900 to park call in a hold queue
vi. Dial 5901 pickup a call parked in queue (That was put there via 5900)
vii. 30+[conf] for conference

Directory Structure of the Freeswitch:-

By default freeswitch installs in the /usr/local/freeswitch directory.

i. Conf:-
The Most frequently use directory will be conf in /usr/local/freeswitch/conf here you will find all the configuration files that freeswitch use to do its job like creating dialplans, userprofiles, carriers(inbound and outbound) etc.
Basically freeswitch loads all configuration files in freeswitch.xml stored in /usr/local/freeswitch/conf/freeswitch.xml.
When freeswitch starts, it load all configuration files from freeswitch.xml and store in log/freeswitch.xml.fsxml. so if there is a problem in starting freeswitch so you can start troubleshooting from fsxml file because all the config are together there so you can point out the right line of error which gives freeswitch at start time.

Below is the default configuration files Overview Given by freeswitch developers.

ii. Mod:- Mod directory contains all the modules which are currently loaded.
iii. htdocs:- htdocs is the root directory for webserver you can point your webserver to this directory.
iv. Log:- in the log directory log will generate also freeswitch.xml.fsxml resides here .
v. Lib:- Here all libraries resides.
vi. Scripts:- here you can store custom scripts like javascript,lua,java etc and call in your dialplan.
vii. Sounds: Sounds directory contains sounds.
viii. Recordings: Can store recordings here like voicemail etc.

There are some more directories but that we will not usually use.

End of Default configuration Now in the next Tutorial we will learn how to create custom Dialplan and sip profiles.

Additional resources:
———————————-
http://www.freeswitch.org
http://wiki.freeswitch.org
http://jira.freeswitch.org
http://lists.freeswitch.org

Leave a Reply

Your email address will not be published. Required fields are marked *