Centos7安装freeswitch-1.10.8(2023)

1.安装FreeSwitch

    在Centos7安装FreeSwitch遇到了很多依赖包的坑,在此记录一下完整的安装过程。亲测有效,顺利安装上。花费了我一下午的试错时间,觉得有用的点个赞呗~

2.安装过程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#安装基本依赖包
yum update -y
yum install -y https://files.freeswitch.org/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum update -y
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git
yum install -y devtoolset-4-gcc* sqlite-devel libcurl-devel pcre pcre-devel speex speex-devel ldns-devel yasm libopus-devel opus-devel
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

#安装cmake
wget https://cmake.org/files/v3.14/cmake-3.14.0.tar.gz
tar vzxf cmake-3.14.0.tar.gz
cd cmake-3.14.0
./configure
make
make install

#安装依赖 libatomic
yum install -y libatomic
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make
make install

#安装依赖 signalwire-c
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c/
cmake .
make
make install
ln -sf /usr/local/lib64/pkgconfig/signalwire_client.pc /usr/lib64/pkgconfig/signalwire_client.pc

#安装依赖 nasm
wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar -zxvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make && make install


#安装依赖 x264
git clone http://git.videolan.org/git/x264.git
cd x264
./configure
make
make install

#安装依赖
wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
wget http://download1.rpmfusion.org/free/el/updates/7/x86_64/x/x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
rpm -hiv x264-libs-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
rpm -hiv x264-devel-0.148-24.20170521gitaaa9aa8.el7.x86_64.rpm
cd /usr/local/src
wget https://github.com/libav/libav/archive/refs/tags/v12.3.zip
unzip v12.3.zip
cd libav-12.3
./configure
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

#安装依赖 sofia-sip
git clone https://github.com/freeswitch/sofia-sip
cd sofia-sip
sh autogen.sh
./configure
make && make install

#安装依赖 spandsp
git clone https://github.com/freeswitch/spandsp
cd spandsp
sh autogen.sh
./configure
make && make install

#安装依赖
vim /etc/yum.repos.d/linuxtech.repo
<<<
[linuxtech]
name=LinuxTECH
baseurl=http://pkgrepo.linuxtech.net/el6/release/
enabled=1
gpgcheck=1
gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
>>>
yum install -y libopus-devel
wget https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz
tar xvfz opus-1.3.1.tar.gz
cd opus-1.3.1
./configure
make
make install

#安装freeswitch 1.10.8版本
wget https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.8.-release.tar.gz
cd freeswitch-1.10.8.-release
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
make clean
./configure

#安装声音文件
make sounds-install
make moh-install
make cd-sounds-install
make cd-moh-install

#安装freeswitch
make
make install

#检验是否安装成功

vim /etc/profile
追加内容:
export PATH=/usr/local/freeswitch/bin/:$PATH

source /etc/profile

which freeswitch #存在该二进制即可

查看freeswitch的默认安装目录: /usr/local/freeswitch/

安装成功截图: