* Let clients set a preferred ICE candidate protocol on join
The v1 JoinRequest ConnectionSettings.candidate_protocol and the v0
candidate_protocol query parameter let a client ask for TCP or TLS
from the start. The SFU applies the stronger of the client preference
and the learned room fallback, and keeps the join preference on resume.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Require the candidate protocol on every connect, check ICE/TCP
Resume uses the preference from the resume request, the same as join,
so the participant no longer stores the join value. TCP mode drops UDP
candidates, so a TCP preference applies only when ICE/TCP is enabled,
and TLS without TURN/TLS falls back to TCP only under the same check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Keep the client preference apart from the learned fallback
The room cache now holds only fallbacks the transport learned after a
failure. The participant stores the client preference from join, and
resume applies the stronger of it and the resume request before the
resume response, so the response carries the matching ForceRelay.
TLS mode lists only TLS relays, also from external TURN servers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Let a resume preference replace the join preference
A resume that sends TCP or TLS uses that value, and only a resume
without a value inherits the preference from join.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Ignore an unsupported preference on resume
A resume preference for a transport the server does not offer no
longer replaces the join preference. Each preference is lowered to a
supported transport before the resume picks between them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: handle subscribed track close after subscription installation
A close of a new SubscribedTrack during addSubscriber was lost or handled
too early. OnClose was registered before the track was stored and did not
replay an earlier close, and the publisher was marked after addSubscriber
returned. A close before the store left a closed track stored with no
resubscribe. A close after the store but before the mark left a stale
publisher mark.
SubscribedTrack now records a close and OnClose replays it. addSubscriber
marks the publisher itself and defers OnClose to its end, the same order
as the data track path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: cover a rejected install and wait for the deferred close callback
TestSubscribeRevokedInFlight now waits for the close callback that
addSubscriber installs on return before it fires a close.
TestSubscribedTrackCloseDuringInstall adds a case where the recheck
rejects the install and the removal closes the track.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Test data track closes during auto-subscription
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* Wait for the close before checking installation recovery
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* Keep the installation regression on the public regrant result
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* Deliver data track close after subscription installation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* rtc: verify the subscriber exists before the injected close
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* rtc: observe data-track permission races independently of resolver counts
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* rtc: deliver data-track close after subscription installation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* rtc: guard the data-track close test window and wait for cleanup
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* rtc: deliver data-track close after subscription installation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
---------
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
* Always use full ice for publisher offer
When warp is enabled, ice-lite could complete dtls handshake
before ice is connected when RTT is high. Because libwebrtc
may send nomination after 1s interval, and pion relies on
the nomination to transit ice state to connected while libwebrtc
only relies on a writable pair. Full ice has connectivity check
to mitigate this.
After this change, ice-lite configuration only works on
subscriber pc.
* test
* feat: add token revocation
* token revocation: match LiveKit Cloud API, make it optional
- add token_revocation config section (enabled: false by default, ttl)
- RemoveParticipant: cutoff defaults to now, revoke_token_ts must be within
60s and is stored with the validation leeway, revoke absent participants,
keep not found unless revoke_token_ts is given
- UpdateParticipant revokes older tokens on permission updates and the
participant gets a refreshed token
- share the RoomService logic with Cloud through RevokeTokenClient
- revocations merge to the later cutoff and expiry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* token revocation: clean up expired revocations lazily
Drop the cleanup goroutine of LocalStore. Revocations are kept in a queue
ordered by expiry, and expired ones are removed from its front when
revoking or checking, at most once per minute.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* token revocation: request context for redis, own lock for LocalStore
- RedisStore revocation calls use the request context
- LocalStore revocations use their own lock instead of the store lock
- remove TestRTCValidateRoomlessTokenAfterRevocation, which passes without revocation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* token revocation: length checks before auth, test all auth chains
Check lengths before the admin permission check, as LiveKit Cloud does, and
test that the API, agent endpoint and WebTransport chains reject revoked tokens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* token revocation: do not return store errors to clients
Log the error of a failed revocation lookup and respond with a fixed message,
as the store error may contain internal addresses.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: cnderrauber <zengjie9004@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: answer an ICE restart offer while ICE is gathering
A remote offer that restarts ICE was held while the peer connection was
still gathering candidates and only applied when gathering completed.
Until then no answer was sent, so the remote waited in have-local-offer
for as long as gathering ran, for example until a STUN request timed
out. The remote candidates of the new ICE generation that were trickled
in the meantime were added against the previous remote description,
dropped by pion as not matching the current ufrag, and never added
again.
Holding the offer was added when the ICE agent could not restart while
gathering. The ICE agent now cancels a gather in progress on restart,
so apply the restart offer and answer it right away, and remove the
held offer and its replay on gathering complete.
Refs #5167
* rtc: remove comment
UpDataTrackManager.Close empties its map and closes each track, but
does not report them unpublished. When the participant closes itself
(a peer connection disconnect timeout, a full reconnect), the room
removes it afterwards and finds no data tracks, so they stay in
RoomTrackManager and subscribers never get the removal notification.
Report each track unpublished on close, as a closing media track does.
Tests cover both close paths against a real room, and Close itself:
each track reported once, nothing on a second Close or for a track
unpublished before it.
DownTrack.GetPrimaryStreamLastReceiverReportTime returned
time.Unix(0, LastReceiverReportTime()), but that is a mono timestamp,
not a real wall time. Connection quality compares it with time.Now()
and with the streaming start, which is a wall time. After the wall clock
steps, for example on an NTP correction, a receiver report looks older
or newer than it is by the step, so the scorer can mark a down track
POOR after one update without a report, or miss reports that stopped.
Convert the mono timestamp to wall time, and return zero time before the
first receiver report, as #5006 does for the last sender report time.
The probe controller, the probe packet group and the probe cluster store
mono.Now() timestamps, but measure the time since them with time.Since.
Since livekit/protocol#1439, mono.Now() has no monotonic reading, so
time.Since takes the difference from the wall clock. After the wall
clock steps, for example on an NTP correction, the settle wait and the
probe pacing are off by the step for the rest of the process's life.
Use mono.Now().Sub instead.
subscribeDataTrack checks the publisher's permission when it resolves
the data track and records the subscriber on the track afterwards. A
publisher revoke removes only the subscribers already recorded on its
data tracks, so a subscribe that passed the check before the revoke and
was recorded after it is never removed. The subscriber keeps receiving
a data track it is no longer allowed to receive.
Resolve the track again once the subscriber is recorded, as is already
done for canSubscribe. If it is still the same data track and
permission is now denied, remove the subscriber and return
ErrNoTrackPermission. The reconcile that follows records the denial,
tells the client, and keeps the subscription waiting until permission
is granted again.
lk.rtc.joinRequestTime was set only for standard participants. SIP,
agent, egress and other participants now get it too, so the time a
participant reached the signal node is known for every kind.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Add a new gauge that counts active rooms whose name does not match a
configurable regex. This lets operators keep synthetic rooms (load
tests, health checks) out of autoscaling and dashboards, without
changing livekit_room_total.
Config:
prometheus:
port: 6789
room_exclude_regex: "^(loadtest|healthcheck)-"
Behavior:
- Disabled by default. With an empty room_exclude_regex the metric is
not registered and nothing changes.
- RE2 syntax, unanchored match.
- An invalid regex fails server startup with a clear error.
- Same node_id/node_type labels as livekit_room_total.
- livekit_room_total and the RoomStarted/RoomEnded signatures are
unchanged. The new hooks sit next to the existing calls in
RoomManager.
Tests cover invalid/empty patterns, include/exclude counting, the
existing metric staying unchanged, and safe no-op when disabled.
A remote that counts duplicates as received reports a negative cumulative
loss. Read as unsigned, a report of -1 became 100% loss for the window.
- read TotalLost as a signed 24-bit value, clamp a negative value to 0
- pass the snapshots by pointer in the delta warnings so they are logged
- log the processed receiver reports from the oldest entry
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Update runs for every packet. With many streams, most of its cost is
memory access across three structs and about 10 cache lines.
- use sync.Mutex, all readers are short getters
- embed the base structs, the WrapAround trackers, the history bitmap
and the RTP converter by value
- group the fields that every packet updates, move gapHistogram after them
- compute expectedTSJump only when it is used
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* rtc: re-check track permission after the subscriber is recorded
* rtc: cover the denial after an in-flight revoke in the subscribe test
---------
Co-authored-by: Mansur Akhmadi <10739460+mansur-akhmadi@users.noreply.github.com>
A caller that writes a packet and forwards it in the same call gets the
generation it needs for a later ReadRTP of that packet.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
* sfu: tighten RTP stats restart detection and RTCP report handling
- A stream restart is a forward-moving run of rejected packets that
lasts 1 s with no accepted packet, not 5 rejected packets.
- Receiver reports with a wrong cycle count are aligned to the highest
sent sequence number and no longer dropped as runaway.
- No sender report is sent while publisher sender reports advance at
less than half or more than twice the clock rate.
- Fold repeated drop and logging blocks into helpers and remove
unreachable branches.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* sfu: use only the low 16 bits of the receiver report sequence number
Cycle correction could move a report before the start, underflow the
saved highest and block every later report. Map the report to the
latest matching sequence number at or before the highest sent, and
drop the misalignment bookkeeping.
A publisher sender report time stamp that does not advance is now
treated as an off clock rate, not as unmeasured.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* sfu: bound the receiver report distance and key the unchanged check on the accepted report
A report ahead of the highest sent mapped into the previous cycle once
the stream was longer than one cycle. A report must now be within half
a cycle behind the highest sent.
A repeated stale report matched the last received report, not the last
accepted one, and replaced newer loss and jitter values.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* Bump mediatransportutil for the OWD estimator fix
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* sfu: log the source stream generation in packetMeta
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* rtpstats: address review comments from Jules
Addresses only the comments from Jules (jtestard) on #5220.
Restart detection
- a reordered or duplicate packet of a run does not reset the run
- padding moves a run forward in sequence number and does not count
- only a packet with payload ends a run, a skipped sequence number does not
- comments on false positives and on the minimum run duration
Publisher clock rate
- measure only across publisher reports at least 1 s apart
- an older publisher report starts a new measurement
- comment on why Seed does not copy the measurement
- drop the reportTime log field, it repeats the report time
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* rtpstats: test publisher clock rate across sources with different timestamp bases
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* rtpstats: address review comments from Anunay
Addresses the comments from Anunay (anunaym14) on #5220.
- skip a sender report only when the publisher rate is low, a pair of
publisher reports across an unmute reads high and the report is correct
- comment on why a declared restart run is final
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* rtpstats: comment on why a high publisher clock rate is not skipped
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
DummyReceiver.Upgrade stored the real receiver and only then took
downTrackLock to move the pending down tracks to it. A DeleteDownTrack
that ran in between saw the real receiver, deleted from it (a no-op,
the down track had not moved yet) and returned. Upgrade then moved the
deleted down track to the real receiver, which kept a closed down track
in its spreader for as long as the track lived. DummyRedReceiver.upgrade
had the same order.
Store the receiver while holding downTrackLock in both, so a delete
either removes the down track from the pending map before the move or
finds it on the real receiver after it. GetDownTracks also no longer
returns the real receiver's list without the pending down tracks
during an upgrade.
* sfu: roll back RTP state when pausing on downgrade
Dropped higher-layer packets advanced the outgoing timestamp, so a lower layer that stayed slightly behind was rejected on every keyframe.
* sfu: test both sides of the downgrade switch threshold
Set the trails 10ms under and over the threshold, and pad a packet dropped after a sequence gap.
* config: count lk. participant attributes against their own size limit
LiveKit services set participant attributes with the lk. prefix. These
attributes now count against a new max_lk_attributes_size limit
(default 1024 bytes), so they do not use up the customer's
max_attributes_size budget. All attribute size checks enforce both
limits and keep the existing error types.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: check attribute limits against the merged participant attributes
UpdateMetadata checked only the attributes in the update, but
SetAttributes merges them into the stored attributes. Sequential
updates could each pass and leave the participant above either limit.
The check now runs on the attributes that the update would store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* service: return invalid argument when merged attributes exceed a limit
The admin API checks only the attributes in the request. The participant
checks them merged with the attributes it already has, so a request can
pass the first check and fail the second. That error reached the caller
as unknown. Return InvalidArgument for it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A one shot client, i. e. WHIP, cannot negotiate again. The transceivers
of its offer are the only place for a subscribed track. #4474 turned off
transceiver re-use for Safari, and the check ran before the one shot
branch. The server then added a new transceiver for the subscribed
track, which the answer cannot carry. A WHIP client in desktop Safari
got a `recvonly` answer and never received the track.
The one shot branch now runs first.
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
Unity WebGL runs livekit-client in the browser. Parse its user agent for
browser/OS info, and apply the iOS WebKit limitations to it like JS.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* agents: change protocol to 2 to signal HandleJobToken support
also implemented a basic HandleMigrateJobs to support hot reloads in dev
* remove migrate support
* rtc: keep the participant egress guard across a duplicate identity eviction
Room.RemoveParticipant clears hasPublished[identity], which is the guard that
stops auto participant egress launching twice for the same identity. A duplicate
identity eviction calls RemoveParticipant with the outgoing participant's own ID,
so the "participant session has been replaced" early return does not apply and
the guard is dropped even though the identity stays in the room.
The replacement session then publishes, finds no guard and launches a second
participant egress. The first one does not stop: the egress SDK resolves its
source by identity, so it follows the new SID, re-subscribes to the republished
tracks and keeps recording. Both jobs then write the same media until the
participant leaves for good.
Keep the guard when the close reason is ParticipantCloseReasonDuplicateIdentity.
launchedTrackEgresses is left as is, since it is keyed per track ID and a
replacement session republishes with new track IDs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* rtc: separate the participant egress launch guard from hasPublished
Review feedback on the first commit: hasPublished gates the publisher agent
dispatch as well as participant egress, so preserving it across a duplicate
identity eviction left the replacement session without its publisher jobs.
Track the participant egress launch in its own identity keyed map. hasPublished
is cleared on every removal as before, so agent dispatch is untouched, and only
the egress guard survives a duplicate identity eviction.
The preserved guard is also tied to a successful handoff: StartSession releases
it when the session that caused the eviction fails to join, so it cannot strand
an identity that is no longer in the room.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* rtc: only release a preserved egress guard while the identity is unoccupied
Sessions for one identity can race. A handoff fails with ErrAlreadyJoined
exactly when another session has already joined under that identity, and that
session now owns the preserved participant egress guard. Releasing it there let
the winner start a second egress on its next publication, alongside the job
still recording.
Release the guard only while the room holds no participant for the identity.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* rtc: drop the failed handoff release of the egress guard
Review feedback: the duplicate identity disconnect is filtered, so the running
participant egress keeps recording whether or not the replacement session ever
joins. Releasing the guard on a failed handoff only gives the next session for
that identity a way to launch a second job against the same tracks.
Remove ClearLaunchedParticipantEgress and its StartSession deferred call. The
guard is now released solely by RemoveParticipant on a non-duplicate removal or
a room close, which is where the identity genuinely leaves.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* sfu: don't count opus useinbandfec=0 as FEC in the down track
DownTrack decides whether opus FEC is on by looking for "fec" anywhere
in the fmtp line, both on Bind and when the upstream codec changes.
"useinbandfec=0" contains "fec", so a publisher that turns FEC off is
scored as if FEC were on. The connection quality scorer then lowers the
packet loss weight for opus from 8.0 to 5.33, and a subscriber with 8%
audio loss is reported as GOOD instead of POOR. The receiver side
already checks for useinbandfec=1, so the publisher's and subscribers'
scores disagree about the same stream.
Add utils.IsOpusInbandFECEnabled, which reads the useinbandfec
parameter by key and treats only a value of 1 as on, and use it for
all three FEC checks in the down track. The RED path already looked for
useinbandfec=1 and only gains tolerance of spaces around the parameter.
* sfu: read FEC from the upstream codec when the down track's codec changes
handleUpstreamCodecChange took the FEC flag from the codec the subscriber
negotiated, while Bind takes it from the upstream codec. FEC describes
what the publisher encodes, so after RED falls back to opus, a publisher
with useinbandfec=1 and a subscriber with useinbandfec=0 was scored as
having no FEC, and the reverse as having FEC.
Decide FEC in one place from the upstream codecs, using the upstream opus
codec for RED, and use it in both Bind and the codec change path. Log the
flag on codec change as Bind already does.
* sfu: use the same useinbandfec=1 check as the RED path for FEC
Drop utils.IsOpusInbandFECEnabled and check FEC with
strings.Contains(strings.ToLower(fmtp), "useinbandfec=1"), as the RED
path already did.
* sfu: move the FEC check to utils and match useinbandfec with a regex
Move the check to utils.IsFECEnabled, as asked in review, and match
useinbandfec=1 as one fmtp parameter with a regex, ignoring case and
spaces around the parameter and the "=". A publisher that sends
"minptime=10; useinbandfec = 1" was scored as having no FEC. Move the
tests to utils/helpers_test.go.
* agent dispatch: carry thread_id from dispatches to jobs
* agent dispatch: validate thread_id as an AT_ agent thread id on the API
* agent dispatch: validate thread_id with protocol agent.ValidateThreadID
* agent dispatch: report an invalid thread_id as a Twirp InvalidArgument on thread_id
Since #4453, StreamTrackerManager.UpdateTrackInfo calls
SetPaused(trackInfo.Muted) on every track info update, not only when
the mute state changes. StreamTracker.SetPaused(false) reset the tracker
even when it was not paused, so any track info update of an unmuted
video track (video size, codec info, simulcast layer SSRCs,
UpdateLocalVideoTrack) marked every live layer stopped, removed it from
the available layers, and zeroed its bitrate until the next packet and
bitrate report.
SetPaused now returns early when the paused state does not change, as
StreamTrackerDependencyDescriptor.SetPaused already does. A new tracker
starts unpaused in its reset state, so the SetPaused call in AddTracker
behaves the same.
* sfu: restart the dependency descriptor parser of a publisher stream after a gap
libwebrtc numbers dependency descriptor frames with one counter across all
simulcast layers. A layer that dynacast paused for a long time resumes with a
frame number more than half the 16 bit range away from its last one. The
publisher buffer's parser never restarted, so it unwrapped the resumed frames
against the stale number and later lost a full wrap. Every packet of the layer
then fell below the structure thresholds and was dropped until the numbers
caught up, about 16 minutes for three 22 fps layers.
Enable the parser restart after a 30 s gap that relayed tracks already use, and
start the key frame seeder on a restart, as the restart drops the structure the
following packets need.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* sfu: request a key frame only when a restarted stream has no structure
The parser now reports the restart on the packet that caused it, so the
buffer does not read the parser's state. A stream that resumes with a key
frame carries its structure and needs no key frame request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A second Close returns at once while the first still runs the close
callbacks. CloseDone is closed after they have run, so a caller can act
only once the participant's final update went out.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: don't let the forwarded RPC timeout underflow
PerformRpc forwarded "responseTimeout - p.lastRTT" to the callee, both
unsigned. A caller timeout below the callee's round trip, such as 100 ms
against 150 ms, wrapped around to about 4.29 billion ms, so the callee
was told it had roughly 49 days to respond while the server's own timer
still used the real value. lastRTT was also read without p.lock, which
UpdateMediaRTT holds when it writes it.
Read lastRTT under the lock and keep the caller's timeout when the round
trip is not below it.
Fixes#5151
* rtc: compute the forwarded RPC timeout inline in PerformRpc
Drop the rpcRequestTimeoutMs helper and test the forwarded
ResponseTimeoutMs through PerformRpc instead.
When an Allocate has no REQUESTED-ADDRESS-FAMILY, as from browsers,
pion picks the relay family from the address the client reached. The
default bind address 0.0.0.0 is a dual-stack listener, so a client that
connects over IPv6 gets a udp6 relay, which the IPv4 bind address
cannot open. Every allocation fails with 508 Insufficient Capacity and
the client gets no relay candidate.
Set StrictAddressFamily, which keeps the RFC 8656 default of an IPv4
relay, when no bind address is IPv6. Those nodes could never open an
IPv6 relay, so no allocation that succeeded before changes. With an
IPv6 bind address, pion's default is kept.
Fixes#5131
* rtc: do not send lk.rtc. attributes to other participants
Older JS SDKs fire ParticipantAttributesChanged for each new remote
participant that carries a server-set lk.rtc. attribute, and some crash
on it. Drop those attributes from participant updates and the join
response for everyone except the receiver.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* rtc: strip lk.rtc. attributes for every receiver
Also drop them from the receiver's own info and from the room moved
response, so no client sees them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: expect the join request time attribute to stay on the server
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Inbound trunk numbers are compared to the user part of the called URI,
so a sip:, sips: or tel: URI never matches a call. Reject new URI
entries on create and update. Entries already stored on a trunk stay
allowed, so existing trunks can still be updated.
* fix: validate data track handle range in HandleUnpublishDataTrackRequest
HandlePublishDataTrackRequest rejects pub_handle 0 and values above 65535 with INVALID_HANDLE, but HandleUnpublishDataTrackRequest casts the wire uint32 to uint16 without the same check. A client sending pub_handle 65537 wraps to handle 1 and unpublishes its own valid data track instead of receiving an error. This adds the same range validation to the unpublish handler before the uint16 conversion, with the same INVALID_HANDLE reason and message as publish.