FreeSWITCH1.7帶mod_av的編譯及H264、VP8轉碼支持操作及WEBRTC

加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中要編譯則相對麻煩些。
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容