[ARI] No audio between channels in bridge

What I’m doing: creating two channels (using originate to PJSIP endpoints) and a bridge (‘mixing’) with ARI. Adding then both channels to the bridge.

What I’m expecting: once I answer on those 2 endpoints I should be able to talk between them.

What I’m experiencing: no conversational audio flows between the endpoints. I can start/stop MOH on the bridge and I will hear the music on both endpoints. If I call from one SIP phone to the other, then voice can be heard as expected, but not when started via ARI.

I’m testing my code in a REPL shell, and my flow is basically:

  1. Create bridge with type ‘mixing’
  2. Create channel 1 via originate to SIP endpoint
  3. Answer phone 1
  4. Create channel 2 via originate to SIP endpoint
  5. Answer phone 2
  6. Add both channel ids to the bridge with addChannel

I’m using Asterisk 17.7.0.

Does ConfBridge work? It uses the same underlying technology and requires a working timing source to work, if that’s not working then no media would flow. You could also check this by looking to see if media is flowing out. Failing that you’d need to provide console output.

Thank you for your answer. It was due to a media setting.

Sorry, its been a while (8years?) since I last worked with asterisk.

I do have to say that I the elegance of the new API. Congrats on that.

Hi edmty,

Apologies for the bump. The problem you’re describing sounds similar to one I’m having (although I’m using an ALSA channel and SIP channel from another asterisk instance).

Could you explain a bit about what media settings you changed to get this to work?

Apologies if this is a silly question, I’m new to Asterisk.

I explicitly set directmedia to false to the relevant endpoints.

The clue to this was in the console logs.

Thanks so much for the reply!

Based on my understanding, adding the value “proxy_media” to the bridge creation request might achieve the same effect?

Unfortunately neither this change, nor uncommenting the “directmedia=no” line in sip.conf seem to have resolved my issue. So perhaps I am barking up the wrong tree. Although I notice the HTTP response for the bridge creation request lists the bridge type as “mixing” and doesn’t include the “proxy_media” value as in my request. I assume that’s a red herring, and my problem lies somewhere else.

Thanks again!

Your problem would be elsewhere. Direct media would only be possible between two SIP channels, otherwise it wouldn’t occur.