No audio (SRTP) is heard if bridged using ARI

I am facing very strange issue. Here is the scenario.

I have asterisk box configured with (secure TLS + SRTP) SIP trunk from Twilio. When call comes from twilio, I place the call to another number using twilio outgoing trunk (TLS+SRTP). This one works perfectly with secure as well as insecure RTP. Call gets connected and audio is heard.

Now the difficult part. I have an ARI application that is called when call is received from Twilio. The ARI application creates second leg and on answer it bridges both the channels. This scenario also works for RTP is used instead of SRTP. It works means, call is connected and audio is properly heard on both the sides.

However, If I put secure trunk SRTP + TLS along with ARI application then call gets connected properly. But audio is not heard.

Bottomline is,

SRTP + ARI Application -> Not Working
RTP + ARI Application -> Working
SRTP + Dial App -> Working
RTP + Dial App -> Working

Here is the sip debug log from asterisk CLI.

Please help.

secure rtp.txt (18.7 KB)

I would suggest upgrading to the latest version of Asterisk, and also enabling “rtp set debug on” to see if media is flowing as expected.

I upgraded to the latest version that is 15.4.

RTP debug logs look fine. In fact, I captured logs for both the scenarios that is by using ARI application and by using direct dial plan.

In both the cases, RTPs flow both ways. But there is no sound in case of ARI application. For Dial plan it works fine.

You may have gotten hit by this bug[1]. It’ll be fixed in the next release or you can pull it down yourself and apply it.

[1] https://gerrit.asterisk.org/#/c/8885/

Thanks. that fixes it.