WebRTC: Sipml5+Asterisk11+Centos6


软件环境:

Asterisk 11.15.0

Firefox:50.1.0

目前发现的问题:

  • 单向RTP语音流       不知是否是asterisk 版本问题,还是浏览器的问题
  • 使用谷歌浏览器ws注册失败,其他浏览器未尝试

 

安装依赖包

yum install gcc-c++ make gnutls-devel kernel-devel libxml2-devel ncurses-devel subversion doxygen texinfo curl-devel net-snmp-devel neon-devel
yum install uuid-devel libuuid-devel sqlite-devel sqlite git speex-devel gsm-devel

安装srtp

cd /usr/src/
wget http://srtp.sourceforge.net/srtp-1.4.2.tgz
tar zxvf srtp-1.4.2.tgz
cd srtp
CFLAGS="-fPIC" ./configure --enable-pic && make && make install
cp /usr/local/lib/libsrtp.a /lib

安装jansson

wget http://www.digip.org/jansson/releases/jansson-2.5.tar.gz
tar zxvf jansson-2.5.tar.gz
cd jansson-2.5
 ./configure –prefix=/
make && make install

安装asterisk

cd /usr/src/asterisk-13.1.0 && make clean
./contrib/scripts/install_prereq install
./contrib/scripts/install_prereq install-unpackaged
./configure --with-crypto --with-ssl --with-srtp=/usr/local/lib
contrib/scripts/get_mp3_source.sh
make menuselect.makeopts
menuselect/menuselect --enable format_mp3 --enable res_config_mysql --enable app_mysql --enable app_saycountpl --enable cdr_mysql --enable EXTRA-SOUNDS-EN-GSM
make && make install
make config

生成加密证书

请参考:在Elastix 4.0上启用TLS和SRTP进行加密通话

手动生成 /etc/asterisk/keys时,需要加上 chown -R asterisk:asterisk /etc/asterisk/keys,否则,asterisk会无权访问

配置sip

sip_general_custom..conf
udpbindaddr=0.0.0.0:5060
realm=172.16.8.184;asterisk server ip
transport=udp,ws


sip_custom.conf
[6001]
type=friend
secret=6001
host=dynamic
username=6001
insecure=invite,port
context=from-internal
disallow=all
allow=all
encryption=yes
avpf=yes
force_avp=yes
icesupport=yes
transport=ws,wss,udp,tcp,tls
dtlsenable=yes
directmedia=no
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass
net=no
 
[6002]
host=dynamic
secret=6002
context=from-internal
type=friend
transport=ws,wss,udp
directmedia=no
disallow=all
allow=all

配置http

http_additional.conf
[general]
enabled= yes
bindaddr=0.0.0.0
bindport=8088

配置rtp

rtp_additional.conf
[general]
rtpstart=10000
rtpend=20000
icesupport= yes
stunaddr=stun.l.google.com:19302

配置拨号规则

Error rendering macro 'code': Invalid value specified for parameter 'firstline'
[outgoing]
exten => _X.,1,Dial(SIP/${EXTEN})
exten => _X.,n,Hangup()

安装sipml5

cd /var/www/html
svn checkout http://sipml5.googlecode.com/svn/trunk/
chown -R asterisk:asterisk /var/www/html/sipml5

配置浏览器

打开Firefox浏览器,在地址栏输入:about:config ,将“network.websocket.allowInsecureFromHTTPS”、“network.websocket.auto-follow-http-redirects”设置为“true”,保存后重启浏览器。


在Firefox浏览器中输入:https://172.16.8.184/sipml5/call.htm 填写以下信息并点击“Expert mode”:

 


返回call.htm页面进行登录,并与6002普通软电话进行通话


转载自:https://kunjans.wordpress.com/2015/01/09/web-sip-client-sipml5-with-asterisk-13-on-centos-6-6/

参考链接:

https://wiki.asterisk.org/wiki/display/AST/Asterisk+WebRTC+Support

https://wiki.asterisk.org/wiki/display/AST/WebRTC+tutorial+using+SIPML5



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值