加QQ群: 293697898 和更多群友一起成長
原文: http://www.nway.com.cn/t4.html
FreeSWITCH這個(gè)軟交換在預(yù)算較低的企業(yè)電話系統(tǒng)應(yīng)用中, 應(yīng)是最具有價(jià)值和使用性的一款產(chǎn)品。它的大并發(fā)能力,多種媒體支持,純c底層庫的支持, 穩(wěn)健的健壯性,現(xiàn)為上海寧衛(wèi)信息技術(shù)有限公司主推的系統(tǒng)產(chǎn)品 。它的運(yùn)營級(jí)性能,用戶級(jí)功能,受到越來越多的用戶青睞。寧衛(wèi)信息
Debian 8 下編譯有mod_av的FreeSWITCH 1.7版
- 安裝 Debian 8
切記,切記:一定要 64位的debian,而不是32位或別的系統(tǒng)
- 通過圖形管理界面更改ip地址為靜態(tài)的或通過命令更改
前提,加載安裝盤,先裝個(gè)vim,在debian下,vi我認(rèn)為不好用
修改 /etc/network/interfaces ,如:
auto eth0 #設(shè)置設(shè)備名稱
iface eth0 inet static #設(shè)置接口類型,static為靜態(tài)ip,或者為dhcp
address 192.168.1.1 #接口地址
netmask 255.255.255.0 #掩碼
gateway 192.168.1.254 #網(wǎng)關(guān)
為了讓配置生效,運(yùn)行/etc/init.d/networking restart
- 配置debian源
vim /etc/apt/sources.list
變成以下內(nèi)容:
# 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
- 接下來那么就按官方的基本文檔走了
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. 針對(duì)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. 針對(duì)2016年2月后master或v1.6版本,a 和b不需要執(zhí)行,先執(zhí)行a,b,反而會(huì)造成安裝源包的依賴異常
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. 修改內(nèi)核參數(shù)
vim /etc/sysctl.d/vid.conf
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
kernel.core_pattern = core.%p
系統(tǒng)調(diào)用使之生效
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中l(wèi)oad mod_av或autoload_configs/modules.conf.xml 中加一行,
并在conf/vars.xml中的編碼部分添加H264
h. 添加freeswitch和fs_cli的軟鏈接后,運(yùn)行freeswitch后,撥3500后試試吧
手機(jī)截圖
[
以上基本整個(gè)工作就結(jié)束了。在這里之前很多人說沒法視頻通信,我個(gè)人認(rèn)為應(yīng)是沒有加載這個(gè)mod_av,它是使用ffmpeg進(jìn)行一系列的音視轉(zhuǎn)換的庫,而在centos中,ffmpeg的庫比較麻煩些,總是在調(diào)用libavformat的時(shí)候有異常。在這里測(cè)試過的客戶端有eyebeam,linphone的vp8和h264的視頻編碼。這里注明,以前是因?yàn)閷?duì)libav這個(gè)庫不了解,這是一個(gè)從ffmpeg中分出來的庫,很多依賴是基于debian,而在centos中要編譯則相對(duì)麻煩些。