软件环境:
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
udpbindaddr=0.0.0.0:5060 realm=172.16.8.184;asterisk server ip transport=udp,ws
配置http
配置rtp
配置拨号规则
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