Add support for dynamic server-sent offers via 406 responses #9
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 implements the restored support for server-sent offers, as described in v03 of the WHEP draft. Specifically, depending on the Janus plugin acting as a backend for a specific WHEP endpoint, it replies either with an SDP answer via a 201 right away (as before) or, if the Janus plugin is known not to support it, it replies with its own offer via a 406 instead.
In order to test this more effectively, this PR is built on top of #8, so that this dynamic behaviour can be seen in action: attempting to establish a session with a Janus 0.x instance, or with the VideoRoom/Record&Play plugins in Janus 1.x, will enable the fallback to server-sent offers. Connecting to a Streaming plugin mountpoint on Janus 1.x will always use client-sent offers instead, since that plugin was modified to have support for that.
There are still a couple of ambiguities in the spec (e.g., in terms of how to reply under specific circumstances), but those can be discussed as part of the standardization process.
In order to test this, I modified both my WHEP players, that is: