Sony Arouje

a programmer's log

Compile and run FreeSWITCH in Raspberry pi

with 5 comments

In recent days, I am spending my free time learning SIP and RTP protocols. In order to progress with my learning, I decided to setup FreeSWITCH. As usual decided to use one of my RPI and compile the system from source. Compiling from source will give me some basic understanding of the binaries and its dependencies.

First task was to install all the dependencies, followed this link to set up the deb etc but I always get below error. I do not have much idea how to fix it. So ignored this step and decided to manually install the dependencies.

Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Hit:3 http://security.debian.org/debian-security bullseye-security InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Ign:5 https://freeswitch.signalwire.com/repo/deb/rpi/debian-release `lsb_release InRelease                                                                                            
Err:6 https://freeswitch.signalwire.com/repo/deb/rpi/debian-release `lsb_release Release                                                                                              
  404  Not Found [IP: 190.102.98.174 443]
Reading package lists... Done                                                                                                                                                         
E: The repository 'https://freeswitch.signalwire.com/repo/deb/rpi/debian-release `lsb_release Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Install dependencies

Did some google search and got some basic dependencies to compile the code, but had to install dependencies while doing configure and make step. Below is the full set of dependencies I installed to compile the FreeSWITCH source and dependable source code. If I missed any, please update it in the comment section.

sudo apt-get install build-essential
sudo apt-get install git-core build-essential autoconf automake libtool libncurses5 
sudo apt-get install libncurses5-dev make libjpeg-dev pkg-config unixodbc 
sudo apt-get install unixodbc-dev zlib1g-dev libtool-bin
sudo apt-get install libcurl4-openssl-dev libexpat1-dev libssl-dev sqlite3 
sudo apt-get install libsqlite3-dev libpcre3 libpcre3-dev libspeexdsp1 
sudo apt-get install libspeexdsp-dev libldns-dev libavformat-dev ffmpeg 
sudo apt-get install libedit-dev python3.9-distutilss cmake libswscale-dev 
sudo apt-get install liblua5.1-0-dev libopus-dev libpq-dev libsndfile-dev 
sudo apt-get install uuid uuid-dev

Compile source code dependencies

In order to compile FreeSWITCH, first we need to compile the below projects.

sofia-sip

cd /usr/src
sudo git clone https://github.com/freeswitch/sofia-sip
sudo ./bootstrap.sh
sudo ./configure
sudo make
sudo make install

spandsp

cd /usr/src 
sudo git clone https://github.com/freeswitch/spandsp
sudo apt-get install libtiff-dev
sudo ./bootstrap.sh
sudo ./configure
sudo make
sudo make install

libks

cd /usr/src
git clone https://github.com/signalwire/libks
cd libks
cmake .
make
make install

signalware-c

cd /usr/src
sudo git clone https://github.com/signalwire/signalwire-c
cd signalware-c
sudo cmake .
make
make install

Compile FreeSWITCH

Source code compilation will take some time, be patient.

cd /usr/src
sudo git clone git://git.freeswitch.org/freeswitch.git -bv1.10 freeswitch
cd freeswitch
sudo ./bootstrap.sh
sudo ./configure
sudo make 
sudo make install 
sudo make cd-sounds-install cd-moh-install

Once all the above steps are completed, you can go through the post install steps. I only done the owner permission step, as I intent to run from a command line and not as a daemon.

Written by Sony Arouje

February 26, 2023 at 5:18 pm

5 Responses

Subscribe to comments with RSS.

  1. I could not clone the freeswitch repo from the address in these instructions. It was however available at: https://github.com/signalwire/freeswitch.git

    Unknown's avatar

    Anonymous

    September 17, 2023 at 12:26 am

  2. like the previous commentor, I had to clone the repo. I found that I had to also install cmake, libedit-dev and libspeex-dev before I could meet all requirements. Once done, configure completed and I was able to make / make install.

    Your instructions are so much better than what is found in the signalwire docs. Well done!

    Unknown's avatar

    Anonymous

    December 22, 2024 at 10:40 pm

  3. I spoke too soon, I also needed to install libswscale-dev and I’m running into issues compiling mod_spandsp, but they look like problems with the code rather than the instructions.

    Unknown's avatar

    Anonymous

    December 22, 2024 at 10:47 pm

  4. Final comment. I found spandsp had to be backed down (https://github.com/signalwire/freeswitch/issues/2158) using git reset –hard 67d2455efe02e7ff0d897f3fd5636fed4d54549e in the spandsp directory. Then had to reconfigure / make / make install on spandsp and then freeswitch compiled. Thanks again.

    Unknown's avatar

    Anonymous

    December 23, 2024 at 2:23 am


Leave a comment