centos7 编译安装freeswitch 1.10.5版本

近来经常看到一些朋友编译新版本freeswitch没有那么顺畅,所以记录一下从头开始完整编译安装步骤。

虚拟机centos7最小化安装开机

一般新系统刚刚安装好,我个人比较习惯先装一些常用工具,此处可跳过:

1
yum install vim git wget lrzsz

参照官网,首先有官方提醒:

1
2
3
4
5
6
7
Sofia-sip and SpanDSP Notice!
Sofia-sip and SpanDSP dependencies have been removed from the FreeSWITCH? tree since v1.10.4 Release (05 August 2020).
You can find source files of Sofia-sip here:
https://github.com/freeswitch/sofia-sip
SpanDSP sources are here:
https://github.com/freeswitch/spandsp
Packages for Sofia-sip and SpandDSP are available for all supported platforms from our packaging repos.

下面具体源码编译的步骤开头也写了:

1
2
3
4
5
In case of errors about "no usable spandsp" or sofia-sip, compile and install spandsp and sofia-sip first, then
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
where ls /usr/local/lib/pkgconfig should list at least
sofia-sip-ua.pc spandsp.pc
Then FreeSWITCH should compile properly.

那么就先从这开始:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
yum install autoconf automake libtool openssl* libtiff* libjpeg*

git clone https://github.com/freeswitch/sofia-sip
cd sofia-sip
./bootstrap.sh
./configure
make
make install

git clone https://github.com/freeswitch/spandsp
cd spandsp
./bootstrap.sh
./configure
make
make install

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

下面继续freeswitch的编译步骤,跟着官网的走先装依赖

1
2
3
4
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum install yum-utils
yum-builddep -y freeswitch --skip-broken
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools

下载freeswitch源码编译安装
此处可使用国内git平台的仓库加速,github有时候会很慢

1
2
3
4
5
6
7
8
9
10
11
12
cd /usr/local/src
git clone -b v1.10.5 https://github.com/signalwire/freeswitch.git freeswitch
cd freeswitch
./bootstrap.sh -j
此时可以编辑配置需要编译的freeswitch模块,可以关闭不需要使用的模块。此处我注释掉了mod_av和mod_signalwire
./configure
此处如果遇到“no usable spandsp”异常时,按照官方指示设置下环境变量,之后重新configure
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
make
make -j install
make -j cd-sounds-install
make -j cd-moh-install

到此全部完成,安装后目录为:/usr/local/freeswitch
可以到/usr/local/freeswitch/bin目录下查看安装后版本:
在这里插入图片描述

参考:
https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7+and+RHEL+7