SIP Server creates rooms for INVITEs without a valid trunk (catch-all dispatch matches “any”)
Environment
LiveKit Server: self-hosted (version: e.g., 2.x.x)
LiveKit SIP Server: self-hosted (version: e.g., 1.x.x)
Deployment: Kubernetes (or Docker/bare-metal)
SIP Provider(s): e.g., Telnyx/Twilio/…
Summary
When the SIP Server receives random/incoming INVITEs that do not belong to any configured inbound trunk (missing/invalid trunk), the call still matches a catch-all dispatch rule (dispatch
Expected Behavior
INVITEs that do not resolve to a valid inbound trunk (by DID, source IP, etc.) should be rejected and no room should be created.
Dispatch rules should not match when there is no valid trunk context.
Actual Behavior
With a catch-all/unspecified dispatch rule (no trunkIds), every INVITE—including ones from unknown sources—gets dispatched and creates a new room + SIP participant.
Steps to Reproduce
Configure at least one inbound trunk.
Create a dispatch rule that is not scoped to specific trunks (i.e., omit trunkIds, effectively “any”).
Send a SIP INVITE from an IP/number that does not match any configured inbound trunk (or omit the DID).
Observe: LiveKit SIP accepts the INVITE and LiveKit Server creates a room and SIP participant.
Impact
Unwanted “noise” rooms from random callers.
Resource usage, logging noise, and possible abuse vectors.
With the new logic you added to update existing trunks data, there is a clear use case of just having dispatch