Telephony

How to Install FreeSWITCH 1.6 on Debian 8 Jessie

tele-operator

FreeSWITCH is a free and opensource telecom software stack. It supports all major operating systems like Linux, Windows, macOS and freeBSD. In this article, we will see how to install Freeswitch 1.6 on Debian 8 code named Jessie.

How to install FreeSWITCH on Ubuntu 18.04 LTS Bionic Beaver

How to install FreeSWITCH on Debian 9 Stretch

How to install FreeSWITCH on CentOS 7

Does FreeSWITCH seem hard ? Not really. Visit our FreeSWITCH Archive to learn more.

Installation using source

Installation using Debian pre-complied package is straight forward. Just run below commands.

1. First fetch updated list of packages

apt update -y

2. Now install required packages.

apt install -y --force-yes curl git

3. Add public key of FreeSWITCH repository to trusted keys

curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -

4. Add FreeSWITCH repository in sources.

echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list

5. Now index package list again

apt update -y

6. Install FreeSWITCH dependencies

apt install -y --force-yes freeswitch-video-deps-most

7. Install dependencies for additional modules like mod_fsv

apt install -y libyuv-dev libvpx2-dev

8. Clone FreeSWITCH repository.

git config --global pull.rebase true
cd /usr/src/
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git

9. Switch to stable release branch 1.6 and compile FreeSWITCH source

cd freeswitch.git
git checkout v1.6
./bootstrap.sh -j
./configure -C
make && make install

10. Compile sounds

make all cd-sounds-install cd-moh-install

11. Create soft links to access FreeSWITCH easily

ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/freeswitch
ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli

12. Add less privileged user and group to run FreeSWITCH service

cd /usr/local
groupadd freeswitch
adduser --disabled-password --quiet --system --home /usr/local/freeswitch --gecos "FreeSWITCH Voice Platform" --ingroup freeswitch freeswitch
chown -R freeswitch:freeswitch /usr/local/freeswitch/
chmod -R ug=rwX,o= /usr/local/freeswitch/
chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/

13. Add systemd unit file to manage FreeSWITCH service

Create file /etc/systemd/system/freeswitch.service and following content

[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target

[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStart=/usr/local/freeswitch/bin/freeswitch -u freeswitch -g freeswitch -ncwait -nonat -rp
TimeoutSec=45s
Restart=on-failure
; exec
WorkingDirectory=/usr/local/freeswitch/bin
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007

[Install]
WantedBy=multi-user.target

14. Finally start FreeSWITCH service and enable it to start on boot.

chmod ugo+x /etc/systemd/systemd/freeswitch.service
systemctl start freeswitch.service
systemctl enable freeswitch.service

17. Check status of FreeSWITCH service
systemctl status freeswitch.service
Status should be ‘active’ something like below

‚óŹ freeswitch.service – freeswitch
Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-05-27 10:55:15 UTC; 7min ago

18. Now you can connect to FreeSWITCH using client as below
fs_cli -r

Notes

During compilation if you stuck with errors like unknown dependencies (particularly spansdsp), run below command before starting compilation again.

git clean -fdx

Hope you like this article. Let us know feedback in comments.

Leave a Reply