文章目录
- 一、前言
- 二、安装
- 2.1 安装 ```noarch```
- 2.2 ```处理安装源```
- 2.3 安装 ```cmake```
- 2.4 安装 ```libks```
- 2.5 安装 ```signalwire-c```
- 2.6 安装 ```x264```
- 2.7 安装 ```mod_av```
- 2.8 安装 ```libpng ```
- 2.9 安装 ```libav```
- 2.10 ```重新安装opus```
- 2.11 安装 ```sofia-sip```
- 2.12 安装 ```spandsp```
- 2.13 安装 ```libopus-devel rmp包```
- 2.14 安装 ```Freeswitch```
- 三、FS常用命令
- 四、演示
一、前言
虽然本博主是一名2022年毕业的童鞋,但是已经帮助很多人成功安装freeswitch 使其加入Freeswitch 大家庭
如果你有困难,希望和我交流,欢迎添加微信18956043585(仅此学习,研究学术问题)
由于 FreeSWITCH 更新非常快,请自己查找最新的版本,如,截止 2022年6月4日,最稳定的发行版是:1.10.7。
如果你会使用Git,也可以从Github代码库下载源代码:
git clone https://github.com/signalwire/freeswitch.git
安装FreeSWITCH前需要安装一些依赖。在不同的平台上,依赖不同的包,如:
Debian/Ubuntu:
apt-get -y install build-essential subversion automake autoconf wget libtool libncurses5-dev
CentOS:
yum install -y subversion autoconf automake libtool gcc-c++ ncurses-devel make
FreeSWITCH最新的源代码将Sofia-SIP和SpanDSP移出了FreeSWITCH代码仓库,分离到了独立的仓库中,在安装FreeSWITCH之前需要单独安装:
https://github.com/freeswitch/sofia-sip
https://github.com/freeswitch/spandsp
最新的mod_verto模块也需要libks,源代码可以从以下地址获取
https://github.com/signalwire/libks
博主已经把相关文件给你整理啦
链接: https://pan.baidu.com/s/1oMBvdU2EXyx6bGx_okN1Zg?pwd=igf4 提取码: igf4
二、安装
操作系统:64位的centos7.9
Freeswitch版本:freeswitch1.10.2
检查网络的连通性:能正常访问外网(ping www.baidu.com)
2.1 安装 noarch
cd /usr/local/src/
wget http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm
yum install -y freeswitch-release-1-6.noarch.rpm
yum install -y libatomic
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
2.2 处理安装源
cd /etc/yum.repos.d/
rm -rf freeswitch*
yum clean all
yum makecache
yum -y update
2.3 安装 cmake
yum remove cmake
wget https://cmake.org/files/v3.14/cmake-3.14.0.tar.gz
tar -zxvf cmake-3.14.0.tar.gz
cd cmake-3.14.0
./configure
make && make install
2.4 安装 libks
cd /usr/local/src/
git clone https://github.com/signalwire/libks.git
cd libks
cmake .
make
make install
2.5 安装 signalwire-c
cd /usr/local/src/
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
2.6 安装 x264
cd /usr/local/src/
git clone http://git.videolan.org/git/x264.git
cd x264
./configure --disable-asm
make && make install
2.7 安装 mod_av
cd /usr/local/src/
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
2.8 安装 libpng
git clone https://freeswitch.org/stash/scm/sd/libpng.git
cd libpng
./configure
make && make install
cp /usr/local/lib/pkgconfig/libpng* /usr/lib64/pkgconfig/
2.9 安装 libav
cd /usr/local/src/
git clone https://gitee.com/nwaycn/libav.git
cd libav
./configure --enable-pic --enable-shared --enable-libx264 --enable-gpl --extra-libs="-ldl"
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/
2.10 重新安装opus
git clone https://freeswitch.org/stash/scm/sd/opus.git
cd opus
./autogen.sh
./configure --libdir=/home/opp/pjsiprel/lib/
make && make install
2.11 安装 sofia-sip
git clone https://github.com/freeswitch/sofia-sip
cd sofia-sip
./bootstrap.sh
./configure
make && make install
2.12 安装 spandsp
git clone https://github.com/freeswitch/spandsp
cd spandsp
./bootstrap.sh
./configure
make && make install
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
2.13 安装 libopus-devel rmp包
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 libopus-devel
2.14 安装 Freeswitch
cd /usr/local/src/
wget http://files.freeswitch.org/freeswitch-1.10.2.-release.tar.gz
tar vzxf freeswitch-1.10.2.-release.tar.gz
cd freeswitch-1.10.2.-release
./configure
make && make install
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/
安装完成:撒花!!
三、FS常用命令
freeswitch -nc -rp
freeswitch -nonat -nc -rp //不检查路由穿透行,加上此参数后会启动很快
freeswitch -stop
fs_cli
-help -- 显示本帮助信息
-version -- 显示版本信息
-rp -- 开启高优先级(实时)设置
-nosql -- 不使用SQL,show channels 类的命令将不能显示结果
-nonat -- 如果路由器支持uPnP或NAT-PMP,则FreeSWITCH可以自动解决NAT穿越问题。如果路由器不支持,则该选项可以使启动更快
-stop -- 关闭 FreeSWITCH,它会在run目录中查找 PID文件
-nc -- 启动到后台模式,没有控制台
四、演示
进入控制台
fs_cli
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)