创建和配置SignalWire个人访问令牌
可以根据下面链接中的说明进行配置
echo "pat_*" > /etc/yum/vars/signalwiretoken
echo "token*" > /etc/yum/vars/signalwireusername
安装依赖
yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-release/freeswitch-release-repo-0-1.noarch.rpm epel-release
yum-builddep -y freeswitch
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git
yum install -y devtoolset-4-gcc*
各种其他依赖
yum install -y http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm
yum install -y signalwire-client-c
yum install -y python-devel
yum install -y libtool
yum install -y sqlite-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
yum install -y wget
yum install -y gcc
yum install -y gcc-c++
yum install -y unixODBC
自动配置
yum -y install autoconf-2.69-11.el7.noarch
yum -y install automake-1.13.4-3.el7.noarch
安装git2
sudo yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
sudo
yum -y install git
git --version
安装yasm
cd /usr/local/src/
mkdir yasm
cd yasm
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install
yasm --version
安装nasm
cd /usr/local/src/
mkdir nasm
cd nasm
wget http://www.nasm.us/pub/nasm/releasebuilds/2.13/nasm-2.13.tar.gz --no-check-certificate
tar xzvf nasm-2.13.tar.gz
cd nasm-2.13
./configure
make
make install
nasm --version
安装x264
cd /usr/local/src/
mkdir x264
cd x264
git clone https://code.videolan.org/videolan/x264.git
cd x264
./configure --enable-shared
make
make install
x264 --version
安装ffmpeg,编译参数可参考以下文章
https://stackoverflow.com/questions/25539034/opencv-make-fails-recompile-with-fpic
cd /usr/local/src/
rm -rf ffmpeg
mkdir ffmpeg
cd ffmpeg
wget https://johnvansickle.com/ffmpeg/release-source/ffmpeg-4.1.tar.xz --no-check-certificate
tar -xf ffmpeg-4.1.tar.xz
cd ffmpeg*
# ./configure --enable-gpl --enable-libx264
./configure --enable-nonfree --enable-pic --enable-shared
make
make install
ffmpeg -version
安装unixODBC
cd /usr/local/src/
rm -rf unixODBC
mkdir unixODBC
cd unixODBC
wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.1.tar.gz
tar -xvzf unixODBC.tar.gz cd unix
./configure --enable-gui=no
make
make install
unixODBC --version
安装libpg
yum install -y libpq-devel
yum install -y speex-devel
yum install -y libks
安装libtiff
yum -y install libtiff.x86_64
yum install -y libtiff-devel
yum install -y libjpeg-devel
yum install -y libjpeg-turbo-devel
安装spandsp
cd /usr/local/src/
rm -rf spandsp
mkdir spandsp
cd spandsp
git clone https://github.com/freeswitch/spandsp.git
cd spandsp
./bootstrap.sh
./configure
make
make install
ldconfig
安装openssl
yum install -y openssl-devel
安装sofia-sip
cd /usr/local/src/
rm -rf sofia-sip
mkdir sofia-sip
cd sofia-sip
git clone https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./bootstrap.sh
./configure
make
make install
cd ..
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
安装signalwire-client-c
yum install http://repo.okay.com.mx/centos/7/x86_64/release/okay-release-1-1.noarch.rpm
yum install -y signalwire-client-c --nogpgcheck
ldconfig
安装 cmake
cd /usr/local/src/
mkdir cmake
cd cmake
wget https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5.tar.gz
tar -zxvf cmake-3.15.5.tar.gz
cd cmake-3.15.5
./bootstrap --prefix=/usr --datadir=share/cmake --docdir=doc/cmake && make
sudo make install
cmake --version
安装signalwire-c
cd /usr/local/src/
rm -rf signalwire-c
mkdir signalwire-c
cd signalwire-c
git clone https://github.com/signalwire/signalwire-c.git
cd signalwire-c
cmake .
make
sudo make install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:${PKG_CONFIG_PATH}
sudo ldconfig
ln -sf /usr/local/lib64/pkgconfig/signalwire_client.pc /usr/lib64/pkgconfig/signalwire_client.pc
安装python3
yum install -y python3-devel
yum install -y swig
pip3 install python-ESL
安装 erlang
yum install -y erlang
安装 zlib-devel
yum install -y zlib-devel
cd /usr/local/src/
mkdir zlib
cd zlib
wget http://www.zlib.net/zlib-1.2.13.tar.gz
tar -zxvf zlib-1.2.13.tar.gz
cd zlib-1.2.13
./configure
make
make install
检查mod_av是否安装成功
cd /usr/local/src/freeswitch/freeswitch-1.10.9/src/mod/applications/mod_av
make
安装 lua
yum install -y lua
yum install -y lua-devel
安装labopus
Build libopus RPMs for CentOS 7 | FreeSWITCH Documentation (signalwire.com)
yum install -y rpmdevtools libogg-devel gcc make wget
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
# Check the right version
wget http://downloads.xiph.org/releases/opus/opus-1.1.1.tar.gz
# Check the right version
cp opus.spec ~/rpmbuild/SPECS/opus.spec
cd ~/rpmbuild/SPECS
rpmbuild -v -bb opus.spec
安装PostgresSQL数据库
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql12 postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
sudo firewall-cmd --add-port=5432/tcp --permanent
sudo systemctl start postgresql-12
sudo systemctl enable postgresql-12
su postgres
psql
ALTER USER postgres WITH PASSWORD 'password';
create database freeswitch;
\l
\q
exit
yum install -y postgresql-devel
安装FreeSWITCH
cd /usr/local/src/
rm -rf freeswitch
mkdir freeswitch
cd freeswitch
wget https://github.com/signalwire/freeswitch/archive/refs/tags/v1.10.9.tar.gz
tar -zxvf v1.10.9.tar.gz
cd freeswitch-1.10.9
./bootstrap.sh -j
./configure --enable-portable-binary --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-gnu-ld --with-python --with-erlang --with-openssl --enable-core-odbc-support --enable-core-pgsql-support --enable-zrtp
make
make install
安装声音文件
make sounds-install
make moh-install
make -j cd-sounds-install
make -j cd-moh-install