fix(JingleSession) start modification queue after session is established.
Pull initial offer/answer tasks out of the modification queue and execute them right away. Only track and codec related operations that necessitate a renegotiation cycle need to be pushed to the modification queue. The queue execution is paused until the session is established. This avoids track operations being executed before the session is established. This fixes an issue seen in p2p connections where sources of the initiator are not signaled to the remote since the tracks are added while the initiator is waiting for a session-accept from the peer.
With visitors we rarely see not able to send messages or presence because not connected error.
Seems the status of the connection is wrong when quickly disconnecting and connecting again.
feat: Clean up immediately when room is not joined.
When receiving error like max occupants reached we have not joined the room, and there is no point of sending presence unavailable and check and clean after 5 secs.
fix(JingleSession) Avoid pushing encodings configuration task to the queue.
When configureSenderVideoEncodings task is pushed to the modification queue, there might not be a setParameters call in progress and this new one will not get chanined to any promise. However, when the task finally is executed, there is a chance for another setParameters method execution to be in progress and can result in setParameters call failing. Also, these extra steps to ensure that the sender encodings are correctly encoded are no longer needed since with multi-stream mode, we do not change the source video type and the previous encodings config will still be valid.
* feat(visitors): Visitors chat.
For messages coming from visitors, which are not in the current room we need to supply a display name.
Mark messages with custom display name as coming from guest.
* feat: Adds a visitors version to conferenceIQ.
Update notes:
- The base64-sha1 code got stripped out, so we bundle it now
- There are 2 optional dependencies which we want to ignore to avoid
extra bundle size: xmldom and ws (the former is used by RN but we
provide it in the app and the latter is only used by Node
environments)
fix(codec-selection) Apply codec preferences to initial offer/answer.
This fixes an issue where p2p clients (with different codec preferences) fail to decode video because the negotiated codecs are removed from the supported codecs list after the media session is established. The codec preferences will be applied when the first offer/answer is created.
fix(TPC) Disable media instead of changing dir for p2p->jvb switch. (#2226)
* fix(TPC) Disable media instead of changing dir for p2p->jvb switch.
Resume or suspend the media on the jvb peerconnection by changing the RTCRtpEncodingParamters.active state instead of changing the direction on the transceiver. This avoids the needs to start a O/A renegotiation cycle for these operations. The media direction will be changed only for p2p lastn=0 case since video needs to be disabled on both the sender and the peer for p2p lastn=0 case.
* Address review comments
* Disable media after adding source while media is suspended on the jvb connection. Default 'active' state for stream encodings after the source is added is 'true'.
* Wait for all the promises to be settled before returning
fix(SignalingLayer) Update SSRC owners on leave. (#2184)
* fix(SignalingLayer) Update SSRC owners on leave.
Update the SSRC owners in the following cases:
1. When a remote endpoint leaves the call.
2. When a source-remove is received.
3. When a source is remapped (with ssrc-rewriting enabled).
Create the remote track even if presence is not yet received. The ssrc owner check prevents the client from creating a dummy track when the call switches over from p2p to jvb when the last remote endpoint leaves the call.
* ref(SignalingLayer) alpha sort methods.
Clean up unused methods, _findEndpointSourceInfoForMediaType is not used anymore.
* squash: Address review comments.
fix(quality-control) Fix receiver constraints for default case.
When the application doesn't set receiver constraints, generate default constraints in the source-name mode.
Cleanup code related to the endpoint based video constraint handling for p2p connection.
fix(p2p) Fix an issue where unmute fails on p2p with channelLastN=0.
Always initiate a sRD->cA->sLD cycle since renegotiation fails in the following scenario.
In a p2p call when channelLastN=0, the direction on the video tranceiver is set to'inactive'.
At this point, if the user unmutes, the track is replaced on the video sender.
If a cO->sLD->sRD is triggered, the browser adds a third m-line which isn't expected and possibly is a bug. All renegotiations fail as a result.
However, the browser does not add a third m-line in the answer it generates and renegotiation succeeds.
* ref: Inline onMucMemberLeft (has nothing to do with "moderator" and is broken).
* fix: Use isFocus instead of just reading the resource.
* ref: Inline onParticipantLeft.
* ref: Add _ to private function names.
* ref: Remove redundant function.
* ref: Initialize focusComponent once.
* ref: Remove two copies of "options".
* ref: Simplify the focusJid flow.
* ref: Rename focusCompoonent to targetJid.
* fix: Only retry on "invalid session" errors
We used to fire FOCUS_DISCONNECTED (which doesn't have anything to do
with anything disconnecting) and then retrying. This is not necessary
because FOCUS_DISCONNECTED is a fatal error and the client schedules
a reload of it's own (and we want the client reload as opposed to the
conference-request retry in case e.g. the shard has changed).
* ref: Remove use of visitorFocus.
* ref: Remove graceful shutdown handling (never used in backend).
* feat: Support conference request over HTTP.
* ref: eslint cleanup.
* fix: Add max timeout 2 minutes.
1. Checks peer's preferred codec in p2p case. Mobile and web have different preferred codecs.
2. Log an error message when the preferred codec is not offered by JVB.
3. Clean up code related to deprecated config.js settings 'preferH264' and 'disableH264'.
4. Refactor the codec selection logic so that correct codec is picked.
Remove support for legacy endpoint based signaling. (#2147)
* Remove support for legacy endpoint based signaling and make source-name signaling as the only signaling mode. The legacy screensharing mode will no longer be supported. The client will still be able to process remote presence sent in the old format to support interop with very old mobile clients and jigasi that do not support source-name signaling.
* remove code related to presenter mode.
Instead of Jicofo signaling all the remote sources available in the call, the bridge now signals only a limited set of SSRCs and then rewrites the SSRC on the outgoing media streams. The SSRC mapping is done based on the sources requested by the clients through the receiver constraints. This limits the number of m-lines in the remote/local SDPs on the client and therefore results in better performance in large calls.
* Handle source remapping messages from bridge
* Added track_owner_changed events
* don't process an invalid rtx ssrc.
* keep track of remote ssrcs, only renegotiate on new ones.
* Change source name on remote track on ssrc remapping.
* Don't remove tracks on member leave.
* Remove (orphaned) tracks on session terminated.
* Use serial number (per media type) to create msid attribute.
* Update videoType on remapping.
Co-authored-by: James A <jqdrqgnq@users.noreply.github.com>
Fix codec negotiation and other multi-stream issues (#2133)
* fix(codec-selection) Munge all related m-lines for multi-stream.
Munge all the video m-lines to apply the preferred codec settings in multi-stream mode.
* fix(TPC) Cache transceiver mids for all local video tracks.
There will be multiple video tracks in multi-stream, we need to cache the mids for all the the associated transceivers.
* fix(sender-constraints) Do not apply sender constraints if value hasn't changed for a given source.
* fix(TPC) Configure the direction correctly for all m-lines.
Ignore negotiationneeded events for p2p to avoid going into a renegotiation loop.
* squash: Address review comments.