Centos7.9搭建Freeswitch1.6.0详细教程

FreeSWITCH是一个开源的电话软交换平台,支持实时音视频通信及会议,支持SIP及WebRTC等多种通信协议。其官方网站是:https://www.freeswitch.com

这里分享下Freeswitch部署的完整过程

Centos下载地址:https://mirrors.aliyun.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Everything-2009.iso

Freeswitch下载地址:https://files.freeswitch.org/freeswitch-releases/freeswitch-1.6.0.zip

一、安装依赖

yum install -y git gcc-c++ wgetalsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-develdb-devel e2fsprogs-devel flite-devel g722_1-devel gdbm-devel gnutls-develilbc-devel ldns-devel libcodec2-devel libcurl libcurl-devel libedit-devellibidn-devel  libjpeg-devel  libmemcached-devel libogg-devel libssl-devellibsilk-devel libsndfile-devel libtheora-devel libtool libvorbis-devellibxml2-devel lua lua-devel lzo-devel mongo-c-driver-devel ncurses-develnet-snmp-devel  openssl-devel opus-develpcre pcre-devel perl perl-libs perl-ExtUtils-Embed libzrtpcpp-devellibtiff-devel libX11-devel expat-devel pkgconfig portaudio-develpostgresql-devel python26-devel python-devel soundtouch-devel speex speex-develsqlite-devel unbound-devel unixODBC-devel libuuid-devel which yasm zlib-devel libdb-develuuid-devel @development-tools

二、下载Freeswitch

下载好以后用上传工具把Freeswitch上传到/usr/local目录下

三、到/usr/local目录解压

#到此目录下 
cd /usr/local
#解压 
unzip freeswitch-1.6.0.zip

我这里遇到了找不到unzip命令解决办法:sudo yum install unzip再运行解压

四、在/usr/local目录下编译安装yasm

http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz下载yasm上传至/usr/local目录

tar zxvf yasm-1.3.0.tar.gz
cd yasm-1.3.0
./configure
make
make install
cd ..

五、配置 freeswitch

cd freeswitch-1.6.0
./rebootstrap.sh -j 
./configure

执行./configure我这里报错configure: error: Library requirements (sqlite3 >= 3.6.20) not met

解决办法

yum install sqlite-devel.x86_64
./configure

报错:Library requirements (speex >= 1.2rc1 speexdsp >= 1.2rc1) not met

解决办法

yum install speex*
./configure

报错:You need to either install libedit-dev (>= 2.11) or configure with

解决办法

yum install libedit*
./configure

六、编译Freeswitch

make
make install

我这里执行make报错You must install libyuv-dev to build mod_fsv

解决办法

(1)下载libyuv源码编译(在freeswitch-1.6.0目录下)

cd libs
git clone https://freeswitch.org/stash/scm/sd/libyuv.git
cd libyuv
make -f linux.mk CXXFLAGS="-fPIC -O2 -fomit-frame-pointer -Iinclude/"
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/

(2)下载libvpx源码编译

cd ..
git clone https://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure --enable-pic --disable-static --enable-shared
make
make install
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/

(3)下载opus编译

cd ..
git clone https://freeswitch.org/stash/scm/sd/opus.git
cd opus
./autogen.sh
./configure
make
make install
cp /usr/local/lib/pkgconfig/opus.pc /usr/lib64/pkgconfig

(4)下载libpng编译

cd ..
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/

到freeswitch-1.6.0目录重新make

./configure
make
make install

到这里就可以了这里分享下常见的报错解决办法

1. 安装 yasm ,  yasm 和 nasm 必须要有一个,必须装了!
错误提示: Neither yasm nor nasm have been found

((which nasm) || (which yasm) || (git clone https://github.com/yasm/yasm.git && cd yasm && ./autogen.sh && make && make install))
2.安装 lua-devel
错误提示:  找不到 lua.h 等lua的头文件

yum install lua lua-devel
3.安装 opus-devel
错误提示: You must install libopus-dev to build mod_opus

yum -y install opus-devel
#可能需要清理:  make clean && ./configure && make
如果还是报这个错误, 就注释这两行,在Makefile:

vim freeswitch/src/mod/codecs/mod_opus/Makefile
# Comment line 896 & 897
#install: error 
#all: error
 

4.安装 sndfile
错误提示 :  You must install libsndfile-dev to build mod_sndfile

yum install libsndfile-devel
或者源代码编译安装:

复制代码
#下载包libsndfile-x.x.xx.tar.gz  from地址 http://www.mega-nerd.com/libsndfile/#Download,  然后
wget http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.28.tar.gz
tar zxvf libsndfile-1.0.28.tar.gz 
./configure 
make
make install
cp /usr/local/lib/pkgconfig/sndfile.pc /usr/lib64/pkgconfig
复制代码
然后 重新 configure FreeSWITCH , 再 make

如果还是报这个错误,就修改这两行,在 Makefile 末尾:

vim src/mod/formats/mod_sndfile/Makefile
# 修改这两行install: install-am
all: install
然后 再 make

5.安装 libyuv 
错误提示: You must install libyuv-dev to build mod_fsv

cd freeswitch/libs  
git clone https://freeswitch.org/stash/scm/sd/libyuv.gitcd libyuv
make -f linux.mk CXXFLAGS="-fPIC -O2 -fomit-frame-pointer -Iinclude/"
make install
cp /usr/lib/pkgconfig/libyuv.pc /usr/lib64/pkgconfig/
6.安装 libvpx
错误提示: You must install libvpx-dev to build ....

复制代码
cd freeswitch/libs 
git clone https://freeswitch.org/stash/scm/sd/libvpx.git
cd libvpx
./configure --enable-pic --disable-static --enable-shared
make
make install
cp /usr/local/lib/pkgconfig/vpx.pc /usr/lib64/pkgconfig/
复制代码
7.安装 libpng
错误提示: You must install libpng-dev to build ....

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/
8.安装 libav
错误提示: You must install libav-dev to build mod_av

或者 : You must install libavformat-dev to build mod_av

git clone https://freeswitch.org/stash/scm/sd/libav.git
#或者 wget https://freeswitch.org/stash/rest/api/latest/projects/SD/repos/libav/archive?format=zip
cd libav
./configure             #CFLAGS="-fPIC" ./configure --enable-pic --enable-shared
make                    # make CXXFLAGS="-fPIC"
make install
安装完成,如果 make 还是 提示这个错误,重新执行:

./bootstrap.sh -j
./configure
make
 二. 其他问题
1.错误提示: libs/spandsp
configure: loading cache ../../config.cache
configure: error: `CFLAGS' was not set in the previous run
configure: error: `CPPFLAGS' was not set in the previous run
configure: error: in `/usr/src/freeswitch.git/libs/spandsp':
configure: error: changes in the environment can compromise the build
configure: error: run `make distclean' and/or `rm ../../config.cache' and start over
解决: 重新 configure

./configure -C && make
 

三. 安装中文语音
fs默认不加载中文语音。需要在fs的src中首先编译中文模块。

1.编译:
a.在 configure 之前, 编辑 modules.conf,  取消 "#say/mod_say_zh"  这行的注释 ->"say/mod_say_zh"

b.补救安装 `make mod_say_zh-install` 

2.加载(不重启fs)
在fs控制台上加载该模块 `load mod _say_zh` 
若想fs在每次启动的时候都加载该模块,就在`autoload_configs/modules.conf.xml`中`<load module="mod_say_zh">`的注释去掉即可。

也可以这样:

sed -i 's#<!-- <load module="mod_say_zh"/> -->#<load module="mod_say_zh"/>#g' autoload_configs/modules.conf.xml
 

3.修改 `var.xml`中的配置 
`<X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/en/us/callie"/>`修改为中文语音文件的目录
`<X-PRE-PROCESS cmd="set" data="sound_prefix=$${sounds_dir}/zh/cn/link"/>`
加入以下几行(也可以不加)

<X-PRE-PROCESS cmd="set" data="default_language=zh"/>
<X-PRE-PROCESS cmd="set" data="default_dialect=cn"/>
<X-PRE-PROCESS cmd="set" data="default_voice=sue"/>


4.加入中文语音配置
cd conf/lang
cp -R en zh
mv zh/en.xml zh/zh.xml
vim zh/zh.xml 
(替换路径`en/us/callie`和 `en`等:第二行修改为)
<language name="zh" say-module="zh" sound-prefix="$${sounds_dir}/zh/cn/link" tts-engine="cepstral" tts-voice="link">
 

5. 载入中文配置
在`freeswitch.xml`的`<section name="languages" `节点中增加一行 (或那一行取消注释)

` <X-PRE-PROCESS cmd="include" data="lang/zh/*.xml"/>`

 

四. 解决ESL拒绝连接问题
默认是只接受本机连接的,稍一改动就 内外都不能连接了,或者只能接受内外之一连接 

解决方法:


1. event_socket.conf.xml 加入:
<param name="apply-inbound-acl" value="domains"/>

2. acl.conf.xml 加入:
<list name="domains" default="deny">
<node type="allow" domain="$${domain}"/>
<node type="allow" cidr="192.168.1.0/24"/>
<node type="allow" cidr="127.0.0.1/24"/>
</list>

参考连接:

freeswitch安装1.6 - 代码先锋网freeswitch安装1.6,代码先锋网,一个为软件开发程序员提供代码片段和技术文章聚合的网站。icon-default.png?t=N7T8https://codeleading.com/article/32956538852/

如有侵权请联系删除

  • 44
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
下面是 CentOS 7.9 搭建 Nextcloud 的详细步骤: 1.更新系统 ``` sudo yum update ``` 2.安装 Apache 和 PHP ``` sudo yum install epel-release sudo yum install httpd php php-mysql php-gd php-xml php-mbstring php-intl php-zip ``` 3.启动 Apache ``` sudo systemctl start httpd sudo systemctl enable httpd ``` 4.安装 MariaDB ``` sudo yum install mariadb-server sudo systemctl start mariadb sudo systemctl enable mariadb ``` 5.为 MariaDB 设置密码 ``` sudo mysql_secure_installation ``` 6.创建 Nextcloud 数据库 ``` sudo mysql -u root -p ``` 输入密码后进入 MySQL 命令行,创建 Nextcloud 数据库: ``` CREATE DATABASE nextcloud; CREATE USER 'nextclouduser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextclouduser'@'localhost'; FLUSH PRIVILEGES; exit; ``` 7.安装 Nextcloud 下载 Nextcloud: ``` cd /tmp wget https://download.nextcloud.com/server/releases/nextcloud-20.0.7.tar.bz2 ``` 解压 Nextcloud: ``` sudo yum install bzip2 sudo tar -xvf nextcloud-20.0.7.tar.bz2 -C /var/www/html/ ``` 修改目录权限: ``` sudo chown -R apache:apache /var/www/html/nextcloud/ sudo chmod -R 755 /var/www/html/nextcloud/ ``` 8.配置 Apache 创建 Nextcloud 配置文件: ``` sudo nano /etc/httpd/conf.d/nextcloud.conf ``` 输入以下内容: ``` Alias /nextcloud "/var/www/html/nextcloud/" <Directory /var/www/html/nextcloud/> Options +FollowSymlinks AllowOverride All <IfModule mod_dav.c> Dav off </IfModule> SetEnv HOME /var/www/html/nextcloud SetEnv HTTP_HOME /var/www/html/nextcloud </Directory> ``` 保存并退出。 重启 Apache: ``` sudo systemctl restart httpd ``` 9.完成安装 在浏览器中访问 `http://your_server_ip/nextcloud`,进入 Nextcloud 安装页面。按照提示完成安装。 完成安装后,请确保删除 `/var/www/html/nextcloud/install` 目录,以保障安全。 以上就是 CentOS 7.9 搭建 Nextcloud 的详细步骤。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值