Could not set policies when setting up DTLS-SRTP

Hi All,

We are trying to make setup for webrtc to sip with asterisk. We could able to make both REGISTER and Call. But after call is answered from asterisk, we could see below errors,

[May 6 19:08:50] DEBUG[30448] netsock2.c: Splitting ‘192.168.73.234’ into…
[May 6 19:08:50] DEBUG[30448] netsock2.c: …host ‘192.168.73.234’ and port ‘’.
[May 6 19:08:50] DEBUG[30448] acl.c: For destination ‘192.168.73.234’, our source address is ‘192.168.151.122’.
[May 6 19:08:50] DEBUG[30448] res_rtp_asterisk.c: Setting RTCP address on RTP instance ‘0x7efef40153e8’
[May 6 19:08:50] WARNING[31237][C-00000001] res_rtp_asterisk.c: Could not set policies when setting up DTLS-SRTP on ‘0x7efef4016310’
[May 6 19:08:50] WARNING[31237][C-00000001] res_rtp_asterisk.c: RTP Read error: Unspecified. Hanging up.
[May 6 19:08:50] DEBUG[31237][C-00000001] channel.c: Hangup of channel SIP/6001-00000000 detected in answer routine
[May 6 19:08:50] DEBUG[31237][C-00000001] pbx.c: Spawn extension (play_annc,6002,1) exited non-zero on ‘SIP/6001-00000000’
[May 6 19:08:50] VERBOSE[31237][C-00000001] pbx.c: Spawn extension (play_annc, 6002, 1) exited non-zero on ‘SIP/6001-00000000’
[May 6 19:08:50] DEBUG[31237][C-00000001] channel.c: Soft-Hanging (0x10) up channel ‘SIP/6001-00000000’
[May 6 19:08:50] DEBUG[31237][C-00000001] channel.c: Hanging up channel ‘SIP/6001-00000000’
[May 6 19:08:50] DEBUG[31237][C-00000001] chan_sip.c: Hangup call SIP/6001-00000000, SIP callid b9ceb3ce-c8b0-bb61-0f85-4d85a399ece2
[May 6 19:08:50] DEBUG[31237][C-00000001] res_rtp_asterisk.c: Setting RTCP address on RTP instance ‘0x7efef40153e8’
[May 6 19:08:50] VERBOSE[31237][C-00000001] chan_sip.c: Scheduling destruction of SIP dialog ‘b9ceb3ce-c8b0-bb61-0f85-4d85a399ece2’ in 32000 ms (Method: ACK)

Asterisk version: 14.4
SRTP version: 1.4.2 and 2.0.0

Kindly suggest where we are doing mistake if anyone came across this case.

Regards,
Sudhan

Do you have the res_srtp module loaded?

thank you for your response jcolp.
yes, it’s runing
see the following asterisk logs

*CLI> module show
Module Description Use Count Status Support Level
chan_sip.so Session Initiation Protocol (SIP) 0 Running core
codec_alaw.so A-law Coder/Decoder 0 Running core
codec_ulaw.so mu-Law Coder/Decoder 0 Running core
pbx_config.so Text Extension Configuration 0 Running core
res_http_websocket.so HTTP WebSocket Support 1 Running extended
res_rtp_asterisk.so Asterisk RTP Stack 0 Running core
res_srtp.so Secure RTP (SRTP) 0 Running core
7 modules loaded
*CLI> sip set debug on

Looking at the code the only other reason is if we received an error from libsrtp itself when trying to do certain things (creating or replacing the SRTP session). Why it would do that I’m not really sure.

1 Like

Hi jcolp,
Thank you for your support.
Will you please share to us. Asterisk 14 which version of srtp is suitable
by using the srtp 1.4.2 we are not able to build " .so " file. By using the srtp_2.0.0 our asterisk is not supporting. so, can please help us…

I know of people using 1.5.4.

1 Like

Thank you jcolp it’s working for me. :relaxed: