天天看點

安裝 esl php 子產品,FreeSWITCH 安裝配置的 各種坑, 填坑

個人安裝環境:

OS:CentOS6.7 64位

FreeSWITCH Ver:1.6.17

一. 編譯出錯

安裝 之前, 最好 先安裝 這幾個東西(如果有, 請忽略):

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`等:第二行修改為)

5. 載入中文配置

在`freeswitch.xml`的`

` `

四. 解決ESL拒絕連接配接問題

預設是隻接受本機連接配接的,稍一改動就 内外都不能連接配接了,或者隻能接受内外之一連接配接

解決方法:

1. event_socket.conf.xml 加入:

2. acl.conf.xml 加入: