Sony Arouje

a programmer's log

Posts Tagged ‘rpi

Compile and run FreeSWITCH in Raspberry pi

with 2 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