freeswitch 编译安装日记
通过freeswitch 源码安装对于新手而言会遇到很多问题,这里记录一下 关键字:freeswitch
预装必须程序
yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release
yum install -y git libtool openssl-devel libtiff-devel libjpeg-devel gcc-c++ libedit-devel sqlite-devel libcurl-devel speex-devel ldns-devel postgresql-devel libuuid-devel libatomic
yum install -y nasm lua-devel opus-devel libsndfile-devel
yum install -y libshout-devel lame-devel libmpg123-devel
设置github.com的hosts
vi /etc/hostname
# 增加一下内容
185.199.108.153 github.com
185.199.108.153可以在 https://github.com.ipaddress.com/assets-cdn.github.com 获取
克隆源码
freeswitch
cd /usr/local/src
git clone -b v1.10.6 https://gitee.com/kfdesk/freeswitch.git freeswitch
cd freeswitch
安装sofia-sip-ua
git clone https://gitee.com/xikew/sofia-sip.git
cd sofia-sip
./bootstrap.sh
./configure
make
make install
ldconfig
cd ../
安装spandsp
git clone https://gitee.com/xikew/spandsp.git
cd spandsp
./bootstrap.sh
./configure
make
make install
ldconfig
cd ../
安装libav
yum install -y wget bzip2
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.bz2
tar -jxvf nasm-2.14.tar.bz2
cd nasm-2.14
./configure
make
make install
cd ../
git clone http://git.videolan.org/git/x264.git
cd x264
./configure --enable-shared --enable-static --enable-debug
make
make install
cp /usr/local/lib/pkgconfig/x2* /usr/lib64/pkgconfig
cd ../
wget https://libav.org/releases/libav-12.3.tar.gz
tar -zxvf libav-12.3.tar.gz
cd libav-12.3
# 进入 libav 源码目录下, 将 libavcodec/libx264.c 文件里面的"x264_bit_depth" 全部替换为"X264_BIT_DEPTH",否则编译会报错。
./configure --enable-shared --enable-libx264 --enable-gpl
find ./ -type f |xargs touch
make
make install
ldconfig
cd ../
安装 mod_signalwire
wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar zxvf cmake-3.*
cd cmake-3.*
./bootstrap --prefix=/usr/local
make -j$(nproc)
make install
# 清楚cmake缓存
hash -r
cd ../
git clone https://gitee.com/xikew/libks.git
cd libks/
cmake .
make
make install
cd ../
git clone https://gitee.com/xikew/signalwire-c.git
cd signalwire-c/
cmake .
make
make install
ldconfig
cd ../
安装freeswitch
cp /usr/local/lib/pkgconfig/*.pc /usr/lib64/pkgconfig/
./bootstrap.sh -j
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:${PKG_CONFIG_PATH}
./configure
make
make -j install
make -j cd-sounds-install
make -j cd-moh-install
安装mod_shout
cd /usr/local/src/freeswitch/src/mod/formats/mod_shout
make & make install
ssl证书问题
如果使用自己申请的ssl证书
// 先找到freeswitch ssl 证书的所在路径
find / -name wss.pem
wss.pem的内容组成是 自己申请的证书 pem部分 + key部分
删除其他证书,只留一个wss.pem, 重启freeswitch即可