FreeSWITCH Installation: Step-By-Step Guide

Share

FreeSWITCH is an open-source telephony platform designed for building scalable communication applications. This comprehensive guide provides step-by-step instructions for installing and configuring FreeSWITCH on Ubuntu systems.

Core Capabilities

Below is the list of core capabilities of FreeSWITCH.

  • Voice, video, and text communication
  • Scalable to thousands of concurrent calls
  • Multi-protocol support (SIP, WebRTC, XMPP)
  • Advanced media handling

Primary Applications

Let us get on about the primary applications now:

  • VoIP Services
  • Contact Centers
  • Unified Communications
  • IVR Systems

System Requirements Of FreeSwitch

Learn more about the system requirements of FreeSwitch:

Hardware Requirements

  • Minimum 2GB RAM
  • 20GB available storage
  • Network interface card

Software Requirement

  • Ubuntu (Latest LTS version)
  • Root/sudo access
  • Active internet connection

Network Requirements

Static IP recommended

Open ports:

  • 5060 (SIP)
  • 5061 (TLS)
  • 16384-32768 (RTP)

FreeSWITCH INSTALLATION PROCEDURE

Discover more about installation procedure about FreeSWITCH.

Part A: System Dependencies

Install Required Packages
“`
sudo apt install –yes build-essential pkg-config uuid-dev zlib1g-dev
libjpeg-dev libsqlite3-dev libcurl4-openssl-dev libpcre3-dev
libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev yasm
libopus-dev libsndfile1-dev unzip libavformat-dev libswscale-dev
liblua5.2-dev liblua5.2-0 cmake libpq-dev unixodbc-dev autoconf
automake ntpdate libxml2-dev libpq-dev libpq5 sngrep lua5.2
lua5.2-doc libreadline-dev

Part B: Time Configuration & Libraries

Configure System Time

# Set timezone
sudo dpkg-reconfigure tzdata

Install libspandsp3
“`
cd /usr/local/src/
git clone https://github.com/freeswitch/spandsp.git
cd spandsp

run git reset –hard 67d2455efe02e7ff0d897f3fd5636fed4d54549e

sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libavformat-dev libswscale-dev libpq-dev

/bootstrap.sh && ./configure && make && sudo make install

Install sofia-sip

cd /usr/local/src/
sudo wget “https://github.com/freeswitch/sofia-sip/archive/master.tar.gz“
sudo tar -xvf sofia-sip.tar.gz
cd sofia-sip-master
./bootstrap.sh && ./configure && make && sudo make install

Part C: FreeSWITCH Installation

Download and Extract

cd /usr/local/src/
sudo wget https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.10.-release.tar.gz
sudo tar -zxvf freeswitch-1.10.10-release.tar.gz

Compile and Install

sudo apt install
cd freeswitch-1.10.10-release
./configure –enable-core-odbc-support –enable-core-pgsql-support
make
sudo make install
sudo make cd-sounds-install
sudo make cd-moh-install

Configuaration Steps Of FreeSWITCH

Below are the configuration steps that would help you further in shifting to FreeSWITCH.

System Links Setup

sudo ln -s /usr/local/freeswitch/conf /etc/freeswitch
sudo ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin/fs_cli
sudo ln -s /usr/local/freeswitch/bin/freeswitch /usr/sbin/freeswitch

User Permissions

sudo groupadd freeswitch
sudo adduser –quiet –system –home /usr/local/freeswitch
–gecos ‘FreeSWITCH open source softswitch’
–ingroup freeswitch freeswitch –disabled-password
sudo chown -R freeswitch:freeswitch /usr/local/freeswitch/
sudo chmod -R ug=rwX,o= /usr/local/freeswitch/
sudo chmod -R u=rwx,g=rx /usr/local/freeswitch/bin/*

Service Setup

Step-by-step guide on how to setup the service.

SystemD Service Configuration

Create /etc/systemd/system/freeswitch.service with:

sudo nano /etc/systemd/system/freeswitch.service

[Unit]
Description=FreeSWITCH
Wants=network-online.target
Requires=network.target local-fs.target
After=network.target network-online.target local-fs.target

[Service]
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
Environment=”DAEMON_OPTS=-nonat”
Environment=”USER=freeswitch”
Environment=”GROUP=freeswitch”
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /usr/local/freeswitch
ExecStart=/usr/local/freeswitch/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}
TimeoutSec=45s
Restart=always

[Install]
WantedBy=multi-user.target

Save and exit:

Ctrl + O (save)
Enter (confirm)
Ctrl + X (exit)

Enable and Start Service

sudo systemctl daemon-reload
sudo systemctl enable freeswitch.service
sudo systemctl start freeswitch.service

TROUBLESHOOTING

Some of the common issues you might face.

1. Common Issues

  • Service Failed to Start
  • Check logs: sudo journalctl -u freeswitch.service
  • Verify permissions on /usr/local/freeswitch
  • Ensure all dependencies are installed correctly

2. Audio Problems

  • Verify sound files: ls /usr/local/freeswitch/sounds
  • Reinstall sound files: sudo make cd-sounds-install
  • Check audio device permissions

3. Connection Issues

  • Verify network configuration
  • Check firewall settings
  • Ensure proper SIP configuration

Verification Commands
# Check service status
sudo systemctl status freeswitch.service

# View logs
tail -f /usr/local/freeswitch/log/freeswitch.log

# Test FreeSWITCH CLI
fs_cli

MAINTENANCE NOTES

Learn how to maintain the set up services.

Regular Updates

  • Keep system packages updated
  • Monitor FreeSWITCH releases
  • Back up configuration regularly

Performance Monitoring

  • Watch system resources
  • Monitor call quality
  • Check log files regularly

Security

  • Keep firewall rules updated
  • Review access logs
  • Maintain secure passwords

Final Thoughts

With FreeSWITCH you will get a robust platform that will allow you to build advanced communication applications. In this read you will get to learn all the steps for installing, configuring and maintaining FreeSwitch.

Follow the procedures and use FreeSWITCH for many purposes such as IVR and VoIP systems. With Regular maintenance and updates you will also get optimal security and performance. The power of FreeSWITCH will upgrade your communication solutions and connect with the best community for ongoing resources and support.

At LN Webworks, we specialize in customizing FreeSWITCH implementations to meet your unique business requirements.

Ready To Discuss Your Idea?

Collaborate with us and bring your ideas to life.

Get Started

Sunil
The Author
Sunil

Web Developer

Read More Blogs

Illustration comparing a custom CRM and an off-the-shelf CRM, showing a business professional choosing between a tailored CRM solution and a packaged CRM software. Other, SaaS Development

SaaS CRMs win on speed. Custom wins on fit and ownership. This isn’t a pitch for either one. Every early-stage SaaS company hits this decision within the first year, usually right after the founder realizes a spreadsheet isn’t a CRM.  The default answer is almost always a SaaS CRM: HubSpot, Salesforce, Zoho, sign up in […]

Illustration of a modernization readiness assessment highlighting business alignment, technology assessment, process optimization, data integration, people and skills, risk and compliance, and a roadmap for successful digital transformation Other

Most “audits” and “assessments” promise clarity but deliver a sales deck with language that lacks clarity. You book the call expecting evidence about your specific platform, and what shows up is a generic pitch for whichever package is easiest for the firm to sell.  That’s the actual reason process transparency matters here, not because a […]

LN Webworks illustration of the BAT-BMS Bluetooth exploit, app ban, and access-control review process Other

In late June and early July, videos started circulating on Instagram of people walking up to moving e-rickshaws, tapping a phone, and watching the vehicle lose power mid-ride.  It spread as a prank trend before anyone fully understood the mechanism. Drivers in Patna (India) reported it first, assuming mechanical failure, until investigators traced it to […]

LN Webworks Logo
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.