sip icon indicating copy to clipboard operation
sip copied to clipboard

SIP Server creates rooms for INVITEs without a valid trunk (catch-all dispatch matches “any”)

Open mercuryyy opened this issue 4 months ago • 0 comments

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 / rule without trunkIds) and a room is created on LiveKit Server. This results in noise rooms/participants created by unknown numbers and unwanted traffic.

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 but its very hard when having a lot of sip trunks and lk server just opens rooms for each invite even tho it has no valid trunk for that incoming number

mercuryyy avatar Sep 20 '25 00:09 mercuryyy