Commit Graph

282 Commits

Author SHA1 Message Date
Raja Subramanian
28c39efa06 Exempt egress participant from track permissions. (#3322)
* Exempt egress participant from track permissions.

* test
2025-01-11 12:50:34 +05:30
cnderrauber
54f9f7de51 upgrade to pion/webrtc v4 (#3213) 2024-11-28 16:05:38 +08:00
Raja Subramanian
23285744ba Server side metrics (#3198)
* mbb WIP

* deps

* WIP

* WIP

* remove unused file

* Switch to enabled

* misc

* deps

* mediatransportutil update

* Typo

* Set ParticipantIdentity in metrics data packets

* use uint32 as JSON decoder does not unmarshal time.Duration
2024-11-25 13:10:48 +05:30
Raja Subramanian
3498e53650 Participant method to check a track by name is subscribed. (#3192)
* Set down track connected flag in one-shot-signalling mode.

Also, added maintaing ICE candidates for info purposes.
And doing analytics events (have to maintain the subscription inside
subscriptionmanager to get list of subscribed tracks, so added enough
bits from the async path into sync path to get the analytics bits also)

* comment typo

* method to check if a track name is subscribed
2024-11-22 07:43:38 +05:30
Raja Subramanian
9f25603213 One shot signalling mode (#3188)
* WIP

* comment

* Verify method on LocalParticipant

* cleanup

* clean up

* pass in one-shot-mode to StartSession

* null message source and sink

* feedback and also remove check in ParticipantImpl for one-shot-mode-filtering as a null sink can be used for that
2024-11-21 09:33:28 +05:30
Raja Subramanian
487a3fc3fb ICE candidate marking (#3128)
- Update filtered if dropping a pending candidate later.
- Ordinal for selected pair so it is easy to see which got selected
  later.
2024-10-22 20:23:55 +05:30
Denys Smirnov
af15f211d0 Forward new disconnect reasons for SIP. (#3056) 2024-10-03 16:36:47 +03:00
Paul Wells
d26ade0076 add helpers for partiicpant reconnect and version (#3034) 2024-09-22 23:37:35 -07:00
Paul Wells
61179d5624 simplify agent registration (#3018)
* simplify agent registration

* testutils

* deps

* fix

* gen

* cleanup

* lower job load
2024-09-19 05:58:30 -07:00
Paul Wells
370f386dd0 add convenience methods to participant (#3016)
* add convenience methods to participant

* tidy
2024-09-19 00:20:22 -07:00
Raja Subramanian
7df6f86693 Initial plumbing for metrics. (#2950)
* Initial plumbing for metrics.

This implements
- metrics received from participant.
- callback to room.
- room distributes it to all other participants (excluding the sending
  participant).
- other participants forward to client.
- counting metrics bytes in data channel stats

TODO:
  - recording/processing/batching
  - should recording/processing/batching happen on publisher side or
    subscriber side?
  - should metrics be echoed back to publisher?
  - grants to publish/subscribe metrics.

* mage generate

* clear OnMetrics on close

* - CanSubscribeMetrics permission.
- Echo back to sender.

* update deps

* No destination identities for metrics

* WIP

* use normalized timestamp for server injected timestamps

* compile

* debug log metrics batch

* correct comment

* add baseTime to wire

* protocol dep

* Scope metrics forwarding to only participants that a participant is
subscribed to.

Also remove the participant_metrics.go file as it was not doing anything
useful.

* update comment

* utils.ErrorIsOneOf

* couple of more utils.CloneProto
2024-09-19 11:42:31 +05:30
Raja Subramanian
1b5bb4dddc Log ICE reconnected. (#2999)
To increase visibility of ICE reconnect, logging reconnected at Infow
level. Otherwise, it is hard to see if an ICE restart finished
successfully.

Also, cleaning up ICEConnectionDetails a bit. Just separate out
read-only fields into its own struct and use it for read-only export.
2024-09-12 13:16:41 +05:30
cnderrauber
16896e4d66 Add FastPublish in JoinResponse (#2964)
Set FastPublish in JoinResponse for participant can publish
and no ice fallback setting.
2024-08-28 12:00:28 +08:00
Raja Subramanian
e9f26c21e7 Panic fix for nil candidate check. (#2957) 2024-08-25 10:12:32 +05:30
Raja Subramanian
56e67c9d25 Properly exclude mDNS when not trickling also. (#2956) 2024-08-24 23:23:23 +05:30
cnderrauber
947e8f5909 Speed up track publication (#2952)
* speed up track publication

Add metrics for track publication and subscription

Return EnabledCodecs in JoinResponse so client can
choose codec without server side codec fallback

Cache remote webrtc track without AddTrackRequest to
let client send publisher offer before AddTrackRequest response

* go mod

* clean code
2024-08-23 18:38:32 +08:00
Raja Subramanian
9a6b4c6956 Send signal response for non-error cases also. (#2926)
* Send signal response for non-error cases also.

Gated by protocol version 15 or higher for sending OK response.

* explicit reason init
2024-08-12 22:25:34 +05:30
cnderrauber
a8730b04b8 move TrackSubscribed trigger to MediaSubscription (#2916) 2024-08-07 22:30:52 +08:00
Raja Subramanian
13ee1aca28 Delay getting forwarder state till migration is complete. (#2909) 2024-08-06 12:45:46 +05:30
Raja Subramanian
8c323330b6 Store subscriber forwarder state (#2907)
* Forwarder state for migrating participant.

* clean up

* update protocol deps

* cleanup debug
2024-08-05 21:13:07 +05:30
David Zhao
b1fbca066f Send the correct room closed reason to clients (#2901)
* Send the correct room closed reason to clients

* update go mod
2024-08-01 19:40:06 -07:00
Raja Subramanian
f7695cf9f4 Move track update methods to LocalParticipant. (#2868) 2024-07-16 08:09:46 +05:30
Raja Subramanian
faa66d1138 Make sender report pass through an option. (#2861)
Enabled by default.

Also, tweak the long term propagation delay a bit. The first propagation
delay itself was too high and the long term initialized with a high
value. Prevent that and also ensure large negtaives do not have an
effect by using a lower bound of 0. Lower bound of 0 is okay as the main
purpose is to track sustained high positive values.
2024-07-15 11:27:31 +05:30
Raja Subramanian
09e3aef859 Check size limits on metadata and name set from client. (#2850)
* Send error response when update metadata fails.

Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT

* Check size limits on metadata and name set from client.

Added a name length limit also.

* check name length in service update participant path also

* limit check in limit config

* update protocol

* longer keys
2024-07-12 09:57:17 +05:30
Raja Subramanian
b8847cd8e9 Send error response when update metadata fails. (#2849)
Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT
2024-07-10 23:26:44 +05:30
cnderrauber
7a5c90dc01 log non-trickle candidate in details (#2832)
* log non-trickle candidate in details

* fix test
2024-07-03 14:16:58 +08:00
Paul Wells
e511464d3d add handler interface to receive agent worker updates (#2830)
* add handler interface to receive agent worker updates

* cleanup
2024-07-02 13:11:08 -07:00
David Zhao
7a774cc82a Support for participant attributes (#2806)
* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
2024-06-19 23:14:19 -07:00
Raja Subramanian
ef838e4fa2 Indicate if track is expectd to be resumed in onClose callback. (#2800)
That is the main change. Changed variable name to `isExpectedToResume`
everywhere to be consistent.

Planning to use the callback value in relays to determine if the down
track should be closed or switched to a different up track.
2024-06-17 23:51:00 +05:30
Raja Subramanian
d9910ead61 Add back TrafficStats used by cloud. (#2736) 2024-05-27 13:43:20 +05:30
Raja Subramanian
991ad5a0ea Remove unused traffic load (#2734) 2024-05-27 10:53:23 +05:30
Raja Subramanian
80a4d021b9 Add simulate leave request close reason (#2713) 2024-05-10 20:02:25 +05:30
cnderrauber
cfa82c6ad4 increase protocol version to support optional publisher datachannel (#2693) 2024-04-28 15:09:24 +08:00
Raja Subramanian
79f6506553 Clean up UpdateVideoLayers (#2685) 2024-04-26 12:21:40 +05:30
Raja Subramanian
90b47424b5 Handle UpdateLocalAudioTrack and UpdateLocalVideoTrack. (#2684)
* Handle UpdateLocalAudioTrack and UpdateLocalVideoTrack.

- Update the TrackInfo
- NOTE: populating Stereo and DisableDtx fields although there are
  features now.
- The audio features in UpdateLocalAudioTrack is applied as is,
  i. e. the update has the latest set of features.
- Emits a track update which will broadcast a participant update.

TODO:
-----
- Telemetry event with track update?

* update deps
2024-04-26 12:06:35 +05:30
Paul Wells
7d5c991d8d add disconnected chan to participant (#2650) 2024-04-14 12:49:13 -07:00
David Colburn
990cf6877b backwards compatability for IsRecorder (#2647)
* backwards compatability for IsRecorder

* regenerate fakes
2024-04-11 11:14:15 -07:00
David Colburn
fff937a89c participant kinds (#2626) 2024-04-05 12:59:06 -07:00
Théo Monnom
dc67f505a5 agent service: new protocol & namespaces (#2545)
* initial worker impl

* fix test

* fix build

* TestAgentNamespaces

* log err

* nit cmt

* TestAgentMultiNode

* Update pkg/agent/worker.go

Co-authored-by: David Zhao <dz@livekit.io>

* retry on worker selection & fix review comments

* Update roommanager.go

* license

* use testutils.WIthTimeout

* abstract namespace/enabled logic into agent.Client, incrementally dispatch

* typos and dates

* lock

* timeout is now optional

* pass in topics instead of fixed

* handler handles connections

* onIdle, numConnections

* fix WithGrants

* update protocol

* check agent client

* broadcast after unlock

* fix data race

* remove ReadChan, fix dispatcher

---------

Co-authored-by: David Zhao <dz@livekit.io>
Co-authored-by: David Colburn <xero73@gmail.com>
2024-04-03 15:25:42 -07:00
Denys Smirnov
1d920ae488 Support SIP DTMF data messages. (#2559) 2024-03-14 17:23:43 +02:00
Raja Subramanian
324c5f35cb handle nil resolver. (#2556) 2024-03-08 19:06:28 +05:30
Raja Subramanian
6c94185aa6 Bring back soft close. (#2553)
Remote media track needs it.
2024-03-07 12:52:48 +05:30
Raja Subramanian
108594a0b9 Notify migration on migration out node. (#2543)
It is possible that migration could trigger without migrating out node
knowing about it. So, when a migration started notification comes in,
set up migration timer if not already set.
2024-03-04 19:43:54 +05:30
cnderrauber
b58307f144 Support XR request/response for rtt calculation (#2536)
* Support XR request/response for rtt calculation

* Update pkg/sfu/downtrack.go

Co-authored-by: David Zhao <dz@livekit.io>

---------

Co-authored-by: David Zhao <dz@livekit.io>
2024-03-03 12:34:49 +08:00
Raja Subramanian
22474e0f5d Remove unused interface method (#2513)
* Remove unused interface method

* cleanup
2024-02-26 20:55:41 +05:30
Raja Subramanian
6696c1e63d Close published track always. (#2508)
Simplify and close published track always. Avoid the round about path of
unbind to close.
2024-02-25 13:46:55 +05:30
Raja Subramanian
f95194c833 Fixes to sync state disabled tracks. (#2459)
* Fixes to sync state disabled tracks.

* test
2024-02-07 13:52:57 +05:30
Raja Subramanian
c8b7d486b9 Do not synthesise DISCONNECT on session change. (#2412)
* Do not synthesise DISCONNECT on session change.

v12 clients can handle session change based on identity.

* change for testf

* Squelch participant update if close reason is DUPLICATE_IDENTITY.

* fix test

* comment

* Clean up participant close reason a bit

* fix test

* test
2024-01-31 11:36:50 +05:30
Raja Subramanian
d53f167b31 LeaveRequest changes. (#2426)
Reworking this a bit
1. Send leave whenever the signal channel is closed to induce a resume.
2. Use a getter to get regions rather than setting.
2024-01-29 13:04:18 +05:30
Raja Subramanian
bcf9fe3f0f Use a participant worker queue in room. (#2420)
* Use a participant worker queue in room.

Removes selectively needing to call things in goroutine from
participant.

Also, a bit of drive-by clean up.

* spelling

* prevent race

* don't need to remove in goroutine as it is already running in the worker

* worker will get cleaned up in state change callback

* create participant worker only if not created already

* ref count participant worker

* maintain participant list

* clean up oldState
2024-01-28 22:10:35 +05:30