环境:
Centos:CentOS release 6.7 (Final)
Freeswitch:v1.6.5
依赖库:
yum install –y autoconf automake libtoolgcc-c++ ncurses-devel make zlib-devel libjpeg-devel
yum install –y openssl-devele2fsprogs-devel curl-devel pcre-devel speex-devel sqlite-devel
yum install –y git ldns-devel libedit-devellua-devel libsndfile-devel libshout-devel lame-devel
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git fs1.6.5
切换fs版本:
git tag //查看当前所有版本
git rev-parse HEAD //查看当前版本
git checkout 70b8c177639a980c0ef12f2f826cdcc3b5a9c8a2 //切换到v1.6.5版本
git checkout d2d0b3283ae393b15e2476159db50386300eea69 //切换到v1.6.6版本
编译安装依赖库:
cd fs1.6.5
sh support-d/prereq.sh
cd libs
编译libyuv
git clonehttps://freeswitch.org/stash/scm/sd/libyuv.git
cd libyuv
make -f linux.mk CXXFLAGS="-fPIC -O2-fomit-frame-pointer -Iinclude/"
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/
编译yasm
cd ..
git clonehttps://github.com/yasm/yasm.git
cd yasm
./autogen.sh
./configure
make
编译VPX
git clonehttps://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure --enable-pic --disable-static --enable-shared
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/
编译OPUS
git clonehttps://freeswitch.org/stash/scm/sd/opus.git
cd opus
cp /usr/local/lib/pkgconfig/opus.pc /usr/lib64/pkgconfig
编译libpng
git clonehttps://freeswitch.org/stash/scm/sd/libpng.git
cd libpng
cp /usr/local/lib/pkgconfig/libpng* /usr/lib64/pkgconfig/
pkg-config --list-all | grep png
编译安装FS:
./bootstrap.sh -j
./configure -C
安装语音文件:
make cd-sounds-install //CD音质
make cd-moh-install //CD音质
或者
make sounds-install //8K音质
make moh-install //8K音质
设置用户/权限:
cd /usr/local
useradd --system --home-dir/usr/local/freeswitch -G daemon freeswitch
passwd -l freeswitch
chown -R freeswitch:daemon/usr/local/freeswitch/
chmod -R 770 /usr/local/freeswitch/
chmod -R 750 /usr/local/freeswitch/bin/*
mkdir /var/run/freeswitch
chown -R freeswitch:daemon /var/run/freeswitch
ln -s /usr/local/freeswitch/bin/freeswitch/usr/bin/ # needed by /etc/init.d/freeswitch
启动FS:
cd /usr/local/freeswitch/bin
./freeswitch
关闭centos防火墙:
service iptables stop
跟随BOOT自动启动:
cp /usr/src/freeswitch/build/freeswitch.init.redhat /etc/init.d/freeswitch
chmod 750 /etc/init.d/freeswitch
chown freeswitch:daemon/etc/init.d/freeswitch
chkconfig --add freeswitch &&chkconfig --levels 35 freeswitch on