Commit Graph

732 Commits

Author SHA1 Message Date
Raja Subramanian b760918a0d Use logger from request context. (#3623)
That will have projectID and can potentially be used for project level
logging if we are able to pass around the project logger more.
2025-04-24 11:34:16 +05:30
Andrea Lovicu 4955ebe423 Forward transfer headers to internal request (#3615)
This patch ensures that SIP headers provided in TransferSIPParticipantRequest requested by an agent are correctly forwarded to the internal SIP transfer request.

Previously, req.Headers was accepted but never passed along, causing headers from the initiating agent to be dropped.

This change adds a single line to include req.Headers in the internal request.
2025-04-22 11:43:23 -07:00
Benjamin Pracht e5cbb22777 Allow specifying extra webhooks with egress requests (#3597) 2025-04-09 16:20:21 -07:00
cnderrauber 5c2d96b9d3 Check DestinationRoom of VideoGrant for participant forwarding (#3599) 2025-04-09 15:13:29 +08:00
Denys Smirnov ec2dff96a3 Fix SIP updates when replacing slices. (#3592) 2025-04-08 17:39:16 +03:00
Raja Subramanian d08487bf83 Unlabeled (pass through) data channels. (#3567)
* Unlabeled (pass through) data channels.

Support data channels than can pass through raw data without any LK
protocol marshaling/unmarshaling.

* statischeck

* test

* error -> warn

* reset data message callback
2025-04-01 21:59:31 +05:30
Anunay Maheshwari 52ce18d56e fix: revert recent changes to determine simulcast from sdp (#3565)
* Revert "Audio uses signal SignalCid and SdpCid. (#3564)"

This reverts commit cdfbb106d1.

* Revert "Keep simulcast information tied to receiver. (#3563)"

This reverts commit ed5e2f16b2.

* Revert "chore(logs): log VLS type for VP9/AV1 (#3561)"

This reverts commit ad010cfc43.

* Revert "fix(video): determine svc/simulcast from SDP for advanced codecs (#3549)"

This reverts commit 15f565510c.

* chore(deps): update protocol
2025-03-31 23:15:44 +05:30
Raja Subramanian 8cc17f8f8b Rework node stats a bit. (#3555)
* Rework node stats a bit.

Related protocol PR - https://github.com/livekit/protocol/pull/1023

- Make a config for node stats measurements. Wanted to put the config in
  `routing` package, but a circular dependency forced me to put in
   config.go
- Make rate calculations explicit, i. e. requested via config.
  Previously, it had some odd checks to decide when to calculate rate
  and it would have been calculating over different windows.
- Report signal/data channel bytes every 5 seconds to stats collection
  module. Previously, it was doing it every 30 seconds and that meant
  some windows could have had a large spike
  NOTE: Still need to think about this for load calculations as a large
  number of participants leaving could flush in a small window and that
  could report a large spike in bytes/packets. Maybe need to ignore
  signal bytes for load calculation?

* deps

* use default node stats config if given config is nil

* split out node stats into a struct for re-use

* update config
2025-03-27 12:42:19 +05:30
Anunay Maheshwari 15f565510c fix(video): determine svc/simulcast from SDP for advanced codecs (#3549)
* fix(video): determine svc/simulcast from SDP for advanced codecs

* fix(explicit-svc): cleanup

* fix(explicit-svc): remove from list on close/remove

* fix(explicit-svc): reorder VLS selection, cleanup

* fix(explicit-svc): todo comments for temporal layer selector

* fix(explicit-svc): remove from simulcastTrackIds even if client does not support unpublish
2025-03-26 16:22:32 +05:30
cnderrauber 2b6a46f402 Handle prefer_regression for backup codec (#3554) 2025-03-26 16:27:50 +08:00
Raja Subramanian 26822b6b49 ParseUsername utility for TURN user name. (#3547)
* ParseUsername utility for TURN user name.

NOTE: There is no state, so no need for struct method, but just doing it
similar to CreateUsername which also does not have state, but uses
struct method.

* missed base62 decode
2025-03-22 13:16:13 +05:30
Raja Subramanian 55909ed7c4 log the initial join response (#3546) 2025-03-22 11:06:05 +05:30
Soungmin Son (Eddy) 97fcb82a77 Fix: Return NotFoundErr instead of Unavailable when the participant does not exist in UpdateParticipant. (#3543)
* Check if Participant exists when update metadata

* Change Test cases

* type smuggle oss participant check into roomstore

* tidy

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
2025-03-20 23:56:34 -07:00
Denys Smirnov 75d0e18e4a Implement SIP update API. (#3141) 2025-03-20 18:37:33 +02:00
Denys Smirnov 7f4c4597f1 Stubs for SIP update API. (#3533) 2025-03-19 14:58:40 +02:00
Paul Wells ac9e62ef05 add server agent load threshold config (#3520)
* remove agent worker load threshold

* cleanup
2025-03-11 21:07:01 -07:00
Raja Subramanian cd5d32f005 Add pID and connID to log context to make it easier to search using pID. (#3518) 2025-03-11 22:33:08 +05:30
shishirng 2d9aa6dde4 Update api call info method (#3515)
* register RequestRouted handler for updating method

Signed-off-by: shishir gowda <shishir@livekit.io>

* pass room to telemetry in DeleteRoom api to extract roomID

Signed-off-by: shishir gowda <shishir@livekit.io>

---------

Signed-off-by: shishir gowda <shishir@livekit.io>
2025-03-11 05:56:30 -04:00
Raja Subramanian b3779a9086 WebHookConfig (#3517)
* default webhook config

* WebHookConfig

* fix test

* protocol with yaml tags
2025-03-11 13:49:29 +05:30
cnderrauber 6121b9af5e Check ForwardParticipant room name (#3514) 2025-03-11 10:07:05 +08:00
cnderrauber 139d1b139c Add ForwardParticipant method to room service (#3507)
It returns unimplemented error now.
2025-03-10 14:08:38 +08:00
Denys Smirnov 47896f50e3 Update protocol and IO service. (#3499) 2025-03-08 01:19:42 +05:30
Benjamin Pracht c3e06f0523 Do not attempt to create objects for URL ingresses as the ingress service will do so (#3491) 2025-03-05 15:15:02 -08:00
Paul Wells 43bd251575 simplify vls base access (#3465) 2025-02-26 09:34:59 +05:30
Denys Smirnov 60a09cb4be Implement SIP iterators. (#3332) 2025-02-20 13:13:21 +02:00
David Zhao 1c69a9eeed Dependent participants should not trigger count towards FirstJoinedAt (#3448)
* Dependent participants should not trigger count towards FirstJoinedAt

According to the API, empty timeout should be honored as long as no
independent participant joins the room. If we counted Agents and Egress
as part of FirstJoinedAt, it would have the side effect of using
departureTimeout instead of emptyTimeout for idle calculations.

* use Room logger
2025-02-20 00:57:40 -06:00
Paul Wells f49103a003 add participant job type (#3443)
* add participant job type

* cleanup

* deps
2025-02-18 00:40:56 -08:00
Raja Subramanian 56a61b6ce2 Safe access of proto fields. (#3436) 2025-02-15 05:51:53 +05:30
Raja Subramanian dc0ff45fd7 Fix panic due to nil Egress (#3431) 2025-02-14 10:17:32 +05:30
Raja Subramanian 1c3c70a136 Check for nil in sender view stats. (#3426)
Seeing some panic due to sender view being nil. It is possible to have
nil sender view and not-nil receiver view. For analytics, only sender
view is used. Handle nil properly.
2025-02-13 10:55:23 +05:30
Raja Subramanian 1ae2e48c2e Webhook analytics event. (#3423)
* Webhook analytics event.

* deps

* generate

* nil notifier
2025-02-13 10:39:45 +05:30
Raja Subramanian 045bd785a9 Record number of elements, keys size and values sizes separately. (#3415) 2025-02-08 13:12:48 +05:30
Raja Subramanian 99afbf587b Use a Twirp server hook to send API call details to telemetry. (#3401)
* Use a Twirp server hook to send API call details to telemetry.

* mage generate and clean up

* Add project_id

* deps

* - Redact requests
- Do not store responses
- Extract top level fields room_name, room_id, participant_identity,
  participant_id, track_id as appropriate
- Store status as int

* deps
2025-02-07 16:16:41 +05:30
Denys Smirnov ccbc988824 Pass error details and timeouts. (#3402) 2025-02-06 13:53:44 +02:00
Raja Subramanian abcaa9b8ab Fix /etc/validate route (#3403) 2025-02-05 23:20:20 +05:30
Raja Subramanian bb0ee1139c Drive-by misc changes. (#3399)
While working on a different service, noticed delegation of setting up
routes to the service itself. So, making that change and making some
methods internal only as there is no need to export them outside the
service.
2025-02-04 12:32:05 +05:30
Raja Subramanian c30204d56c Fix typo in SendData nonce length check. (#3370)
Definitely need new glasses :-(
2025-01-28 09:59:48 +05:30
Raja Subramanian db75092aa6 Use nonce in data messages to de-dupe SendData API. (#3366)
* Use nonce in data messages to de-dupe SendData API.

With API retries, it is possible that some data messages are sent
multiple times. Check the nonce (if present) to de-dupe data messages
before forwarding it to the clients.

* add nonce to UserPacket

* defer unlock

* 128-bit UUID as nonce

* - UUID nonce
- make a UserPacketDeduper module for easier re-use.

* deps

* feedback
2025-01-27 15:35:37 +05:30
David Zhao 30669722c3 fix: pass RoomConfig along when creating a new dispatch rule (#3367) 2025-01-26 23:36:42 -06:00
Paul Wells ef4b5faba1 close signal session is request messages are undeliverable (#3364) 2025-01-24 00:24:22 -08:00
Raja Subramanian 524441446f Room creation time with ms resolution (#3362) 2025-01-23 09:42:30 +05:30
Paul Wells 759e5f79e0 allocate node for autocreated room in agent dispatch (#3344) 2025-01-17 00:54:30 -08:00
Rajiv Gonzalez 25fa83926f Reject ingress if Enabled flag is false (#3293) 2025-01-16 17:19:26 -08:00
Raja Subramanian ae8c8bc941 Turn off TWCC for Firefox (#3333)
* Debug FF TWCC

* - TURN off TWCC for Firefox. Seems to fail with VP9 send, i.e. there are
  no TWCC feedback packets when sending VP9.
- Relax thresholds for congestion as staging data is showing
  oscillations.
- Clean up some logging.

* debug log a few more signal messages

* revert config

* revert config

* clean up
2025-01-15 10:32:59 +05:30
Alan Willard 5b61bbc446 remove code that deletes state from the store for rooms older than 24 hours (#3320) 2025-01-10 10:09:55 +05:30
David Zhao 6acb4bbd61 add room/participant to logger context for SIP APIs (#3290) 2024-12-26 00:23:21 -06:00
Raja Subramanian 8cf6cbb826 Structured logging of ParticipantInit (#3279)
* Structured logging of ParticipantInit

* use pointer
2024-12-20 11:12:50 +05:30
cnderrauber 713e67cd52 Thottle the publisher data channel sending when subscriber is slow (#3255)
* Thottle the publisher data channel sending when subscriber is slow

Avoid the publisher overwhelm the sfu data channel buffer when
the subscriber has lower receive bitrates. It will drop message
if the subscriber is considered too slow to block the entire room.

* Enable nack in mediaengine and disable it in transceiver as need

pion doesn't support per transciver codec configuration, so the nack of this session will be disabled
forever once it is first disabled by a transceiver.
https://github.com/pion/webrtc/pull/2972
2024-12-18 10:51:34 +08:00
cnderrauber 5dd6858acf Don't wait rtp packet to fire track (#3246)
* Don't wait rtp packet to fire track

Create track from sdp instead of first rtp packet,
it is consistent with the browser behavior and
will accelerate the track publication.

* fix test
2024-12-13 15:06:14 +08:00
Denys Smirnov dc6fe3aae5 Support SIP list filters. (#3240) 2024-12-09 22:57:47 +02:00