centos7 安装freeswitch

匿名 (未验证) 提交于 2019-12-03 00:17:01

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

6、./configure

7、make install

1、make sounds-install

2、make moh-install

安装错误及其他

一. 编译出错

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

yasm (有nasm的话 不用装这个) ,  opus-devel(可能 提示 libopus-dev 或 libopus-devel 等) ,  lua-devel , libsndfile-devel , libtiff-devel

yasm 和 nasm 必须要有一个,必须装了!

((which nasm) || (which yasm) || (git clone https://github.com/yasm/yasm.git && cd yasm && ./autogen.sh && make && make install))

yum install lua lua-devel

yum -y install opus-devel #可能需要清理:  make clean && ./configure && make

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

#下载包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

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/

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/

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/

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

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.编译:

2.加载(不重启fs)


若想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

`<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. 载入中文配置

四. 解决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>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!