我使用Asterisk 12和Webrtc(使用sip.js)。当Chrome浏览器接听电话时(来电者是游戏玩家),电话会立即挂断并显示错误
[Aug 4 10:45:16] WARNING[30235][C-0000001f]: res_rtp_asterisk.c:1667 dtls_srtp_setup: Could not set policies when setting up DTLS-SRTP on '0x7ff22802dff0'
[Aug 4 10:45:16] WARNING[30235][C-0000001f]: res_rtp_asterisk.c:3906 ast_rtp_read: RTP Read error: Unspecified. Hanging up.
我的梨在这里
[1060] ; This will be WebRTC client
type=friend
username=1060 ; The Auth user for SIP.js
host=dynamic ; Allows any host to register
secret=1060 ; The SIP Password for SIP.js
encryption=yes ; Tell Asterisk to use encryption for this peer
avpf=yes ; Tell Asterisk to use AVPF for this peer
icesupport=yes ; Tell Asterisk to use ICE for this peer
context=default ; Tell Asterisk which context to use when this peer is dialing
directmedia=no ; Asterisk will relay media for this peer
transport=udp,ws ; Asterisk will allow this peer to register on UDP or WebSockets
force_avp=yes ; Force Asterisk to use avp. Introduced in Asterisk 11.11
dtlsenable=yes ; Tell Asterisk to enable DTLS for this peer
dtlsverify=no ; Tell Asterisk to not verify your DTLS certs
dtlscertfile=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS cert file is
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem ; Tell Asterisk where your DTLS private key is
dtlssetup=actpass ; Tell Asterisk to use actpass SDP parameter when setting up DTLS
[6003] ; This will be the legacy SIP client
type=friend
username=6003
host=dynamic
secret=6003
有人能帮助我吗?
答案 0 :(得分:0)
我使用了srtp 1.4.2,这就是我为DTLS创建证书的方式:
mkdir /etc/asterisk/keys
Enter the Asterisk scripts directory:
cd /usr/local/src/asterisk*/contrib/scripts.
Create the DTLS certificates (replace pbx.mycomany.com with your ip address or dns name, replace My Super Company with your company name):
./ast_tls_cert -C pbx.mycompany.com -O "My Super Company" -d /etc/asterisk/keys