Does LiveKit enforce a limit on the number of Allo...
# ask-ai
h
Does LiveKit enforce a limit on the number of Allowed Phone Numbers on an SIP Trunk? I’m looking to use
UpdateSIPInboundTrunkFields
to programmatically add whitelisted numbers as I provision them from Twilio.
t
Thanks for reaching out, Eric. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about whether LiveKit enforces a limit on the number of Allowed Phone Numbers on a SIP Inbound Trunk and using
UpdateSIPInboundTrunkFields
to add numbers. There is no documented enforcement of a maximum number of entries for the trunk
numbers
field. The
numbers
field in
SIPInboundTrunkInfo
is a string array (
string[]
) used to specify which phone numbers route to the trunk, and the docs do not state a hard limit. SIP trunks can be updated programmatically (for example via the Python SDK workflows for creating/updating trunks), so updating the
numbers
list as you provision Twilio numbers is the expected approach. A couple quick clarifying questions so I can help further: • Which SDK or API method do you plan to use to call updates (REST, Python SDK, or another)? • Do you expect to add thousands of numbers at once or add them incrementally? If you tell me the SDK/method and your expected scale, I’ll give a concise example and any practical guidance (batching, payload size concerns, or update pattern) to use when adding numbers programmatically. Sources: Agents telephony integration | LiveKit Documentation | Creating SIP Inbound Trunks and Dispatch Rules with Python SDK, with interactive elements
h
Add them incrementally, but the number of phone numbers could get into the thousands
t
Thanks — responding to your follow-up about adding numbers incrementally when the list may grow into the thousands. Short answer: There is no documented hard limit on the
numbers
array for a SIP Inbound Trunk. The
numbers
field is a
string[]
and can be updated programmatically, but there is no documented atomic partial-update method named
UpdateSIPInboundTrunkFields
. Recommended approach given the documentation: 1. Retrieve the existing trunk config (list the trunk). 2. Append the new numbers to the
numbers
array in your client. 3. Replace the trunk configuration by creating/updating the trunk with the full updated
numbers
list (examples show recreate/replace patterns). 4. Perform these changes incrementally and in batches rather than attempting thousands in a single request. Practical guidance: • Batch additions (e.g., hundreds at a time) to reduce payload size and risk of failures. • Test throughput and retry logic in staging to handle transient errors. • If you need code examples, tell me which SDK or REST approach you’re using (Python SDK, REST, or another), and I’ll provide a concise example and a suggested batching strategy. Would you like a Python (or REST) example for incremental batching? Sources: Creating SIP Inbound Trunks and Dispatch Rules with Python SDK | https://livekit.com/pricing.md| | Accepting calls overview | LiveKit Documentation, with interactive elements
h
Is there a downside to having many SIP trunks? is there a limit to the number of SIP trunks? i could do 1 trunk per twilio number if that’s easier
t
Acknowledging your question about downsides and limits for many SIP trunks (e.g., one per Twilio number). Short answers: • There is no documented hard limit on the number of SIP trunks you can create. • Having many trunks (one per number) is technically possible but not recommended. Why not one-trunk-per-number (downsides): • Management overhead: more configuration, monitoring, and lifecycle operations. • Higher operational complexity: more objects to keep consistent (trunk settings, dispatch rules, etc.). • More API calls for setup/updates → higher chance of transient errors and longer overall provisioning time. • No routing or performance benefit from splitting numbers into many trunks. Recommended approach: • Consolidate multiple phone numbers onto a single trunk (or a few regionally/functionally grouped trunks) by using the trunk’s
numbers
array. This simplifies management and scales better. • If you expect thousands of numbers, add them incrementally in batches (append to the
numbers
list and update the trunk), and test batching/retry behavior in staging. If you’d like, I can: • Provide a concise Python or REST example for batching incremental updates, or • Suggest a batching size/strategy based on your expected throughput. Which SDK or API will you use for provisioning (Python SDK, REST, or other)? Sources: Creating SIP Inbound Trunks and Dispatch Rules with Python SDK | Agents telephony integration | LiveKit Documentation, with interactive elements
h
Do Twilio SIP requests originate from predictable IP addresses? could do the whitelisted IP approach instead
t
Short answer: Yes — Twilio SIP traffic originates from predictable IP ranges you can whitelist, and LiveKit supports IP whitelisting on SIP trunks. What that means for you: • Use the trunk’s
allowed_addresses
to restrict which IPs can send SIP requests to your LiveKit instance. • Combine IP whitelisting with SIP auth (
auth_username
/
auth_password
) for defense in depth. • Keep your allowlist up to date with Twilio’s published IP ranges and test changes in staging. If you’d like, I can: • Provide a concise example (Python or REST) showing how to set
allowed_addresses
on a trunk, or • Suggest a batching/rollout plan to safely switch from number-based whitelisting to IP-based whitelisting. Which would you prefer? Sources: Agents telephony integration | LiveKit Documentation | How Vicidial Handles Bridging, Transfers, and SIP Calls | Checklist for Regional Deployments | LiveKit, with interactive elements