Ubuntu 20.04 安装 FreeSWITCH 实测成功!! 附视频过程youtube + Bilibili

秦涵涤
2023-12-01

Install FreeSwitch PBX on Ubuntu 20.04/18.04

视频:

youtube:https://youtu.be/efcATkat-x0

bilibili:https://www.bilibili.com/video/BV16r4y1F7ng/

sudo apt -y update
sudo apt install -y 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
sudo apt install -y libcurl4-openssl-dev libexpat1-dev libgnutls28-dev libtiff5-dev libx11-dev unixodbc-dev libssl-dev python-dev zlib1g-dev libasound2-dev libogg-dev libvorbis-dev libperl-dev libgdbm-dev libdb-dev uuid-dev libsndfile1-dev
sudo apt install -y cmake
cd /usr/src
sudo git clone https://github.com/signalwire/libks.git
cd libks
sudo cmake .
sudo make
sudo make install
​
cd /usr/src
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c
sudo cmake .
sudo make
sudo make install
cd /usr/src
sudo wget https://files.freeswitch.org/freeswitch-releases/freeswitch-1.10.3.-release.zip
sudo apt -y install unzip
sudo unzip freeswitch-1.10.3.-release.zip
cd freeswitch-1.10.3.-release/
​
​
sudo apt -y install unzip
​
​
sudo ./configure -C
sudo make
​
​
sudo ./configure && sudo make clean && sudo make
sudo make install
sudo make all cd-sounds-install cd-moh-install
sudo ln -s /usr/local/freeswitch/bin/freeswitch /usr/bin/
sudo ln -s /usr/local/freeswitch/bin/fs_cli /usr/bin
​
​
sudo vim /etc/systemd/system/freeswitch.service
[Unit]
Description=freeswitch
Wants=network-online.target
Requires=syslog.socket network.target local-fs.target
After=syslog.socket network.target network-online.target local-fs.target
​
[Service]
Type=forking
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch
ExecStartPre=/bin/chown -R freeswitch:freeswitch /usr/local/freeswitch
ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS
TimeoutSec=45s
Restart=always
RestartSec=90
StartLimitInterval=0
StartLimitBurst=6
​
User=root
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=250000
LimitRTPRIO=infinity
LimitRTTIME=infinity
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
NoNewPrivileges=false
​
[Install]
WantedBy=multi-user.target
sudo chmod ugo+x /etc/systemd/system/freeswitch.service
sudo systemctl start /etc/systemd/system/freeswitch.service
sudo systemctl enable /etc/systemd/system/freeswitch.service
# fs_cli -r

YHANKS!

shutdown

turn off:

freeswitch

star:

AT LEAST

I temporarily don' t know the problme, but the freeswitch can start!!

Now you can connect to FreeSWITCH using client as below

Start FreeSwitch service and enable it on boot

Now compile the sound file

Don not worry .... ALSO

Next install free switch

apt-get install libpq-dev

freeswitch@ubuntu> load mod_av

`PKG_CONFIG_PATH="/usr/lib/pkgconfig" ./configure --enable-portable-binary --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-gnu-ld --with-python --with-erlang --with-openssl --enable-core-odbc-support --enable-zrtp

On Freeswitch

`====do not worry! just wait!!!======= make install

git clone https://freeswitch.org/stash/scm/sd/libav.git cd libav patch -p1 < 0001-Fix-linking-errors-when-VC1-parser-is-enabled-and-VC.patch PKG_CONFIG_PATH="/usr/lib/pkgconfig" ./configure --prefix=/usr --extra-libs=-lpthread --extra-libs=-lm --enable-shared --enable-gpl --enable-libx264 make -j4

`wget https://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20170217-2245-stable.tar.bz2 tar -jxvf x264-snapshot-20170217-2245-stable.tar.bz2 cd x264-snapshot-20170217-2245-stable ./configure --prefix=/usr --enable-debug --enable-pic --enable-shared make -j4 make install

It works now!

and get:https://github.com/signalwire/freeswitch/issues/175

make[4]: Entering directory '/usr/src/freeswitch-1.10.3.-release/src/mod/applications/mod_av'

search on google in following keyword:

making all mod_av make[4]: Entering directory '/usr/src/freeswitch-1.10.3.-release/src/mod/applications/mod_av' Makefile:1442: * You must install libavformat-dev to build mod_av. Stop. make[4]: Leaving directory '/usr/src/freeswitch-1.10.3.-release/src/mod/applications/mod_av' make[3]: * [Makefile:705: mod_av-all] Error 1 make[3]: Leaving directory '/usr/src/freeswitch-1.10.3.-release/src/mod' make[2]: * [Makefile:609: all-recursive] Error 1 make[2]: Leaving directory '/usr/src/freeswitch-1.10.3.-release/src' make[1]: * [Makefile:3577: all-recursive] Error 1 make[1]: Leaving directory '/usr/src/freeswitch-1.10.3.-release' make: *** [Makefile:1292: all] Error 2

will see a problem here:

 类似资料: