Commit Graph

881 Commits

Author SHA1 Message Date
He Chen 77595d387a TEL-336: fix sip error categorization (#4528) 2026-05-18 15:44:44 -07:00
cnderrauber f303f499ef Always enable rtx codec (#4533)
Sfu will fallback to retransmit packet by media stream ssrc if rtx
is not negotiated (client doesn't have), so we should not disable
rtx explicitly (by codec config).

Fix #4519
2026-05-18 15:51:10 +08:00
cnderrauber 89faaeba82 Apply ttl check only when authenticate allocation creating (#4526)
* Apply ttl check only when authenticate allocation creating

TTL check could reject allocation/persmission refresh in
security enhancement #4505, cause long-live session disconnect
when turn credential is expired.
Only check ttl on allocation creating to prevent abusing leaked
credential but keep long-live session work.
2026-05-15 14:55:05 +08:00
Denys Smirnov 8b79ec9e47 Support SIP auth realm for inbound. (#4522) 2026-05-14 10:45:16 +02:00
networkException d123675008 feat: auto create rooms for tokens with the RoomCreate grant (#4320)
This patch updates the check for auto creating rooms to also
consider the RoomCreate grant per token instead of just the
global config option.

With this patch, applications can decide on their own whether
users or which users can auto create rooms. This allows
applications that rely on auto creation (saving an API call)
to co-exist with those who might want to mint tokens for
subscribe-only users.

Specifically LaSuite Meet relies on the auto create behavior,
however enabling the global config option would make a
MatrixRTC deployment vulnerable to abuse, as users on remote
homeservers get tokens in order to subscribe.
2026-05-13 11:25:08 +05:30
Théo Monnom 7a3e595bde apply room tags from JWT grant room configuration (#4518) 2026-05-12 21:21:42 -07:00
Raja Subramanian cf20c9cd05 Add expiry to TURN password. (#4515)
* Add expiry to TURN password.

Defaults to 5m. For backwards compatibility expiry = 0 skips adding it.

* fix variable shadowing
2026-05-09 12:15:01 +05:30
Paul Wells 12fff29a12 allow setting agent job assignment url (#4512) 2026-05-07 13:13:21 -07:00
Paul Wells 8fbc5adfce update protocol for protojson (#4510) 2026-05-07 00:55:00 -07:00
Raja Subramanian 3de6f517e5 Add TURN permission handler. (#4505)
* Add TURN permission handler.

- Turn off permissions to private/link local/multicast and internal IPs
- Add a list of CIDRs that can be used for more things to deny
  permission to.

* unused

* add config for allowing private IPs, used in testing

* add a TTL to user name and use it to auth

* allow list for restricted peer CIDRs
2026-05-06 23:43:11 +05:30
Denys Smirnov 8ffcef93b2 Update protocol to support SIP media config. (#4509) 2026-05-06 18:18:21 +02:00
Raja Subramanian c4fd71a5dd Fix sense check in DeltaInfo gathering (#4507) 2026-05-06 13:34:26 +05:30
Paul Wells 803999efad rename agent environment to deployment (#4506)
* rename agent environment to deployment

* deps
2026-05-05 14:19:40 -07:00
Paul Wells bacc21e6c0 add helper to check for agent worker endpoint (#4503) 2026-05-05 13:38:53 -07:00
Paul Wells 253f977d32 add duration seconds reporting (#4500)
* add duration seconds reporting

* deps

* deps
2026-05-02 06:19:23 -07:00
Paul Wells ffab3bd308 add agent environment (#4498)
* add agent environment

* lint

* psrpc error

* deps
2026-05-01 19:30:06 -07:00
Théo Monnom af1dcc8843 Add CloseWithReason to agent SignalConn interface (#4492) 2026-04-28 22:14:06 -07:00
David Chen 743d9c8b3a add support for client capabilities (#4461)
* update protocol version

* only check for client capabiltiy to strip packet trailer
2026-04-27 17:58:36 -07:00
Fabian Stehle f3b80b2886 fix: wrap IPv6 addresses in brackets in UDP TURN URLs (RFC 3986) (#4476)
`iceServersForParticipant` builds UDP TURN URLs by interpolating the
node IP directly into a format string:

    fmt.Sprintf("turn:%s:%d?transport=udp", ip, port)

When `NodeIP.V6` is set, `ToStringSlice()` includes the bare IPv6
address, producing URLs like:

    turn:2a05:d014:ee4:1201:7039:38c:f652:a252:443?transport=udp

RFC 3986 §3.2.2 requires IPv6 addresses in URIs to be enclosed in
square brackets. Without them the port is ambiguous and WebRTC clients
(e.g. libdatachannel) reject the URL with "Invalid ICE server port".

Use `net.JoinHostPort` which handles bracketing for IPv6 and is a
no-op for IPv4, producing well-formed URLs:

    turn:[2a05:d014:ee4:1201:7039:38c:f652:a252]:443?transport=udp
    turn:1.2.3.4:443?transport=udp
2026-04-24 14:28:25 +05:30
Anunay Maheshwari 1d804737f9 fix: limit join request and WHIP request body to http.DefaultMaxHeaderBytes (#4450)
* fix: CS-1665

* cleanup

* cleanup and testes

* updates
2026-04-16 01:12:33 +05:30
cnderrauber ce1bf47b5c Revert "fix: ensure num_participants is accurate in webhook events (#4265) (#…" (#4448)
This reverts commit cdb0769c38.
2026-04-13 22:21:22 +08:00
Onyeka Obi cdb0769c38 fix: ensure num_participants is accurate in webhook events (#4265) (#4422)
* fix: ensure num_participants is accurate in webhook events (#4265)

  Three fixes for stale/incorrect num_participants in webhook payloads:

  1. Move participant map insertion before MarkDirty in join path so
     updateProto() counts the new participant.
  2. Use fresh room.ToProto() for participant_joined webhook instead of
     a stale snapshot captured at session start.
  3. Remove direct NumParticipants-- in leave path (inconsistent with
     updateProto's IsDependent check), force immediate proto update,
     and wait for completion before triggering onClose callbacks.

* fix: use ToProtoConsistent for webhook events instead of forcing immediate updates
2026-04-13 09:26:14 +08:00
Raja Subramanian c91e79af35 Switch to stdlib maps, slices (#4445)
* Switch to stdlib maps, slices

* slices
2026-04-13 00:11:48 +05:30
David Zhao 4b3856125c chore: pin GH commits and switch to golangci-lint (#4444)
* chore: pin GH commits

* switch to golangci-lint-action

* fix lint issues
2026-04-11 13:04:22 -07:00
Paul Wells 88c77dc666 compute agent dispatch affinity from target load (#4442)
* compute agent dispatch affinity from target load

* fix test config
2026-04-09 13:49:43 -07:00
Raja Subramanian 8fe9937770 Log join duration. (#4433)
* Log join duration.

Also revert the "unresolved" init. Defeated the purpose of log resolver
as it was resolving with those values even if not forced. Instead set it
to "unresolved" if not set when forced.

Join duration is not reset if resolver is reset as that happens on
moving a participant and there is no new join duration in that case.

* explode
2026-04-05 14:01:43 +05:30
Raja Subramanian 050909e627 Enable data tracks by default. (#4429) 2026-04-04 00:54:48 +05:30
David Zhao 72c7e65c25 chore: log API key during worker registration (#4428) 2026-04-03 09:48:42 -07:00
Raja Subramanian 8a67dd1b9f Do not close publisher peer connection to aid migration. (#4427) 2026-04-03 21:50:59 +05:30
Raja Subramanian 91e90c1020 Add some more logging around migration. (#4426)
Some e2e is failing due to subscriptions happening late and the expected
order of m-lines is different. Not a hard failure, but logging more to
make seeing this easie.
2026-04-03 13:07:32 +05:30
Raja Subramanian 7d06cfca8b Keep subscription synchronous when publisher is expected to resume. (#4424)
Subscription can switch between remote track and local track or
vice-versa. When that happens, closing the subscribed track of one or
the other asynchronously means the re-subscribe could race with
subscribed track closing.

Keeping the case of `isExpectedToResume` sync to prevent the race.

Would be good to support multiple subscribed tracks per subscription.
So, when subscribed track closes, subscription manager can check and
close the correct subscribed track. But, it gets complex to clearly
determine if a subccription is pending or not and other events. So,
keeping it sync.
2026-04-02 19:54:14 +05:30
Omar Pakker e9b113c8f2 Make the TURN bind address configurable and allow for multiple addresses. (#4315) 2026-03-30 14:46:10 +08:00
Anunay Maheshwari ff7fd7ed56 feat(agent-dispatch): add job restart policy (#4401)
* feat(agent-dispatch): add job restart policy

* deps
2026-03-27 21:32:04 +05:30
Raja Subramanian 9055a34981 Path check helpers (#4392)
* Path check helpers

* remove trailing slash
2026-03-25 10:53:07 +05:30
cnderrauber 1f1eeb6832 Fallback to servicestore if rpc is unavailable (#4391)
* Fallback to servicestore if rpc is unavailable

compatibility mode for #4387

* conf
2026-03-25 11:09:52 +08:00
Raja Subramanian 59e9bb41b9 Fix TURN server URL (#4389)
Addresses https://github.com/livekit/livekit/issues/4384
2026-03-24 15:52:05 +05:30
cnderrauber 9474c807c0 route participant reads through PSRPC instead of Redis (#4387)
rel: #4373
2026-03-24 16:25:11 +08:00
Charlie Tonneslan 8cdd6f4cc7 Replace deprecated io/ioutil with io in whipservice (#4375)
ioutil.ReadAll has been deprecated since Go 1.16 in favor of io.ReadAll.
This was the last remaining io/ioutil usage in the codebase.
2026-03-21 10:01:30 -07:00
Paul Wells c8bb2578be Rename log field "pID" to "participantID" for consistency (#4365)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 04:32:02 -07:00
cnderrauber e963953817 Refine ipv6 support (#4352)
* Refine ipv6 support

* go mod

* check ipv4 is set in turn
2026-03-09 20:43:00 +08:00
Milos Pesic b34b047247 Add StopEgress function to the EgressLauncher interface (#4353)
This allows for abstracting away how the stop is implemented - default implementation stays the same - the existing OSS egress launcher just calls the existing Stop method on the client.
2026-03-09 13:17:05 +01:00
He Chen cb7dc2d02a TEL-405: support originating calls from custom domains (#4349) 2026-03-06 12:25:40 -08:00
Denys Smirnov 493e87dfd4 Fix SIP client timeout. (#4345) 2026-03-05 19:09:17 +02:00
Raja Subramanian b81bac0ec3 Key telemetry stats worker using combination of roomID, participantID (#4323)
Test / test (push) Failing after 17s
Release to Docker / docker (push) Failing after 3m42s
* Key telemetry stats work using combination of roomID, participantID

With forwarded participant, the same participantID can existing in two
rooms.

NOTE: This does not yet allow a participant session to report its
events/track stats into multiple rooms. That would require regitering
multiple listeners (from rooms a participant is forwarded to).

* missed file

* data channel stats

* PR comments + pass in room name so that telemetry events have proper room name also
2026-02-16 13:56:13 +05:30
Benjamin Pracht 03e90dd762 Fix for some CodeQL reported issues (#4314)
One of the fix is in updated protocol (logging of a request message that includes the turn server settings, including password).
2026-02-11 10:15:12 -08:00
Jacob Gelman a6035212f5 ESP32 client info (#4267) 2026-02-11 16:25:02 +11:00
cnderrauber 8ae564065e generate & log egressID for start egress request (#4303)
* generate & log egressID for start egress request

* seprate method

* use ctx value instead of metadata

* comment
2026-02-10 09:34:56 +08:00
Raja Subramanian 52a4b848a4 Read client protocol from query param (#4294)
* Read client protocol from query param

* Atoi -> ParseInt
2026-02-06 11:33:13 +05:30
Nishad 343f12b88f Wrapping SIP errors for invalid argument and not found (#4253) 2026-01-16 12:38:44 -08:00
Raja Subramanian a35a6ae751 Add participant option for data track auto-subscribe. (#4240)
* Add participant option for data track auto-subscribe.

Default disabled.

* protocol update to use data track auto subscribe setting

* deps
2026-01-14 13:22:43 +05:30