FreeSwitch is an open source telephony platform, with support for multiple protocols (SIP, IAX, Googletalk, Jabber, XMPP, WOOMERA/H.323, PRI/T1/E1) and it is cross platform (Linux, Windows and Mac). It is a softswitch which implies that it does the job of a traditional PBX and much more. It is scalable and has been tested to handle thousands of simultaneous calls. It is fully extendable and can be customized to meet customers VOIP needs.
FreeSwitch pre-built binaries packages are available for download for installation Linux, Windows and Mac, with minimal modules included to get it running. But to harness the power of FreeSwitch with the various modules it has, FreeSwitch needs to be built from source with the option of enabling the modules required for your custom PBX setup.
FreeSwitch development team recommends Debian as the operating system of choice, starting from FreeSwitch 1.6 a number of libraries required to build Freeswitch are included in Debian 8, this blog post will run through steps involved to build Freeswitch on a fresh installation of Debain 8 (Jessie).
Debian 8 Installation
Download and install Debian 8 installation packages from the following link. http://cdimage.debian.org/debian-cd/8.1.0/amd64/iso-dvd/. Run through the installation process and set the server up accordingly. After the installation is completed, edit the /etc/apt/sources.list file, add # to comment out the dvd source in the file to prevent apt-get from requesting to get packages from the dvd path. Uncomment the other download sources and add the mirror deb http://http.us.debian.org/debian jessie main contrib and save the file. Run the command below to download available updates and upgrade the pc with the latest available libraries.
sudo apt-update && apt-upgrade
All commands to be run on the terminal should be run using root account to ensure that required permissions and priviledges are granted.
FreeSwitch Debian Jessie repository needs to be enabled, the commands below will create 99FreeSWITCH.test.list file and add it to /etc/apt/sources.list.d folder and also download and add a GPG key to the apt sources keyring.
echo "deb http://files.freeswitch.org/repo/deb/debian/ jessie main" > /etc/apt/sources.list.d/99FreeSWITCH.test.list wget -O - http://files.freeswitch.org/repo/deb/debian/key.gpg |apt-key add - apt-get update
DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y --force-yes freeswitch-video-deps-most
cd /usr/src/
git config --global pull.rebase true
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git
cd /usr/src/freeswitch.git
./bootstrap.sh -j
./configure -C
make
make install
make cd-sounds-install
make cd-moh-install
make samples
Edit the System Kernel setting file /etc/sysctl.d/vid.conf and add the following lines.
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
kernel.core_pattern = core.%p
sysctl -w net.core.rmem_max=16777216
sysctl -w net.core.wmem_max=16777216
sysctl -w kernel.core_pattern=core.%p
cd /usr/local
adduser --disabled-password --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH" --ingroup daemon freeswitch
chown -R freeswitch:daemon /usr/local/freeswitch/
chmod -R ug=rwX,o= /usr/local/freeswitch/
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*
Lets link the systemd unif file above to systemd using this command
ln -s /usr/src/freeswitch.git/debian/freeswitch-systemd.freeswitch.service /etc/systemd/system/freeswitch.service
To start Freeswitch for the first time run this command
systemctl start freeswitch
And that is it, you have FreeSwitch built and configured.