Hello,
So we’re using asterisk and PJSUA2 with python an ARI. The setup is straight forward, we have a voice command bridge and a call bridge.
The channel is initiated to an endpoint where they participate in the voice command bridge with another channel. All is well.
Then, that channel needs to be moved to a call bridge. So the channel is removed from the voice command bridge, and placed into the call bridge with the other channel.
For some reason, there is exactly 5 - 6 seconds of no RTP traffic flowing from asterisk to the same first channel that was used in the voice command bridge, that is now part of the call bridge.
The call bridge has been receiving media from the called endpoint the entire time.
Although I see a re-invite, the media portion remains the same and thus we do nothing about it.
At DEBUG level in asterisk there are no messages before media starts flowing again, so I’m perplexed as to why all of a sudden asterisk starts sending media.
The entire log is attached
Asterisk Problem - ARI bridge.txt (2.7 MB)
So even with a single bridge this is still an issue.
Adding a callee, and removing the voice command channel from the bridge, results in the same thing. No RTP is sent from asterisk for about 6 seconds, then all of a sudden without any messages from core RTP packets begin to flow again.
So I’m pretty certain this has something to do with the re-invite received, but the SDP contains the same media portion. Looking at the logs, asterisk decides to re-invite after the other channels leaves the bridge.
I see the SIP interaction naturally continuing, with PJSUA2 responding with it’s own offer, then receiving an ACK from asterisk.
6 seconds later, the RTP media resumes.
Upgrading to Asterisk 20.14.0 didn’t help…
So this ended up being how the channel to the endpoint is created. I don’t know why it matters, but the endpoint must be PJSIP instead of Local.
self.interior_channel = run_coroutine_threadsafe(self.ari_client.channels.create(endpoint=‘PJSIP/%s’ % self.extension, app=ast_app), self.async_loop).result() # Local/1003@from-internal
Hmm, so this actually breaks the channel being able to be on a POTS call (aka not to another extension). There is no audio at all when trying to start one channel with PJSIP/xxx and the external out with Local/xxx@from-internal.
Anyone have any advice?
Do you happen to be allowing direct media between endpoints?
I don’t experience the issue you describe when moving a channel between bridges with ARI, but I’m not allowing direct media since calls are being recorded.