Multistream RTP and PJSIP BUNDLE

Hi everyone! I’m seeking some clarification on how Asterisk handles multistream RTP, as well as the ‘BUNDLE’ feature that was added to the pjsip channel driver in Asterisk 15.

TLDR: can a single multi-stream RTP PJSIP endpoint replace multiple single-stream RTP PJSIP endpoints in a conference, or is only one stream active at a time, with RTCP used to select the stream? From testing, multistream results in choppy audio, and BUNDLE results in silence…

My example:
I have a PJSIP endpoint that is dialing into a conference created by confbridge on Asterisk 16. The endpoint has multiple streams of RTP audio (each with a unique SSRC) that it is trying to simulcast into the conference. I am attempting to use multistream RTP instead of registering one endpoint per stream. The intention is that all the audio still gets mixed into the conference simultaneously.

Initially I attempted using multistream: for each stream I added an additional media line and attributes to the INVITE’s SDP (they all use PCMA/8000, sendrecv). I also increased the endpoint’s ‘max_audio_streams’ and ‘max_video_streams’ to 10 in pjsip.conf (though I couldn’t find the hard limit that should be in pjproject.conf). When the INVITE was sent, Asterisk responded with a unique port for each stream, to which my endpoint could forward the RTP packets. When I sent more than the one stream however, the conference’s audio became choppy, as if packets were being dropped or mixed up.

I also attempted to use PJSIP’s ‘BUNDLE’ feature, which allows multiple RTP streams to be sent to a single UDP port Asterisk-side. First I ensured the endpoint was using symmetric RTP (same port for TX/RX). Next I added ‘bundle=yes’ to the endpoint in pjsip.conf. I then added the following line to the SDP to trigger the use of BUNDLE and declare the different MID:
‘a=group:BUNDLE audio’
A corresponding line was then added to each media stream, associating it with a MID:
After sending the INVITE, Asterisk responded with the same port for each stream (as expected), in addition to a unique SSRC and CNAME for each stream, and the tag ‘a=rtcp-mux’.

At this point, no audio was being played into the conference. I first tried overwriting the SSRC of my RTP streams to match those returned by Asterisk. No change. I then attempted giving each stream a unique MID e.g. ‘audio0 audio1 audio2 audio3’. No change. I am unsure if I need to respond to ‘rtcp-mux’ to somehow tell Asterisk which stream to use (although I ideally want to use all the streams).

This is where my understanding of multistream/pjsip bundle in Asterisk is lacking. I would appreciate any sort of insight! Am I fundamentally misinterpreting how multiple RTP streams are handled by Asterisk, or am I just missing some attribute/config?

Thanks in advance for your help!

Bridging and ConfBridge don’t support multiple audio streams being mixed in. It is not functionality anyone has experimented with or explored. The functionality has really only been used for additional outgoing video streams from Asterisk to a WebRTC browser.

Ah, well that explains it. Thanks for replying so quickly and clarifying the matter! I take it then that it’s not something being looked into for future development yet…

The reason I was trying to group multiple streams under one endpoint was so that the single stream of audio being sent back to the endpoint from ConfBridge would only contain other participants’ audio, and not the streams I was injecting.

If I were to instead use a new endpoint for every stream I wanted to inject into the conference, I wouldn’t be able to receive back a stream from ConfBridge that didn’t contain any of these injected streams… As far as I’m aware, the mix sent back to an endpoint from ConfBridge only excludes that endpoint.

I know of noone working on such functionality. It’s not something anyone else has really wanted or mentioned.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.