Missing progress in ARI ChannelStateChange event

This is all done using ARI.

When making an outbound call I will listen to ChannelStateChange events and when I receive an event state of ‘Ringing’, I will start playing ringback to the caller, and when I get the event state ‘Up’, I will create a bridge and add both ends to the bridge.

My problem is that there is a few Telecom providers here in Denmark that does not send the SIP reply “180 Ringing” before they send “183 Progress” with SDP, telling Asterisk to bridge the 2 parties for early media because they themself are playing the callback tones.

Because ARI does not know about “183 Progress”, I do not know when to bridge the 2 parties for early media, and thus I have no callback and no audio before I get the event state ‘Up’.

How can I get around this problem or is there another event I can listen to that will tell me about progress on a SIP channel?

There is no explicit event for this, instead early bridge support was added[1] to allow bridging early so that progress flows.

[1] https://blogs.asterisk.org/2016/08/24/asterisk-14-ari-create-bridge-dial/

I have implemented that, and it works fine - except for callerID.

I create the channel, then sets callerId using ari.channels.setChannelVar() to set CALLERID(name) and CALLERID(num). Then I add the caller and the channel to a bridge, and call Dial on it.

But it does not work.

Originate has a callerId property but Dial does not. What to do?

It may be used the connected line information of the caller for that. I haven’t touched that part in quite awhile, and did not write it, so I do not recall the specifics.

You are absolutely right - CONNECTEDLINE() works!

Thank you!!!