美文网首页FS
FreeSWITCH1.7带mod_av的编译及H264、VP8

FreeSWITCH1.7带mod_av的编译及H264、VP8

作者: 大佛李浩 | 来源:发表于2017-01-05 22:49 被阅读315次

    加QQ群: 293697898 和更多群友一起成长

    原文: http://www.nway.com.cn/t4.html

      FreeSWITCH这个软交换在预算较低的企业电话系统应用中, 应是最具有价值和使用性的一款产品。它的大并发能力,多种媒体支持,纯c底层库的支持, 稳健的健壮性,现为上海宁卫信息技术有限公司主推的系统产品 。它的运营级性能,用户级功能,受到越来越多的用户青睐。宁卫信息
    

    Debian 8 下编译有mod_av的FreeSWITCH 1.7版

    1. 安装 Debian 8

    切记,切记:一定要 64位的debian,而不是32位或别的系统

    1. 通过图形管理界面更改ip地址为静态的或通过命令更改

    前提,加载安装盘,先装个vim,在debian下,vi我认为不好用

    修改 /etc/network/interfaces ,如:

    auto eth0 #设置设备名称
    
    iface eth0 inet static #设置接口类型,static为静态ip,或者为dhcp
    
    address 192.168.1.1 #接口地址
    
    netmask 255.255.255.0 #掩码
    
    gateway 192.168.1.254 #网关
    

    为了让配置生效,运行/etc/init.d/networking restart

    1. 配置debian源

    vim /etc/apt/sources.list

    变成以下内容:

    # deb cdrom:[Debian GNU/Linux 8.1.0 _Jessie_ - Official amd64 DVD Binary-1 20150606-14:19]/ jessie contrib main
    
    #deb cdrom:[Debian GNU/Linux 8.1.0 _Jessie_ - Official amd64 DVD Binary-1 20150606-14:19]/ jessie contrib main
    
    #deb http://security.debian.org/ jessie/updates main contrib
    #deb-src http://security.debian.org/ jessie/updates main contrib
    
    deb http://mirrors.163.com/debian jessie main non-free contrib
    deb http://mirrors.163.com/debian jessie-proposed-updates main contrib non-free
    deb http://mirrors.163.com/debian-security jessie/updates main contrib non-free
    
    deb http://security.debian.org jessie/updates main contrib non-free
    #以上禁掉cdrom和deb原生源,改为163的,加快速度
    # jessie-updates, previously known as 'volatile'
    # A network mirror was not selected during install. The following entries
    # are provided as examples, but you should amend them as appropriate
    # for your mirror of choice.
    #
    # deb http://ftp.debian.org/debian/ jessie-updates main contrib
    # deb-src http://ftp.debian.org/debian/ jessie-updates main contrib
    
    1. 接下来那么就按官方的基本文档走了

    a. 添加freeswitch的源

    echo "deb http://files.freeswitch.org/repo/deb/debian/ jessie main" > /etc/apt/sources.list.d/99FreeSWITCH.test.list

    wget -O - http://files.freeswitch.org/repo/deb/debian/key.gpg |apt-key add -

    apt-get update

    a2. 针对fs1.6最新版,直接安装

    wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -
    
    echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
    
    apt-get update && apt-get install -y freeswitch-meta-all
    

    a3. 针对2016年2月后master或v1.6版本,a 和b不需要执行,先执行a,b,反而会造成安装源包的依赖异常

    wget -O - https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add -
    
    echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" > /etc/apt/sources.list.d/freeswitch.list
    
    apt-get update
    
    apt-get install -y --force-yes freeswitch-video-deps-most 
    

    b. 安装依赖

    DEBIAN_FRONTEND=none APT_LISTCHANGES_FRONTEND=none apt-get install -y --force-yes freeswitch-video-deps-most

    c. git FreeSWITCH的源码

    git config --global pull.rebase true
    git clone https://freeswitch.org/stash/scm/fs/freeswitch.git freeswitch.git
    cd freeswitch.git
    ./bootstrap.sh -j
    ./configure -C
    

    d. 开启mod_av模块

    perl -i -pe 's/#applications\/mod_av/applications\/mod_av/g' modules.conf

    e. 编译并install

    make
    make install
    make cd-sounds-install 
    make cd-moh-install 
    make samples
    

    f. 修改内核参数

    vim /etc/sysctl.d/vid.conf

    net.core.rmem_max = 16777216 
    net.core.wmem_max = 16777216 
    kernel.core_pattern = core.%p 
    

    系统调用使之生效

    sysctl -w net.core.rmem_max=16777216 
    sysctl -w net.core.wmem_max=16777216 
    sysctl -w kernel.core_pattern=core.%p 
    

    g. 将mod_av加载了,fs_cli中load mod_av或autoload_configs/modules.conf.xml 中加一行,
    并在conf/vars.xml中的编码部分添加H264

    h. 添加freeswitch和fs_cli的软链接后,运行freeswitch后,拨3500后试试吧

    手机截图

    [
    以上基本整个工作就结束了。在这里之前很多人说没法视频通信,我个人认为应是没有加载这个mod_av,它是使用ffmpeg进行一系列的音视转换的库,而在centos中,ffmpeg的库比较麻烦些,总是在调用libavformat的时候有异常。在这里测试过的客户端有eyebeam,linphone的vp8和h264的视频编码。这里注明,以前是因为对libav这个库不了解,这是一个从ffmpeg中分出来的库,很多依赖是基于debian,而在centos中要编译则相对麻烦些。

    相关文章

      网友评论

      • jasonluo123:fs1.6 发现会议室混频如果是pc客户端(如linphone)使用vp8,是乎没有图像,碰到过?

      本文标题:FreeSWITCH1.7带mod_av的编译及H264、VP8

      本文链接:https://www.haomeiwen.com/subject/bjctbttx.html