CentOS7环境源码安装freeswitch1.10.7

操作系统 :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源代码及依赖文件如下:

 

可从百度网盘获取:https://pan.baidu.com/s/1WaCntzkB0QOzhskfJX5Beg

关注微信公众号(聊聊博文)后回复 2022100701 获取提取码。 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章