New experimental multistream support in SIP and NoSIP plugins #3514
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.
As the title says, this PR tries to add multistream support to both the SIP and NoSIP plugins. In fact, while the Janus core has supported multistream for quite some time already, only a few plugins were updated to take advantage of that, and that didn't include neither the SIP nor the NoSIP plugin. As a consequence, both plugins were still limited to 1 audio/1 video calls. Considering the context (traditional VoIP), that hasn't been much of an issue, as the overwhelming majority of SIP calls are made of a single audio stream anyway, with the occasional single video stream to come with that. That said, it still was an artificial limitation that should be removed, as there may be use cases where being able to use more than one audio and/or video stream wuld be helpful. This also paves the way for a less hacky integration of non-audio-video data, e.g., data channels for Real-Time text as done in #3231.
This patch adds multistream support to both the SIP and NoSIP plugins, meaning that both of them can now serve and route multiple m-lines. At the moment, there's a hardcoded limit of 10 m-lines you can have per call: this may or may not be a good/smart idea, but it's done like that as the state for multiple m-lines is kept in a static array. We can always increase the hardcoded limit before merging, or figure out a way to make that dynamic (which would complicate things a bit, though, maybe needlessly so).
I've marked it as a draft pull request as, while this should be functionally working (at least from my limited testing), there's more checks and tests that should be done before this can be merged. There are a few key changes in a few areas, for instance (an important one being us disabling the SOA in Sofia, meaning we control the negotiation in its entirety), and so I want to be 100% sure there aren't any regressions in things that work correctly now. If you use either plugin a lot in production, please do take the time to perform some testing, and provide us with feedback on the results. The sooner we know if everything works or if there are things to change/fix, the sooner we can eventually merge this upstream.
As a side note, this is probably obvious due to the nature of the change, but this will be a 1.x only update. The 0.x version of Janus doesn't support multistream at all, and so both plugins there will not be updated accordingly, meaning there won't be any backport.