安装版本:
Linux:Redhat 7.4
freeswitch:1.10.2
由于在线安装下载速度超级慢,所以推荐离线安装。
安装包:
freeswitch-1.10.2.-release.tar.gz、 fsbaserpm.tar.gz 、fsrpm.repo、cmake-3.14.0.tar.gz、libks.tar.gz、signalwire-c.tar.gz、x264.tar.gz、mod_av.tar.gz、x264*.rpm
下载路径:
https://download.csdn.net/download/sunday_code/13210331
将下载的依赖包都放到 创建的/app目录下
安装步骤
1、关闭防火墙
##关闭防火墙
systemctl stop firewalld
##查看防火墙的状态
systemctl status firewalld
##设置开机禁用防火墙
systemctl disable firewalld
2、安装freeswitch依赖
##将操作依赖包拷贝到/opt目录下并解压
cp -r /app/fsrpm.tar.gz /opt/
cd /opt
tar -xvf fsrpm.tar.gz
cp -r /app/fsrpm.repo /etc/yum.repos.d/
yum clean all
##安装命令
yum install -y git alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel libdb4-devel e2fsprogs-devel erlang flite-devel g722_1-devel gcc-c++ gdbm-devel gnutls-devel ilbc2-devel ldns-devel libcodec2-devel libcurl-devel libedit-devel libidn-devel libjpeg-devel libmemcached-devel libogg-devel libsilk-devel libsndfile-devel libtheora-devel libtiff-devel libtool libuuid-devel libvorbis-devel libxml2-devel lua-devel lzo-devel mongo-c-driver-devel ncurses-devel net-snmp-devel openssl-devel opus-devel pcre-devel perl perl-ExtUtils-Embed pkgconfig portaudio-devel postgresql-devel python-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel wget which yasm zlib-devel libshout-devel libmpg123-devel lame-devel
3、安装cmake
cp -r /app/cmake-3.14.0.tar.gz /usr/local/src/
cd /usr/local/src/
tar -xvf cmake-3.14.0.tar.gz
cd cmake-3.14.0
./configure
make
make install
4、安装libks
cd /usr/local/src/
yum install libatomic
cp -r /app/libks.tar.gz /usr/local/src/
tar -xvf libks.tar.gz
cd libks
cmake .
make
make install
5、安装signalwire-c
cd /usr/local/src/
cp -r /app/signalwire-c.tar.gz /usr/local/src/
tar -xvf signalwire-c.tar.gz
cd signalwire-c
cmake .
make
make install
ln -sf /usr/local/lib64/pkgconfig/signalwire_client.pc /usr/lib64/pkgconfig/signalwire_client.pc
6、编译x264
cd /usr/local/src
cp -r /app/x264.tar.gz /usr/local/src/
tar -xvf x264.tar.gz
cd x264
./configure --disable-asm
make
make install
7、编译安装mod_av
cd /usr/local/src
cp -r /app/x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm /usr/local/src
cp -r /app/x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm /usr/local/src
rpm -hiv x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
rpm -hiv x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
cp -r /app/libav.tar.gz /usr/local/src/
tar -xvf libav.tar.gz
cd libav
./configure --enable-pic --enable-shared --enable-libx264 --enable-gpl --extra-libs="-ldl"
make
make install
cp /usr/local/lib/pkgconfig/libavcodec.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavdevice.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavfilter.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavformat.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavresample.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libavutil.pc /usr/lib64/pkgconfig/
cp /usr/local/lib/pkgconfig/libswscale.pc /usr/lib64/pkgconfig/
ldconfig #动态链接库管理命令,其目的为了让动态链接库为系统所共享
8、编译freeswitch
cd /usr/local/src/
cp -r /app/freeswitch-1.10.2.-release.tar.gz /usr/local/src/
tar -xvf freeswitch-1.10.2.-release.tar.gz
cd freeswitch-1.10.2.-release
./configure
make
make install
# freeswitch其默认的安装位置是/usr/local/freeswitch
9、配置freeswitch任何路径启动
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/
10、freeswitch 后台启动
cd /usr/local/freeswitch/bin
vim /usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
<param name="listen-ip" value="::"/> 改为 <param name="listen-ip" value="0.0.0.0"/>
# 后台启动命令
freeswitch -nc -rp
# 进入命令
fs_cli
# 退出命令
/exit