Freeswitch生产环境编译与安装

2020-04-14

Freeswitch安装

环境:debian 9

安装依赖

1
2
3
4
5
6
7
8
9
wget -O - https://files.freeswitch.org/repo/deb/freeswitch-1.8/fsstretch-archive-keyring.asc | apt-key add -

echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.8/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
echo "deb-src http://files.freeswitch.org/repo/deb/freeswitch-1.8/ jessie main" >> /etc/apt/sources.list.d/freeswitch.list

apt-get update

# Install dependencies required for the build
apt-get build-dep freeswitch

下载freeswitch并编译安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
cd /usr/src/
git clone https://github.com/signalwire/freeswitch.git -bv1.8 freeswitch
cd freeswitch

# Because we're in a branch that will go through many rebases, it's
# better to set this one, or you'll get CONFLICTS when pulling (update).
git config pull.rebase true

# ... and do the build
./bootstrap.sh -j
不启用postgresql

./configure --enable-core-odbc-support --enable-system-lua --without-pgsql --prefix=/usr/local/freeswitch --sysconfdir=/etc --localstatedir=/var --datadir=/usr/share

启用postgresql

./configure --enable-core-odbc-support --enable-system-lua --enable-core-pgsql-support --prefix=/usr/local/freeswitch --sysconfdir=/etc --localstatedir=/var --datadir=/usr/share

make
make install
# Install audio files:
make cd-sounds-install cd-moh-install

初始化配置

1
2
3
4
5
6
7
8
9
10
11
adduser freeswitch --disabled-password --quiet --system --home /usr/local/freeswitch
# To update an installed build:
cd /usr/src/freeswitch
make current
# Create link for freeswitch
wget https://raw.githubusercontent.com/herbiel/pubilc-shell/master/freeswitch.service -P /lib/systemd/system/

ln -s /usr/local/freeswitch/bin/freeswitch /usr/local/bin/freeswitch
ln -s /usr/local/freeswitch/bin/fs_cli /usr/local/bin/fs_cli
# set chmod for freeswitch and start quick script
chown -R freeswitch:daemon /usr/local/freeswitch

手动安装依赖

1
2
3
4
apt-get install --yes build-essential pkg-config uuid-dev \
zlib1g-dev libjpeg-dev libsqlite3-dev libcurl4-openssl-dev \
libpcre3-dev libspeexdsp-dev libldns-dev libedit-dev libtiff5-dev \
yasm libopus-dev libsndfile1-dev unzip libtool-bin liblua5.3-dev