i'm working SIP, and our SIP provider supports IP ...
# ask-ai
e
i'm working SIP, and our SIP provider supports IP based authentication, is it possible in livekit
t
Thanks for reaching out, Aman. 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 supports IP-based authentication for SIP providers. Yes — LiveKit supports IP-based authentication for SIP trunks. When you configure a SIP trunk you can specify an
allowed_addresses
list to whitelist the IP addresses that are permitted to send SIP traffic for that trunk. This lets you enforce IP-based access control so only traffic from your SIP provider’s trusted IPs is accepted. If you’d like, I can help with next steps: • Show the exact configuration example for
SIPInboundTrunkInfo
including where to set
allowed_addresses
. • Confirm which IPs your SIP provider expects you to whitelist (you can paste them here). • Walk through testing steps to verify that only whitelisted IPs can connect. Which of those would be most helpful right now? Sources: sip | livekit/livekit_composite | DeepWiki | How Vicidial Handles Bridging, Transfers, and SIP Calls
e
give me config for outbond
t
Thanks — I’m responding to your request for an outbound SIP trunk configuration with IP-based authentication. Below is a ready-to-use example JSON for an outbound trunk that includes IP whitelisting via `allowed_addresses`:
Copy code
{
  "trunk": {
    "name": "My Outbound Trunk",
    "outbound": {
      "address": "<http://sip.provider.com|sip.provider.com>",
      "username": "your_username",
      "password": "your_password"
    },
    "allowed_addresses": [
      "203.0.113.10",
      "203.0.113.11"
    ]
  }
}
Notes and next steps: • Replace
<http://sip.provider.com|sip.provider.com>
,
your_username
, and
your_password
with your provider’s values. • Replace the IPs in
allowed_addresses
with the SIP provider IPs you need to whitelist. • Use the LiveKit CLI to create the trunk: a. Save the JSON as
outbound-trunk.json
. b. Run:
lk sip outbound create outbound-trunk.json
If you prefer to create the trunk programmatically, here’s a Python SDK example:
Copy code
from livekit import api

lk_api = api.LiveKitAPI(
    url="<https://your-instance.livekit.cloud>",
    api_key="your-api-key",
    api_secret="your-api-secret"
)

outbound_trunk = await lk_api.sip.create_sip_outbound_trunk(
    api.CreateSIPOutboundTrunkRequest(
        trunk=api.SIPOutboundTrunkInfo(
            name="My Outbound Trunk",
            address="<http://sip.provider.com|sip.provider.com>",
            username="your_username",
            password="your_password",
            allowed_addresses=["203.0.113.10", "203.0.113.11"]
        )
    )
)
Would you like: • A version that uses provider IP ranges/CIDR notation instead of individual IPs? • Help validating the IPs your SIP provider gave you before you apply the config? • A version of the example in another SDK (Go, JS)? Sources: sip | livekit/livekit_composite | DeepWiki | Python SDKs | livekit/livekit_composite | DeepWiki