Uses optional statsId to report to callstats and push it to presence. (#608)
* Uses optional statsId to report to callstats and push it to presence.
The feature is behind a flag which is disabled by default.
* Renames statsId to statsID.
* Fixes doc.
ESLint 4.8.0 discovers a lot of error related to formatting. While I
tried to fix as many of them as possible, a portion of them actually go
against our coding style. In such a case, I've disabled the indent rule
which effectively leaves it as it was before ESLint 4.8.0.
Because the implementation of LocalStorage in jitsi-meet at the time
of this writing is asynchronous with respect to loading and saving,
delay the generation of machineId in order to allow LocalStorage to
load any previously saved value.
fix(moderator): clears session ID on 'non-acceptable'
Currently Jicofo does not include 'session-invalid' tag when there is
"machine ID" and "session ID" mismatch, but in such case the session-id
must be cleared as well. Otherwise we'll end up in an endless loop.
With JitsiAuthConnection the API consumer has to:
1. JitsiConference.createAuthenticationConnection,
2. JitsiAuthConnecition.authenticateAndUpgradeRole,
3. Wait on the Promise of 2,
4. Maybe cancel the JitsiAuthConnection of 1.
With authenticateAndUpgradeRole the API consumer has to:
1. JitsiConference.authenticateAndUpgradeRole,
2. Wait on the thenableWithCancel of 1.
3. Maybe cancel the thenableWithCancel of 1.
ref(JitsiLocalTrack): get rid of 'setMutedInProgress'
The 'setMutedInProgress' flag is unreliable and it can lead to weird
situations when mute operation is in progress, but the removal from
JingleSessionPC is waiting on the queue. In such case LocalSdpMunger
will fake SDP even if the track is in the PeerConnection which may
confuse some parts of the SDP transformation chain.
For example RtxModifier will not attempt to inject Rtx group description
if it sees that the SSRC are already there. But it can happen that even
though the SSRCs are there they do not contain valid track ID, because
the track has changed.
The LocalSdpMunger is supposed to fake the SDP only when the video
MediaStream is not in the PeerConnection. So this commit implements just
that: a way to tell if JitsiLocalTrack's stream is currently in
the PeerConnection (added through TraceablePeerConnection).
In case when the answer is being set for the first time, full sRD/sLD
cycle is required to have the local description updated and SSRCs
synchronized correctly. Otherwise SSRCs for streams added after invite,
but before the answer was accepted will not be detected. The reason for
that is that renegotiate can not be called when adding tracks and they
will not be reflected in the local SDP.
The 'ondatachannel' even listener must be set as soon as
the TraceablePeerConnection is created and before the offer is accepted.
We've observed situations where the ondatachannel event was missed,
because the listener is bound too late from the JingleSessionPC
'acceptOffer' success callback.
* add support for signaling simulcast for unified plan
1) munge the incoming offer to advertise support for receiving simulcast in unified plan
2) add 3 simulcast encodings via rtp sender
3) inject an ssrc-group line, even when using rids for simulcast (jicofo will rely on this)
* add rid information to the session-accept jingle
* address lenny's feedback
* make firefox simulcast configurable
* fix missing comma
fix(JingleSessionPC): avoid failures if replaceTrack runs late
Due to it being ran asyncronously, it's possible a replaceTrack operation is
scheduled while there is a valid PC, but by the time it runs was closed.
Accommodate to this situation by pretending everything is just peachy.
* ref: Moves the deployment info variables to config.js
instead of using globals.
* feat: If configured, adds the user's region to presence.
* fix: Guards against accessing undefined properties,
and uses the crossRegion variable from the config.
* style: Fixes formatting.
* ref(JSPC): simplify SSRC owner in P2P
There's no need for any extra extensions for SSRCs owner signalling in
P2P, because it's always the remote peer who owns them.
This also fixes a problem where no SSRC owner was added for 'source-add'
in P2P (for JVB conference Jicofo adds that).
* fix(TPC): always advertise 'sendrecv'
Our media direction is only ever updated on the remote side with
the initial offer (or answer). Because of that we want to advertise
'sendrecv' even if we start with no video (or audio) track.
It is OK to adjust this direction in the localDescription getter,
because it's adjusted again in the setter to the correct value based on
local tracks, so the SDP transformation chain still works fine.
Will actively terminate P2P session by the responder (not moderator) in
order to shutdown P2P in case of eventual initiator's crash. Otherwise
the responder will stay in P2P for too long (until P2P ICE fails).
Prevents from printing Jingle 'session-terminate' error response in case
both responder and initiator terminates their sessions simultaneously
(gracefully). In that case 'item-not-found' error is returned by each
party, because the session is removed immediately from the memory on
termination (see strophe.jingle.js).
fix(JitsiConference): case for stopping JVB transfer
If for any reason invite for the JVB JingleSession is delayed and
arrives after the P2P connection has been established then
the media transfer needs to be disabled after the offer is accepted.
fix(JingleSessionPC): execute 'invite' on the queue
Invite must be executed on the queue to avoid strange things happening
on the beginning of the call. For example when the local tracks are
added just after the invite was called.
Move the JingleSessionPC to ACTIVE state, as soon as the first
_renegotiate is executed in PENDING state.
* feat(JSPC): ICE establishment time
Will report total ICE establishment time under
'ice.initiator.establishmentDuration' and
'ice.responder.establishmentDuration' ('p2p.' prefix added for P2P).
It's the amount of time between the time when either checking or
gathering started (whichever starts first) and when ICE entered
'connected' for the first time.
* fix(JSPC): simplify and rename event