freeswitch安装1.6

FreeSwitch呼叫中心


FreeSwtich 安装

参考链接 https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7

#freeswitch_v1.6_install_centos7.6.sh

yum install -y http://files.freeswitch.org/freeswitch-release-1-6.noarch.rpm epel-release

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

# 
cd /usr/local/src
#git clone -b v1.6 https://github.com/signalwire/freeswitch.git freeswitch
git clone -b v1.6 https://gitee.com/dong2/freeswitch.git freeswitch
cd /usr/local/src/freeswitch
./bootstrap.sh -j
./configure
make -j
make -j install

# 
#make -j cd-sounds-install
#make -j cd-moh-install

# 
ln -sf /usr/local/freeswitch/bin/freeswitch /usr/bin/ 
ln -sf /usr/local/freeswitch/bin/fs_cli /usr/bin/

# 
#freeswitch
#freeswitch -nc
#freeswitch -nonat -nonatmap
#freeswitch -nonat -nonatmap -nosql

# 
#netstat -anp|grep 5060

# 
#fs_cli

安装过程中遇到各种问题

一. 编译出错
安装 之前, 最好 先安装 这几个东西(如果有, 请忽略):

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

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>




报错:

Neither yasm nor nasm have been found. See the prerequisites section in the README for more info.



这个只需要安装yasm

有两种方法

1)

yum install yasm

2)

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar zxvf yasm-1.2.0.tar.gz
cd yasm-1.2.0/
./configure
make
make install
报错:
spandsp >= 3.0... configure: error: no usable spandsp; please install spandsp3 devel package or equivalent


cd /usr/src/freeswitch
git clone https://github.com/freeswitch/spandsp.git
cd spandsp
./bootstrap.sh -j
./configure
make
make install
ldconfig


或者
yum  install  -y spandsp3-devel.x86_64


报错
 configure: error: no usable sofia-sip; please install sofia-sip-ua devel package or equivalent
 
 cd /usr/src/freeswitch
git clone https://github.com/freeswitch/sofia-sip.git
cd sofia-sip
./bootstrap.sh -j
./configure
make
make install
ldconfig
或者

yum  install  sofia-sip-devel.x86_64 -y

报错:

You must install libopus-dev to build mod_opus. Stop.

解决:

      安装libopus-devel rmp包:  https://centos.pkgs.org/6/linuxtech/libopus-devel-1.1-1.el6.i686.rpm.html

    1.Create the repository config file /etc/yum.repos.d/linuxtech.repo:

    [linuxtech]
    name=LinuxTECH
    baseurl=http://pkgrepo.linuxtech.net/el6/release/
    enabled=1
    gpgcheck=1
    gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET

    2.install libopus-devel rpm package:

    # yum install libopus-devel
    
    报错: CMake 3.7.2 or higher is required.  You are running version 2.8.12.2
    wget https://cmake.org/files/v3.17/cmake-3.17.0.tar.gz
    tar -zxvf cmake-3.17.0.tar.gz
    cd cmake-3.17.0
    ./bootstrap
    gmake
    sudo make install  
    
    
    
    报错:-bash: /usr/bin/cmake: No such file or directory,
    则可以手动添加,找到安装的cmake文件,进入cmake3.x文件夹中,在进入bin文件夹,运行
    freeswitch1.6 以上 configure添加 :
     cp ./cmake-3.x/bin/cmake /usr/bin/
    
    
    报错:You must install libks to build mod_signalwire.  Stop.
   
    git clone https://github.com/signalwire/libks.git
    cmake .
    make
    sudo make install  
    或
    yum install libks
    
    
    报错:You must install signalwire-client-c to build mod_signalwire
    git clone https://github.com/signalwire/signalwire-c.git
    cmake .
    make
    sudo make install
    freeswitch1.6以上编译文件需要添加:
    或
    yum install signalwire-client-c
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:${PKG_CONFIG_PATH}
    然后重现./configure
  
 
# 这两句应该没用
# cp    /usr/local/lib/pkgconfig/*.pc /usr/lib64/pkgconfig/
# cp -f /usr/local/lib/* /usr/lib64/



   

3. 执行./configure 

    此时会报错: checking for sqlite3 >= 3.6.20... Package sqlite3 was not found in the pkg-config search path. Perhaps you should add the directory containing `sqlite3.pc' to the PKG_CONFIG_PATH environment variable No package 'sqlite3' found
configure: error: Library requirements (sqlite3 >= 3.6.20) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

    看来是没有安装sqlite3的包

4. 安装sqlite3:

     下载sqlite3安装配置文件: http://www.sqlite.org/2015/sqlite-autoconf-3080800.tar.gz

      解压后./configure make make install

      yum install sqlite-devel

      [root@vtc-test1 sqlite-autoconf-3080800]# sqlite3 --version
      3.8.8 2015-01-16 12:08:06 7d68a42face3ab14ed88407d4331872f5b243fdf

5. 回到Freeswitch

    又遇到新的问题: checking for libpcre >= 7.8... Package libpcre was not found in the pkg-config search path. Perhaps you should add the directory containing `libpcre.pc' to the PKG_CONFIG_PATH environment variable No package 'libpcre' found
configure: error: Library requirements (libpcre >= 7.8) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

     yum install libpcre-devel后继续

     (如果没有这个包的话可以直接从以下地址下载: http://rpm.pbone.net/index.php3/stat/4/idpl/23606412/dir/centos_6/com/pcre-devel-8.13-1.1.x86_64.rpm.html

      如果遇到NOKEY的错误可以:

       

rpm --import /etc/pki/rpm-gpg/RPM* 

然后重新安装即可正常,或者直接带--force --nodeps参数安装;

rpm -ivh *rpm --force --nodeps 这样即可正常安装。

)
     checking for speex >= 1.2rc1 speexdsp >= 1.2rc1... Package speex was not found in the pkg-config search path. Perhaps you should add the directory containing `speex.pc' to the PKG_CONFIG_PATH environment variable No package 'speex' found Package speexdsp was not found in the pkg-config search path. Perhaps you should add the directory containing `speexdsp.pc' to the PKG_CONFIG_PATH environment variable No package 'speexdsp' found
configure: error: Library requirements (speex >= 1.2rc1 speexdsp >= 1.2rc1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

     yum install speex-devel后继续

     checking for libldns >= 1.6.6... checking for ldns_str2rdf_a in -lldns... no
configure: error: You need to either install libldns-dev or disable mod_enum in modules.conf

     按照提示注释掉mod_enum在modules.conf文件中

     configure: error: You need to either install libedit-dev (>= 2.11) or configure with --disable-core-libedit-support

     yum install libedit-devel

配置freeswitch

1) Change password
cd /usr/local/freeswitch/conf
vi vars.xml
    Change:  <X-PRE-PROCESS cmd="set" data="default_password=123456"/> {!!set it to something different!!}
    Save and close (<Esc> :wq!)

2) Delete IPv6
cd /usr/local/freeswitch/conf/sip_profiles
mv internal-ipv6.xml internal-ipv6.xml.removed   {disables ipv6 support}
mv external-ipv6.xml external-ipv6.xml.removed  {disables ipv6 support}

3) Configuring ext-rtp-ip
cd /usr/local/freeswitch/conf/sip_profiles/
vi internal.xml
    <param name="ext-rtp-ip" value="14.29.xx.77"/>
    <param name="ext-sip-ip" value="14.29.xx.77"/>

vi external.xml
    <param name="ext-rtp-ip" value="14.29.xx.77"/>
    <param name="ext-sip-ip" value="14.29.xx.77"/>

 

4)stun

  <X-PRE-PROCESS cmd="stun-set" data="external_rtp_ip=stun:14.29.xx.77:3478"/>
  <X-PRE-PROCESS cmd="stun-set" data="external_sip_ip=stun:14.29.xx.77:3478"/>
  
  

添加音视频

1.修改FreeSWITCH安装路径下/conf/var.xml文件中,增加:

<X-PRE-PROCESS cmd=="set" data="proxy_media=true"/>
2.修改FreeSWITCH安装路径下/conf/sip_profiles/internal.xml文件,设置inbound-proxy-media和inbound-late-negotiation为true

<!--Uncomment to set all inbound calls to proxy media mode-->
<param name="inbound-proxy-media" value="true"/>
<!-- Let calls hit the dialplan before selecting codec for the a-leg -->
<param name="inbound-late-negotiation" value="true"/>
修改配置之后重启FreeSWITCH或者打开FS_Cli输入reloadxml。

如果视频编码问题报错,可尝试修改/conf/var.xml的配置项global_codec_prefs 和 outbound_codec_prefs如下(增加可用编解码器)

<X-PRE-PROCESS cmd="set" data="global_codec_prefs=OPUS,G722,PCMU,PCMA,GSM,H263,H264,VP8,H263-1998"/>
<X-PRE-PROCESS cmd="set" data="outbound_codec_prefs=OPUS,G722,PCMU,PCMA,GSM,H263,H264,VP8,H263-1998"/>

webrtc客户端sipml5

网上开源版本可能存在问题,请使用我们提供的jsSip

参考链接 https://github.com/DoubangoTelecom/sipml5

webrtc客户端使用

WebSocket URI 默认的端口是5066

可在 文件中修改 /usr/local/freeswitch/conf/sip_profiles/internal.xml

可在 文件中修改 /usr/local/freeswitch/conf/vars.xml

SIP IP:PORT 默认的端口是5060

账号1001 - 1020 可以直接使用注册

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Ci2Evm2D-1645608816179)(C:%5CUsers%5CSjmao%5CAppData%5CRoaming%5CTypora%5Ctypora-user-images%5C1621561719084.png)]

常见错误

https://blog.csdn.net/yijianxiongwan/article/details/120027347

sip呼叫报错AUDIO RTP REPORTS ERROR: [Remote Address Error!]

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-aRa2J6es-1645608816181)(FreeSwitch%E5%91%BC%E5%8F%AB%E4%B8%AD%E5%BF%83.assets/1636081929111.png)]

本教程参考链接:

https://www.cnblogs.com/dong1/p/12148731.html

https://freeswitch.org/confluence/display/FREESWITCH/CentOS+7

https://www.cnblogs.com/lzpong/p/6740188.html

https://blog.csdn.net/luozirong/article/details/78532679

https://blog.csdn.net/gpf626487/article/details/81213711

https://blog.csdn.net/tech_universe/article/details/42870123

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值