Asterisk WebRTC DTLS-SRTP issue

Hi, I am looking for a little bit of help from the community if possible please? I’m experimenting with Chrome (JSSIP), WebRTC and Asterisk 13.2.0-rc1. I currently have everything configured as per the latest recommendations and so far have made some promising progress.

I have two peers defined in Asterisk, which I am able to successfully register with. Signalling seems to be working nicely, as I am able to initiate and reject calls without any problems.

However, when I answer a call which is initiated, it terminates immediately. In the Asterisk logs, I see the following:-

[2015-05-12 13:03:33] WARNING[3931][C-00000009] res_rtp_asterisk.c: Could not set policies when setting up DTLS-SRTP on ‘0x7f752c001320’
[2015-05-12 13:03:33] WARNING[3931][C-00000009] res_rtp_asterisk.c: RTP Read error: Unspecified. Hanging up.

I have generated keys/certificates for Asterisk and they are declared in sip.conf (example):-

[XXX]
type=friend
username=XXX
host=dynamic
secret=XXXXXXXXXX
encryption=yes
avpf=yes
icesupport=yes
context=default
directmedia=no
transport=ws,wss,udp
force_avp=yes
dtlsenable=yes
dtlsverify=fingerprint
dtlscertfile=/etc/asterisk/keys/asterisk.pem
dtlsprivatekey=/etc/asterisk/keys/asterisk.pem
idtlscafile=/etc/asterisk/keys/ca.crt
dtlssetup=actpass
dtlsrekey=60
videosupport=no
nat=no
disallow=all
allow=ulaw

Please could anyone shed some light on what I’m doing wrong? Thank you :smile:

For anyone else experiencing this issue, it turned out that it was down to compiling Asterisk on a 64-bit system and srtp not being compiled correctly.

Can you specify the steps to compile the srtplib in a 64 bits system?

I did it in the following way:

wget http://srtp.sourceforge.net/srtp-1.4.2.tgz tar zxvf srtp-1.4.2.tgz cd srtp autoconf ./configure --enable-pic --libdir=/usr/lib64 make && make install

I’m having the same error :

[Jun 2 12:02:21] WARNING[41930][C-00000000]: res_rtp_asterisk.c:1974 dtls_srtp_setup: Could not set policies when setting up DTLS-SRTP on '0x7fe818008c40' [Jun 2 12:02:21] WARNING[41930][C-00000000]: res_rtp_asterisk.c:4249 ast_rtp_read: RTP Read error: Unspecified. Hanging up.

Handshake seems to happen with the client that receives the call but after that asterisk sen BYE


subir fotos online

as an aside, people reading this should be getting libsrtp from github [1] now, as that’s where Cisco moved the repository. It’s received important bug-fixes since its sourceforge days that, if ignored, will lead to problems - there are a few on the Asterisk issue tracker that turned out to be libsrtp problems.

[1] - github.com/cisco/libsrtp