switch安装linux教程,centos7 安装freeswitch

本文档详细介绍了如何在Linux环境中编译安装Freeswitch,包括安装必要的依赖库,解决编译错误,以及安装中文语音模块。在安装过程中,会遇到如yasm、lua-devel、opus-devel等依赖的安装问题,需要按照错误提示逐一解决。安装完成后,还提供了加载中文语音模块的步骤,包括修改配置文件和加载模块。
摘要由CSDN通过智能技术生成

1、安装运行库

yum install -y git gcc-c++ wget alsa-lib-devel autoconf automake bison broadvoice-devel bzip2 curl-devel db-devel e2fsprogs-devel flite-devel g722_1-devel 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 libtiff-devel libtheora-devel libtool 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 python26-devel python-devel soundtouch-devel speex-devel sqlite-devel unbound-devel unixODBC-devel libuuid-devel which yasm zlib-devel

2、 cd /usr/local

3、wget  http://files.freeswitch.org/freeswitch-releases/freeswitch-1.8.2.tar.bz2

4、tar xvjf freeswitch-1.8.2.tar.bz2

5、cd freeswitch-1.8.2

6、./configure

7、make install

---------------------------以上是安装freeswitch    下面是安装声音文件---------------------------

语音包是安装在 /usr/local/freeswitch-1.8.2/sounds 下的

1、make sounds-install

2、make moh-install

安装错误及其他

一. 编译出错

安装 之前, 最好 先安装 这几个东西(如果有, 请忽略):

yasm (有nasm的话 不用装这个) ,

opus-devel(可能 提示 libopus-dev 或 libopus-devel 等) ,

lua-devel , libsndfile-devel , libtiff-devel

当然了,  你也可以 先不管, 等 出错 提示了, 在按照下面的方法安装:

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

#下载包libsndfile-x.x.xx.tar.gz from地址 http://www.mega-nerd.com/libsndfile/#Download, 然后

tar zxvf libsndfile-1.0.26.tar.gz

./configure

make

make install

cp /usr/local/lib/pkgconfig/sndfile.pc /usr/lib64/pkgconfig

#然后 重新 configure FreeSWITCH...

如果还是报这个错误,就注释这两行,在Makefile:

vim src/mod/formats/mod_sndfile/Makefile

# Comment line 897 & 898

#install: error

#all: error

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

git clone https://freeswitch.org/stash/scm/sd/libav.git

cd libav

./configure #CFLAGS="-fPIC" ./configure --enable-pic --enable-shared

make # make CXXFLAGS="-fPIC"

make install

二. 其他问题

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`中``的注释去掉即可。

也可以这样:

sed -i 's###g' autoload_configs/modules.conf.xml

3.修改 `var.xml`中的配置

``修改为中文语音文件的目录

``

加入以下几行(也可以不加)

4.加入中文语音配置

cd conf/lang

cp -R en zh

mv zh/en.xml zh/zh.xml

vim zh/zh.xml

(替换路径`en/us/callie`和 `en`等:第二行修改为)

或者修改zh.xml

7、/usr/local/freeswitch/conf/freeswitch.xml

在61行增加  

8、控制台 reloadxml

5. 载入中文配置

在`freeswitch.xml`的`

` `

四. 解决ESL拒绝连接问题

默认是只接受本机连接的,稍一改动就 内外都不能连接了,或者只能接受内外之一连接

解决方法:

1. event_socket.conf.xml 加入:

2. acl.conf.xml 加入:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值