第一步,安装系统依赖

sudo apt install curl wget git subversion build-essential autoconf automake libtool libncurses5 libncurses5-dev make libjpeg-dev libtool libtool-bin libsqlite3-dev libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev yasm liblua5.2-dev libopus-dev cmake libtiff-dev  libcodec2-dev libcodec2-dev portaudio19-dev libmagickcore-dev libmp3lame-dev libmpg123-dev libshout3-dev libvlc-dev libpq-dev libmariadb-dev libldap2-dev erlang librabbitmq-dev libsmpp34-dev libyaml-dev libmongoc-dev libopencv-dev  libmemcached-dev libavformat-dev  libh2o-dev libsoundtouch-dev libhiredis-dev libopus-dev  autoconf automake devscripts gawk gettext libcurl4-openssl-dev libdb-dev libedit-dev libgdbm-dev libldns-dev libncurses5-dev libopus-dev libopus-ocaml libpcre3-dev libperl-dev libpq-dev libspeex-dev libspeexdsp-dev libssl-dev libtiff5-dev libtool libtool-bin libvorbis0a libogg0 libsqlite3-dev libogg-dev libvorbis-dev portaudio19-dev libshout3-dev libmpg123-dev libmp3lame-dev yasm libbsd-dev flite flite1-dev libflite1 liblua5.2-0 liblua5.2-dev lua5.2 luarocks libsndfile-dev -y

第二步,把gcc g++ 降级到gcc 10

sudo apt install gcc-10 g++-10 cpp-10 -y 
sudo ln -s /usr/bin/gcc-10 /usr/bin/gcc 
sudo ln -s /usr/bin/g++-10 /usr/bin/g++

第三步,安装openssl1.1.1

mkdir -p ~/opt/openssl 
wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz --no-check-certificate -P ~/opt/openssl/
tar -xzvf ~/opt/openssl/openssl-1.1.1q.tar.gz -C ~/opt/openssl/ 
cd ~/opt/openssl/openssl-1.1.1q
./config
make 
sudo make install
sudo cp /usr/local/bin/openssl /usr/bin/openssl

第四步,安装Spandsp

cd ~/opt
git clone https://github.com/freeswitch/spandsp ~/opt/spandsp
git reset --hard 67d2455efe02e7ff0d897f3fd5636fed4d54549e 

这个是解决常量未定义问题的.error: ‘V18_MODE_5BIT_4545’ undeclared

cd ~/opt/spandsp
./bootstrap.sh
./configure
make
sudo make install 

第五步,安装Sofia-sip (SIP User-Agent library)

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

第六步,安装freeswitch

cd ~/opt
git clone https://github.com/signalwire/freeswitch.git -b v1.10 /opt/freeswitch

这个源码也可以在官网下载
https://files.freeswitch.org/releases/freeswitch/
https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.10.-release.tar.xz

cd ~/opt/freeswitch

禁用二个模块

vi ~/opt/freeswitch/modules.conf

注释掉mod_verto和mod_signalwire,在上面的文件中,找到对应行,在行首加上#号即可.如果需要安装这二个模块,也可以编译安装,见后面.

./bootstrap.sh -j
CFLAGS=-Wno-error ./configure --prefix=/usr/local/freeswitch --enable-core-pgsql-support --enable-zrtp
make
sudo make install

然后运行

sudo /usr/local/freeswitch/bin/freeswitch -nc

也可以建立符号连接,

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

   
启动FreeSwitch服务器,

sudo freeswitch -nc

启动FreeSwitch客户端,

fs_cli

补充:
安装libks

cd ~/opt
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make
sudo make install

安装signalwire

cd ~/opt
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c
cmake .
make
sudo make install

将上述补充模块安装完成后,再编译freeswitch功能.

参考:
https://soufianebouchaa.medium.com/freeswitch-ci-cd-on-ubuntu-22-04-debian-11-part-1-75fb1be97316
https://blog.csdn.net/weixin_43805407/article/details/130692942
https://blog.csdn.net/szkbsgy/article/details/126431526
https://github.com/signalwire/freeswitch/issues/2158
https://blog.csdn.net/qq_36369267/article/details/131564019
https://files.freeswitch.org/releases/freeswitch/

本文链接地址:https://const.net.cn/760.html

标签: freeswitch

添加新评论