前言
freswitch在centos7下编译总体上还是步骤比较复杂的。
忠告
千万别使用 CentOS 部署 FreeSWITCH !!!
以下大部分都是笔者用 CentOS7 自编译踩得坑。
建议直接 Debian 安装官方编译好的包!!!可以少踩很多坑(严重怀疑官方歧视 CentOS)。
一、环境
centos 7.9
freeswitch 1.10.9
安装依赖
yum install gcc gcc-c++ 注意gcc需要4.8.5不能太高
yum install -y wget zlib-devel libjpeg-devel freetype-devel
官方插件
yum install -y epel-release
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 rpm-build libX11-devel libyuv-devel
安装高版本cmake
wget https://github.com/Kitware/CMake/releases/download/v3.23.0/cmake-3.23.0.tar.gz
tar -zvxf cmake-3.23.0.tar.gz
cd cmake-3.23.0
./bootstrap //编译
make //安装
make install
#链接
sudo ln -sf /usr/local/bin/cmake /usr/bin/cmake
sudo ln -sf /usr/local/bin/cpack /usr/bin/cpack
sudo ln -sf /usr/local/bin/ctest /usr/bin/ctest
autoconf-2.71及以上版本
下载链接:http://mirrors.kernel.org/gnu/autoconf/
cd /usr/local/src
tar xzvf autoconf-2.71.tar.gz
cd autoconf-2.71
./configure //做相关编译前的环境检查
make
make install
安装yasm
#安装
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make && make install
cd ..
首先安装nasm
wget https://www.nasm.us/pub/nasm/releasebuilds/2.14/nasm-2.14.tar.gz
tar -zxvf nasm-2.14.tar.gz
cd nasm-2.14
./configure
make
make install
二、下载源码
freeswitch下载地址: https://github.com/signalwire/freeswitch.git
另外有两个比较重新的库需要手动安装,分别是spandsp和sofia-sip
下载命令:
cd /data
git clone -b v1.10.9 https://github.com/signalwire/freeswitch
cd /data/freeswitch
git clone https://github.com/freeswitch/spandsp.git
git clone https://github.com/freeswitch/sofia-sip.git
三、编译
.安装 epel扩展和文件传输工具lrzsz
yum install -y epel-release lrzsz
.安装yasm
yum -y install yasm
1. 编译必需库
首先,要先编译spandsp和sofia-sip, 否则freeswitch在configure阶段会报错。
#编译spandsp
cd /data/freeswitch/spandsp
./bootstrap.sh
./configure
make
make install
#编译sofia-sip
cd /data/freeswitch/sofia-sip
./bootstrap.sh
./configure
make
make install
添加库的路径到系统
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
ldconfig
2. 修改module.conf
下面则是安装freeswitch, 由于freeswitch支持动态编译和动态加载,一些不需要的模块可以不编译,如:mod_signalwire、mod_av,修改方法:
找到module.conf文件,找到mod_signalwire和mod_av注释掉,修改如下:文章来源:https://www.toymoban.com/news/detail-615546.html
#applications/mod_signalwire
#applications/mod_av
<文章来源地址https://www.toymoban.com/news/detail-615546.html
到了这里,关于centos 7.9编译和安装freeswitch-1.10.9的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!