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:
‘a=mid:audio’
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!