Add support for plain RTP participants in AudioBridge #2464
+494
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for plain RTP participants to the AudioBridge. By "plain RTP" I mean that, up until now, to join an AudioBridge mix you had to use WebRTC: this patch adds a new mode, where you can issue a "join" without actually establishing a PeerConnection, but exchange plain ip/ports instead to be able to send media via plain RTP directly to the mix, and receive it via plain RTP as well. Use cases include manual injection of external RTP input (which is what #1360 was about), but also facilitating the integration with legacy endpoints (e.g., to have SIP users join a Janus AudioBridge).
In order to re-use as much of the existing code as possible, this patch basically just extends the existing API. This means that, to create a plain RTP participant, you still need to attach a Janus handle as you normally would, and still use the
join
request to let the participant join the room: the difference is that you don't provide any JSEP SDP to negotiate a PeerConnection, but provide anrtp
object instead with some info on how the manual RTP connection should be created; the plugin sends back a similarrtp
object back in thejoined
event, and so the external RTP endpoint (which will be seen as a normal participant) and the AudioBridge plugin can send RTP packets to each other.The syntax for the
rtp
object is quite simple. An example of ajoin
request might be this:This will tell the plugin that this participant will use plain RTP, and will be listening on the specified ip/port address; if ip/port are missing, it means this participant will only send media, and will not receive any (e.g., for injecting audio), even though resources will still be created for that (encoder, etc.). There's a few additional properties you can provide, like the audio-level extension ID, the payload type to use, and whether FEC should be enabled (basically what you'd normally expect to find in the SDP).
The
joined
event from the plugin will look exactly as it normally does, but will include anrtp
object of its own, e.g.:As an application orchestrating an RTP participant, that's all you need to know to complete the setup (where to send RTP packets, and where to expect them from). Notice that the plugin doesn't do any ICE or complex stuff, here: just as the SIP and NoSIP plugins, it expects to be able to communicate on those addresses directly.
I've tested this by modifying the NoSIP demo to connect to the AudioBridge via plain RTP, and it seems to be working as expected. Of course, more testing will need to happen, as I expect issues/crashes/leaks to arise here and there: probably some fine tuning will be needed, which is why for the time being I'll open this as a draft PR. If this interests you, please start testing and provide feedback.