操作系統 :CentOS 7.6_x64
freeswitch版本 :1.10.7
一、安裝步驟
1、下載freeswitch源代碼
wget http://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.7.-release.tar.gz
2、安裝依賴環境
yum install autoconf automake postgresql-devel libtool gcc gcc-c++ libtiff libtiff-devel libjpeg-devel openssl-devel yum install libuuid-devel yasm nasm sqlite-devel libcurl-devel speex-devel ldns-devel libedit-devel lua-devel libsndfile-devel
3、 開始安裝,依次執行如下命令
tar zxvf freeswitch-1.10.7.-release.tar.gz cd freeswitch-1.10.7.-release ./rebootstrap.sh #CFLAGS="-O3 -fPIC" ./configure --disable-signalwire (可選) CFLAGS="-O3 -fPIC" ./configure make -j make install make hd-sounds-install && make hd-moh-install # make cd-sounds-install && make cd-moh-install (可選) make samples
4、 建立軟連接,以方便使用
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/local/bin/ ln -sf /usr/local/freeswitch/bin/fs_cli /usr/local/bin/
啓動freeswith
freeswitch -nc -nonat :後臺啓動freeswitch
使用命令行客戶管理freeswith
fs_cli :進入客戶端(/exit 退出客戶端)
關閉freeswitch
freeswitch -stop
5、 打包二進制文件
cd /usr/local/ tar zcvf freeswitch-1.10.7-release.tar.gz freeswitch/
二、常見問題
問題1:
configure: error: no usable spandsp;please install spandsp3
解決方法:
git clone https://github.com/freeswitch/spandsp.git cd spanddsp ./bootstrap.sh ./configure make install export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH} ldconfig
問題2:
checking for sofia-sip-ua >= 1.13.6... configure: error: no usable sofia-sip; please install sofia-sip-ua devel package or equivalent
解決方法:
git clone https://github.com/freeswitch/sofia-sip.git cd sofia-sip/ ./bootstrap.sh ./configure make make install ldconfig
問題3:
提示未安裝signalwire
解決辦法:
1)安裝 libks(signalwire的依賴項)
yum install libuuid-devel libatomic git clone https://github.com/signalwire/libks.git cd libks cmake . make make install
2)安裝 signalwire
git clone https://github.com/signalwire/signalwire-c.git cd signalwire-c cmake . make sudo make install
問題4:
libtool: Version mismatch error. This is libtool 2.4.6 Debian-2.4.6-2, but the libtool: definition of this LT_INIT comes from libtool 2.4.2.
解決方法:
autoreconf -fiv
問題5:
/usr/local/lib/libavformat.a(allformats.o): relocation R_X86_64_32 against symbol `ff_a64_muxer' can not be used when making a shared object; recompile with -fPIC
解決方法:
ffmpeg未安裝或配置不對,重新安裝ffmpeg即可,具體可參考:https://www.cnblogs.com/MikeZhang/p/centos7-ffmpeg.html
問題6:
You must install libopus-dev to build mod_opus.
解決方法:
wget https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz tar zxvf opus-1.3.1.tar.gz cd opus-1.3.1 ./configure --enable-shared make make install cp /usr/local/lib/pkgconfig/opus.pc /usr/lib64/pkgconfig
三、其它
1、使用cmake時,需要升級版本,或直接下載二進制使用:
cmake下載地址:https://cmake.org/download/
使用如下:
tar zxvf cmake-3.23.1-linux-x86_64.tar.gz mv cmake-3.23.1-linux-x86_64 /usr/local/ ln /usr/local/cmake-3.23.1-linux-x86_64/bin/cmake -s /usr/local/bin/cmake
2、需要安裝sndfile庫,否則會無法讀取wav文件。
3、本文涉及freeswitch源代碼及依賴文件如下: