在Centos7上编译FreeSWITCH
  CPpqseYTRBXI 2023年11月02日 55 0

安装步骤:

yum install yum-utils
echo "scott" > /etc/yum/vars/signalwireusername
echo "pat_2mLLY6czvUx4F8U2ChrGwQ59" > /etc/yum/vars/signalwiretoken
yum install -y https://$(< /etc/yum/vars/signalwireusername):$(< /etc/yum/vars/signalwiretoken)@freeswitch.signalwire.com/repo/yum/centos-dev/freeswitch-dev-repo-0-1.noarch.rpm epel-release
yum-builddep -y freeswitch #参考Error: 找不到软件包 devtoolset-9
yum install -y yum-plugin-ovl centos-release-scl rpmdevtools yum-utils git
yum install -y devtoolset-4-gcc* #参考错误提示:没有可用软件包 devtoolset-4
scl enable devtoolset-4 'bash'
cd /usr/local/src
#编译安装sofia-sip
git clone https://github.com/freeswitch/sofia-sip sofia-sip
cd /usr/local/src/sofia-sip
./bootstrap.sh
./configure
make
make install
#编译安装spandsp
cd /usr/local/src
git clone https://github.com/freeswitch/spandsp.git spandsp
cd /usr/local/src/spandsp
./bootstrap.sh -j4
./configure
make -j4
make install -j4
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH}
ldconfig
#编译安装FreeSwitch
cd /usr/local/src
git clone -b v1.8 https://git.oschina.net/nwaycn/freeswitch.git
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure --prefix=/usr/local/freeswitch \
--exec_prefix=/usr/local/freeswitch \
--localstatedir=/usr/local/freeswitch \
--sysconfdir=/usr/local/freeswitch \
--disable-fhs --enable-portable-binary \
--with-gnu-ld --with-python --with-erlang --with-openssl \
--enable-core-odbc-support --enable-zrtp

#这里需要对modules.conf中的applications/mod_abstraction、applications/mod_av、say/mod_say_zh取消注释
make
make -j install
make -j cd-sounds-install
make -j cd-moh-install

在执行yum-builddep -y freeswitch提示错误

Error: 找不到软件包 devtoolset-9

解决办法:

yum -y --downloadonly --downloaddir=./gccupdate install centos-release-scl
cd gccupdate
rpm -ivh ./*
yum -y --downloadonly --downloaddir=./gcc9 install devtoolset-9 # 下载gcc 9
cd gcc9
rpm -Uvh ./*
# scl -l
devtoolset-9
scl enable devtoolset-9 bash
gcc --version
gcc (GCC) 9.3.1 20200408 (Red Hat 9.3.1-2)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 重新执行yum-builddep -y freeswitch


在执行yum install -y devtoolset-4-gcc*提示错误

错误提示:没有可用软件包 devtoolset-4

解决办法:

wget -O /etc/yum.repos.d/devtoolset-4.repo https://copr.fedoraproject.org/coprs/hhorak/devtoolset-4-rebuild-bootstrap/repo/epel-7/hhorak-devtoolset-4-rebuild-bootstrap-epel-7.repo
yum update -y
yum install -y devtoolset-4-gcc*

注:如果要编译mod_av,则需要以下步骤

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/freeswitch/libs
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/、

ldconfig

如果pkgconfig配了后,还是会出现找不到动态库,故而强行做软链库

ln -s /usr/local/lib/libavformat.so.56 /usr/lib64
ln -s /usr/local/lib/libavdevice.so.55 /usr/lib64
ln -s /usr/local/lib/libavfilter.so.5 /usr/lib64
ln -s /usr/local/lib/libavcodec.so.56 /usr/lib64
ln -s /usr/local/lib/libavresample.so.2 /usr/lib64
ln -s /usr/local/lib/libavutil.so.54 /usr/lib64
ln -s /usr/local/lib/libswscale.so.3 /usr/lib64
然后

cd /usr/local/src/freeswitch

重新编译freeswitch

freeswitch 命令操作

===============启动命令================
#详细启动日志并进入控制台模式命令
freeswitch -c -nonat -rp
#退出详细模式启动命令
shutdown
#后台启动freeswitch服务(推荐使用)
freeswitch -nc -nonat
#进入控制台模式命令
fs_cli
#退出控制台命令
/exit
#关闭freeswitch命令
freeswitch -stop
===============查询服务命令=============
#查看freeswitch安装路径
whereis freeswitch
查看进程号
ps -ef | grep freeswithch
查看freeswitch端口是否被监听
netstat -anp | grep 5060
#查看freeswitch的运行状态
status(控制台模式执行)
#查看freewitch内置用户是否注册
sofia status profile internal reg(控制台模式执行)


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  4koL3J55wyKx   2023年11月13日   37   0   0 icogitCentOS
  9E2BTpjt8nym   2023年12月06日   35   0   0 WindowsgitCentOS
CPpqseYTRBXI
作者其他文章 更多