Twilio sip trunking for inbound call
# ask-ai
r
Twilio sip trunking for inbound call
t
Thanks for reaching out, Saurabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I can help with Twilio SIP trunking for inbound calls. To make my answer practical, could you tell me which part you need help with? Please pick one or more of the following or describe your exact goal: • Configuring the Twilio SIP Trunk (domain, auth, webhook settings). • Creating the inbound SIP trunk in LiveKit (CLI/API command examples). • Writing dispatch rules to route calls to rooms or agents. • Preserving caller ID during transfers. • Agent setup so agents only join when dispatched and greeting callers. • End-to-end testing and verification steps (what to look for in logs/SIP traces). • A specific error or behavior you’re seeing (please include trunk SID, room ID, timestamps, and any error messages). If you want, share the Twilio trunk settings you’ve configured (domain or SIP URI, authentication type) and what you expect to happen versus what’s actually happening — I’ll give step-by-step guidance tailored to that. Sources: Preserve caller ID during SIP transfers with Twilio | LiveKit | How to do call transfers with Five9 | LiveKit | Agents telephony integration | LiveKit Documentation
r
What is origination and termination in elastic sip trunking
t
Thanks — I’ll explain what origination and termination mean in Elastic SIP Trunking and how they map to LiveKit. • Origination (inbound) ◦ Origination is when a call comes from the public telephone network (PSTN) into your system. A phone number on your SIP trunk receives a call and the SIP provider forwards (originates) that call to your SIP endpoint. ◦ In practice: you configure an inbound/ origination trunk and list the phone numbers that should route into LiveKit. When a caller dials one of those numbers, the provider delivers the SIP INVITE to your LiveKit SIP endpoint (optionally using region-specific endpoints or auth). ◦ Use case: incoming customer calls that need to be routed into rooms, dispatched to agents, or handled by IVR/voice agents. • Termination (outbound) ◦ Termination is when your system places a call out to the PSTN. Your application (via LiveKit) sends a SIP INVITE to the trunk provider which then “terminates” the call onto the recipient’s phone number on the public network. ◦ In practice: you configure outbound/termination settings so LiveKit can create SIP participants or dial out using the trunk’s credentials and routing rules. ◦ Use case: calling customers from your app, outbound notifications, or transferring a call to an external phone number. How they work together • Bidirectional telephony requires both origination (to receive calls) and termination (to place calls). With both configured you can: accept inbound PSTN calls into LiveKit rooms/agents, make outbound PSTN calls from LiveKit, and transfer calls between PSTN and in-app participants. • In LiveKit this is managed through inbound SIP trunk configuration (numbers, auth, endpoints), outbound trunk/participant creation, and dispatch rules that route calls into rooms or agents. If you’d like, I can: • Walk you through the exact LiveKit CLI/API commands to create an inbound trunk or an outbound participant. • Show an example dispatch rule to route inbound calls to a room/agent. • Explain any Twilio-specific settings you should check (SIP URI, auth, caller-ID preservation). Which of those would you like next? Sources: sip | livekit/livekit_composite | DeepWiki | Building Performant Voice Agents in India | LiveKit | Outbound Calling Script | LiveKit Documentation
r
My use case, I will call twilio number and it should connect to Livekit sip
t
Thanks — this clarifies your goal: you’ll call a Twilio phone number and want that inbound call routed into LiveKit (origination). I can walk you through the required pieces. Before I give step‑by‑step instructions, a quick question so I tailor the steps correctly: What should happen after the call reaches LiveKit? Pick one or describe your flow: • Automatically join a specific LiveKit room (e.g., a support queue room). • Dynamically create a room per call (e.g., room named call-<timestamp>). • Dispatch the call to an available agent (agent joins only when dispatched). • Connect the caller to a voice bot/IVR in LiveKit. • Forward the call into an existing in‑app participant/session. Once you tell me which behavior you want, I’ll provide the exact Twilio and LiveKit settings and example commands (Twilio trunk settings, LiveKit inbound trunk creation, and a dispatch rule or participant creation example).
r
Dynamic room and dispatch agent
t
Great — thanks for confirming. Below are step‑by‑step instructions to receive Twilio inbound calls into LiveKit, dynamically create a room per call, and dispatch an available agent to join that room. High-level flow 1. Twilio receives the PSTN call to your phone number and forwards the call via SIP trunk to your LiveKit SIP endpoint (origination). 2. LiveKit receives the SIP INVITE and uses a dispatch rule that creates a new room for the call (e.g., prefix + unique id). 3. LiveKit dispatches an agent to that room; the agent joins only when dispatched and the caller is connected into the room. Preliminaries — what you’ll need • A Twilio account with a phone number and an Elastic SIP Trunk configured. • A LiveKit account/instance and CLI or API access to configure SIP inbound trunks and dispatch rules. • Agent identities configured in LiveKit that can be matched by dispatch rules. Step 1 — Configure Twilio SIP trunk to send inbound calls to LiveKit 1. In the Twilio Console, create or use an existing Elastic SIP Trunk and attach the phone number. 2. Configure the Trunk’s Origination (or SIP URI target) to point at your LiveKit SIP endpoint. Use the LiveKit SIP domain you set up (region-specific endpoints if you use them). ◦ Use SIP INVITE to deliver calls to LiveKit: e.g., sip:your-livekit-domain.example.com 1. If your LiveKit SIP endpoint requires authentication, configure IP access control or credential lists in Twilio accordingly. 2. Optional: enable SIP logging or tracing in Twilio to help debug incoming INVITEs. Step 2 — Create an inbound SIP trunk in LiveKit 1. Create an inbound trunk in LiveKit that references Twilio as a source and lists the phone numbers that will route in. ◦ Example CLI command pattern:
Copy code
lk sip inbound create --name "Twilio-Inbound" --numbers "+1234567890"
1. Configure any required authentication details (IP ACLs, credentials) in the inbound trunk so Twilio can successfully deliver calls. Step 3 — Create a dispatch rule to dynamically create rooms and dispatch agents You want a dispatch rule that: • Creates a new room per incoming call (use a room prefix like
call-
plus a generated ID). • Dispatches an available agent (match by agent pool or agent name). • Ensures the agent joins only when dispatched (explicit dispatch). Example dispatch behavior (conceptual JSON):
Copy code
{
  "dispatch_rule": {
    "rule": {
      "dispatchRuleIndividual": {
        "roomPrefix": "call-"
      }
    },
    "roomConfig": {
      "agents": [
        {
          "agentSelector": {
            "pool": "support-agents"
          },
          "agentJoinMode": "explicit"
        }
      ]
    }
  }
}
• roomPrefix: LiveKit will create rooms like
call-<unique-suffix>
. • agentSelector: target either a named agent or an agent pool. • agentJoinMode `explicit`: ensures agents only join when dispatched. Apply the dispatch rule to LiveKit: • Save the JSON as a file (e.g., dispatch-rule.json) and run:
Copy code
lk sip dispatch create dispatch-rule.json
(Adapt the exact CLI/API command to your LiveKit version and fields.) Step 4 — Configure agent behavior in LiveKit 1. Ensure agent sessions are created with explicit dispatch capability. An agent should be registered with the agentName or belong to the agent pool referenced by the dispatch rule. 2. Agents should use
@server.rtc_session(agent_name="...")
(or equivalent) so they only join when the dispatch triggers. 3. Once dispatched, the agent client receives the room details and joins the room to begin the call. Step 5 — Caller connection and greeting 1. When LiveKit creates the room for the inbound SIP call, the SIP caller is connected into that room as a SIP participant. 2. You can configure server-side session code (e.g.,
session.generate_reply()
) to play a greeting or IVR prompt while waiting for an agent to join. Step 6 — Testing and verification 1. Place a call to the Twilio phone number. 2. Verify Twilio forwards the INVITE to your LiveKit SIP URI (check Twilio SIP logs). 3. In LiveKit, verify a new room with the
call-
prefix is created and a SIP participant is present. 4. Confirm the dispatch rule triggers and an agent is offered / joins the room. 5. If failure occurs, collect: ◦ Twilio trunk SID, timestamp, and SIP trace/logs. ◦ LiveKit inbound trunk logs and dispatch decision logs. ◦ Room ID created (if any) and agent status. Notes and tips • Caller ID preservation: If you want the original caller ID preserved when transferring/terminating calls, enable the appropriate Twilio transfer-caller-id settings. • Region endpoints: Use region-specific LiveKit SIP endpoints to keep PSTN ingress low-latency when possible. • Security: Use IP ACLs and credential authentication between Twilio and LiveKit to avoid unauthorized INVITEs. If you’d like, I can now: • Provide an exact dispatch-rule JSON tailored to your agent naming/pool scheme if you share agent pool names or how you identify agents. • Give concrete LiveKit CLI/API commands for your environment (share your LiveKit CLI version or whether you’ll use the REST API). • Walk through a sample end-to-end test and what logs to check if something fails. Which of those would help you next?
r
I want open sip inbound trunk without numbers whitlisting
t
Thanks — you want an inbound SIP trunk in LiveKit that accepts calls from Twilio without requiring a whitelist of phone numbers. Below I’ll explain the steps to do that, the LiveKit settings you’ll change, and important security considerations so you don’t open yourself to abuse. Quick summary of what to do • Create an inbound SIP trunk in LiveKit that does not restrict by caller numbers (leave the inbound numbers list empty or omit number-matching rules). • Configure Twilio to send all incoming calls on the Elastic SIP Trunk to your LiveKit SIP URI. • Lock down authentication and transport-level protections (IP ACLs, SIP credentials, TLS) so you accept calls only from authorized Twilio sources even when you don’t whitelist numbers. Steps 1) LiveKit inbound trunk (no number whitelist) • Create the inbound SIP trunk in LiveKit and do not populate the phone numbers field (or explicitly set it to accept any calling number). • Set your trunk routing/dispatch rule to create a dynamic room per inbound call (for example use the room prefix approach you already planned). • Ensure the inbound trunk is configured to accept SIP INVITEs regardless of the Caller-ID header so number matching is not required for call acceptance. 2) Twilio trunk configuration • In the Twilio Console, point your Elastic SIP Trunk origination target (SIP URI) to your LiveKit SIP endpoint (e.g., sip:your-livekit-domain). • Attach the phone numbers you want Twilio to receive (these are Twilio-side; LiveKit won’t need to whitelist them). • Ensure Twilio will deliver SIP INVITEs to LiveKit for all incoming calls to those Twilio numbers. 3) Authentication and transport security (required) Because you won’t rely on number whitelisting, protect the trunk using at least one of the following: • IP allow-listing (IP ACL): Restrict SIP traffic to known Twilio egress IPs so only Twilio can reach your LiveKit SIP endpoint. • SIP credential authentication: Require Twilio to authenticate with SIP credentials when sending INVITEs. • TLS transport: Terminate SIP over TLS to ensure SIP signaling is encrypted. Use one or more of these together for strong protection. 4) Dispatch & agent behavior • Keep your dispatch rule that dynamically creates a room per call (room prefix like
call-
) and dispatches an agent pool. • Agents should be set to join explicitly so they only enter when dispatched. 5) Logging and monitoring • Enable SIP logging/traces on Twilio and LiveKit to quickly verify incoming INVITEs and dispatch decisions. • Monitor for unusual traffic patterns (rate spikes or repeated failed auth attempts) after opening inbound acceptance. Security notes and best practices • Accepting calls without caller-number checks is functionally fine, but without transport/auth protections you risk unauthorized SIP traffic or toll fraud. Always enable IP ACLs and/or SIP credential authentication. • If you must temporarily accept unauthenticated calls for testing, do so from restricted IP ranges and revert to authentication before going to production. • Consider rate-limiting or SIP request filtering to block abusive patterns. If you’d like, I can: • Provide the exact LiveKit CLI/API command to create an inbound trunk that accepts any caller number (tell me whether you’ll use the CLI or REST API). • Show example Twilio origination settings for the trunk (SIP URI, credential mapping). • Draft a dispatch-rule JSON that creates dynamic rooms and dispatches agents. Which of those would you like next?
r
I am using sip credential auth, getting 407
t
Thanks — I’m sorry you’re hitting a 407. I’ll help you troubleshoot it so Twilio can authenticate successfully with your LiveKit inbound trunk. What a 407 means here • A 407 (Proxy Authentication Required) means LiveKit challenged the incoming SIP INVITE and Twilio either didn’t respond with valid credentials or the credentials didn’t match what LiveKit expects. In short: LiveKit refused the call because credential authentication failed. Quick checklist to verify first 1. Credentials match exactly ◦ Confirm the
auth_username
and
auth_password
you set on the LiveKit inbound trunk exactly match the username/password in Twilio’s Credential List (case-sensitive, no extra spaces). 1. Credentials are present in LiveKit ◦ Ensure your inbound trunk in LiveKit actually has
auth_username
/
auth_password
set (not null). If you created the trunk without credentials, LiveKit will use IP-based auth only. 1. Twilio is configured to use that Credential List ◦ In the Twilio Console, the Credential List must be attached to your Trunk’s Termination settings so Twilio will send credentials when calling your termination URI. 1. Allowed IPs / firewall ◦ If you set
allowed_addresses
on the LiveKit trunk, confirm Twilio’s egress IPs are included. If Twilio’s IP is blocked, auth flow may fail. 1. SIP transport and port ◦ Confirm Twilio is targeting the same transport/port LiveKit expects (LiveKit typically uses port 5060 for UDP/UDP-like SIP). If you configured TLS on one side and UDP on the other, authentication can fail. Targeted troubleshooting steps 1. Check LiveKit logs for the auth failure ◦ Look for entries like “Authentication failed for user …” or “Sending 407 response.” Note the username LiveKit evaluated and any reason text. 1. Collect the SIP INVITE/401/407 exchange ◦ If you can, capture the SIP trace (Twilio logs or packet capture). The flow should be: ▪︎ Twilio INVITE → LiveKit 401/407 challenge → Twilio re-INVITE with Authorization header ◦ If Twilio never sends the Authorization header after the challenge, the Credential List may not be attached or Twilio isn’t configured to use credential auth. 1. Verify Twilio credential settings ◦ In Twilio: ensure Credential List contains the exact username/password. ◦ Ensure Termination is set to use that Credential List for calls to your LiveKit termination URI. 1. Test with a simple SIP client (optional) ◦ Register a basic SIP client or run sipp against LiveKit with the same username/password to confirm LiveKit accepts those credentials. This isolates whether the issue is Twilio-side or LiveKit-side. If you want, I can help more precisely — please share (masked if needed): • The
auth_username
value you configured in LiveKit (mask part of the password; username is sufficient to check for exact match). • Whether
auth_password
was set in LiveKit and the same password in Twilio (just confirm “same” / “different”). • Whether you have
allowed_addresses
configured on the trunk and what IPs are listed. • Any LiveKit log lines around the 407 (timestamped) or Twilio SIP trace entries. What I’ll check or suggest next once you share that: • If credentials mismatch: give exact commands/code snippets to update LiveKit or Twilio so they match. • If allowed_addresses missing Twilio IPs: show which Twilio egress IPs to add. • If Twilio never sends Authorization: walk through attaching the Credential List to your trunk termination settings. If you prefer, tell me which step you want to try first and I’ll provide the exact CLI/API or Twilio Console steps to update and verify the settings. Sources: Understanding TLS in SIP | LiveKit | sip | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit Documentation
r
Is allowed address mandatory with credentials??
t
Short answer: No — allowed addresses (IP allowlist) are not mandatory when you use SIP credential authentication. Credential auth alone can authenticate Twilio to LiveKit. However, for security you should strongly consider using allowed addresses in addition to credentials. Reasons and recommendations: • Why it’s optional ◦ LiveKit will accept credential-authenticated SIP requests without an IP allowlist if the username/password match. ◦ If credentials are correct and Twilio sends the Authorization header in response to the challenge, authentication will succeed regardless of source IP. • Why you should still use allowed addresses ◦ Defense in depth: combining SIP credentials + IP allowlist prevents attackers who obtain credentials from abusing the trunk from arbitrary IPs. ◦ Reduces attack surface and exposure to SIP scanning, toll fraud, and malformed/unauthenticated traffic. ◦ Twilio egress comes from a known set of IPs; allowing those IPs tightens trust to only Twilio’s infrastructure. • When you might omit allowed addresses ◦ Short-lived testing from unpredictable IPs where you can’t predefine Twilio egress (temporarily), but only if you: ▪︎ Use strong, unique credentials, ▪︎ Monitor logs closely, ▪︎ Re-enable allowlist before production. ◦ Environments where Twilio’s SIP requests are routed through dynamic intermediaries you cannot predict (rare). • Practical recommendation ◦ Use both: set `auth_username`/`auth_password` in LiveKit and configure Twilio Credential List to match, then add Twilio’s egress IP ranges to the inbound trunk’s
allowed_addresses
. ◦ If you must run without allowed addresses, enable detailed SIP logging and rate limiting and plan to add the allowlist before going live. If you want, I can: • Show the exact LiveKit CLI/API command to add Twilio’s IP ranges to your inbound trunk. • Provide the minimal set of Twilio IPs commonly required for SIP egress, or link to Twilio’s IP ranges to copy into
allowed_addresses
. Which would help you next?
r
sipp command to check sip inbound trunk
t
Thanks — below are practical sipp examples you can use to test a LiveKit SIP inbound trunk. I’ll include both unauthenticated and credential-authenticated examples, plus notes on interpreting the results. Replace the placeholders (YOUR_LIVEKIT_HOST, YOUR_USERNAME, YOUR_PASSWORD, FROM_NUM, TO_NUM) with your values. 1) Simple INVITE (no auth challenge) • Use this to check basic connectivity and that LiveKit accepts an INVITE to port 5060 (UDP).
Copy code
sipp -sf uac.xml -s TO_NUM YOUR_LIVEKIT_HOST:5060 -rsa FROM_NUM -m 1 -trace_msg
• -sf uac.xml: path to a SIP scenario file (see note below for a minimal INVITE scenario). • -s TO_NUM: Request-URI user/To header number. • -rsa FROM_NUM: sets the From user/number. • -m 1: send one call and exit. • -trace_msg: prints SIP messages. 2) INVITE with Digest Authentication (test 407/401 challenge + response) • This sends an initial INVITE, handles LiveKit’s 407/401 challenge, and resends the INVITE with Authorization using the provided username/password.
Copy code
sipp -sf uac.xml -s TO_NUM YOUR_LIVEKIT_HOST:5060 -rsa FROM_NUM -au YOUR_USERNAME -ap YOUR_PASSWORD -m 1 -trace_msg
• -au / -ap: username/password for SIP digest auth. sipp will respond to the challenge automatically. • Watch the trace: you should see INVITE → 407/401 → INVITE (with Authorization) → 200/180/183 or final response. 3) Using TCP or TLS • TCP (port 5060):
Copy code
sipp -sf uac.xml -s TO_NUM YOUR_LIVEKIT_HOST:5060 -transport tcp -rsa FROM_NUM -au YOUR_USERNAME -ap YOUR_PASSWORD -m 1 -trace_msg
• TLS (sips) — only if LiveKit is configured to accept TLS:
Copy code
sipp -sf uac.xml -s TO_NUM YOUR_LIVEKIT_HOST:5061 -transport tls -rsa FROM_NUM -au YOUR_USERNAME -ap YOUR_PASSWORD -m 1 -trace_msg
• Note: TLS requires proper certificates on the server. If using self-signed certs you may need extra sipp options or an out-of-band test tool. Minimal uac.xml scenario (simple INVITE) • If you don’t have a scenario file, create a minimal UAC scenario that sends an INVITE and waits for OK. Save as `uac.xml`:
Copy code
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="Simple UAC">
  <send retrans="500">
    <![CDATA[
    INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
    Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
    Max-Forwards: 70
    From: "sipp" <sip:[field1]@[local_ip]>;tag=[call_number]
    To: <sip:[field0]@[remote_ip]>
    Call-ID: [call_id]
    CSeq: 1 INVITE
    Contact: <sip:[field1]@[local_ip]:[local_port]>
    Content-Type: application/sdp
    Content-Length: [len]
    
    v=0
    o=- 0 0 IN IP4 [local_ip]
    s=-
    c=IN IP4 [local_ip]
    t=0 0
    m=audio [media_port] RTP/AVP 0
    a=rtpmap:0 PCMU/8000
    ]]>
  </send>

  <recv response="407|401"/>
  <send>
    <![CDATA[
    ACK sip:[field0]@[remote_ip]:[remote_port] SIP/2.0
    Via: SIP/2.0/UDP [local_ip]:[local_port];branch=[branch]
    From: "sipp" <sip:[field1]@[local_ip]>;tag=[call_number]
    To: <sip:[field0]@[remote_ip]>;tag=[peer_tag]
    Call-ID: [call_id]
    CSeq: 1 ACK
    Content-Length: 0
    ]]>
  </send>

  <recv response="200" optional="true"/>
  <recv response="180|183" optional="true"/>
</scenario>
• When running sipp, pass fields like TO_NUM and FROM_NUM as shown in the commands above. Interpreting results • Successful auth flow: you’ll see INVITE → 407/401 challenge → INVITE with Authorization → 200/180/183. If this completes, credentials are accepted. • Persistent 407/401 after resubmission: credentials mismatch — confirm username/password in both LiveKit and Twilio. • No response / ICMP unreachable / timeout: network/port/firewall issue; verify port and IP access. • Immediate 503/403: server-side rejection or policy (check LiveKit logs). Helpful log checks • On LiveKit: look for auth log lines indicating which username was evaluated and whether authentication succeeded or failed. • On Twilio: enable SIP logging to see whether Twilio includes the Authorization header after challenge. If you want, tell me: • The exact sipp command you ran and its trace output, or • Whether your LiveKit trunk uses UDP/TCP/TLS and the auth username you expect (masked), so I can give a tailored sipp command and help interpret the trace.
r
How to test with zoiper?
t
Great — here’s a clear step‑by‑step guide to test your LiveKit SIP inbound trunk using Zoiper. I’ll cover account setup, placing a test INVITE, what to expect, and troubleshooting tips. Before you start — what you need • LiveKit inbound trunk termination URI / SIP domain (e.g., sipyour livekit host5060). • SIP credential username and password that you configured on the LiveKit inbound trunk. • (Optional) Any port/transport info (UDP/TCP/TLS). Default is UDP 5060 unless you changed it. Zoiper account setup (desktop or mobile) 1. Install Zoiper and open it. 2. Add a new SIP account: ◦ Account type: SIP ◦ Username: the
auth_username
you set in LiveKit ◦ Password: the
auth_password
◦ Domain / Host: your LiveKit SIP host (example: your-livekit-host or your-livekit-host:5060) ◦ If Zoiper asks for a display name or auth username separately, put the same username in both places. 1. Transport settings: ◦ If LiveKit expects UDP: choose UDP (default). ◦ If you configured TCP: choose TCP. ◦ If LiveKit supports TLS and you set it up: choose TLS and use port 5061 (only if you configured TLS). 1. Outbound proxy / Registrar: ◦ If LiveKit expects direct INVITEs to the termination URI, set the Registrar to your LiveKit host (same as Domain). ◦ If you must use a full SIP URI, set the Registrar to sipyour livekit host5060. 1. Keep Alive / NAT: ◦ If Zoiper is behind NAT, enable SIP keepalive (options → network) so the server keeps the connection open. 1. Save and apply the account. Placing a test call (simulate an inbound call) • To test credential authentication and trunk behavior you can: ◦ From Zoiper, dial the username/URI that Twilio would use as the Request-URI. For example: ▪︎ Dial the number part used in your trunk request: sip:+1234567890@your-livekit-host ▪︎ Or dial the SIP target configured for your trunk: sip:TO_NUMBER@your-livekit-host ◦ Alternatively, place a direct SIP INVITE to the LiveKit host using the dial field in Zoiper (format can be sip:TO_NUMBER@your-livekit-host). What to expect in a correct flow • Zoiper sends REGISTER or INVITE (depending on account setup). • LiveKit should challenge with 401/407 if credential auth is required. • Zoiper responds with Authorization header automatically after challenge. • If credentials match, you should see a 200 OK (or 180/183 provisional followed by 200). • The call will connect and Zoiper should show audio RTP if a media path is negotiated. If you want to emulate how Twilio sends calls (no REGISTER, direct INVITE) • In Zoiper you can disable registration for that account (account advanced → disable registration) and directly dial the target SIP URI (sip:TO_NUMBER@your-livekit-host). That will send an INVITE without prior REGISTER, which mirrors Twilio unregistered INVITEs. Troubleshooting tips • Still getting 407/401 after Zoiper resubmits? ◦ Double-check username/password for exact match (case-sensitive, no trailing spaces). ◦ In Zoiper account settings ensure the auth username field matches the LiveKit
auth_username
exactly. • No response / timeout: ◦ Check port and transport (UDP/TCP). Confirm LiveKit is reachable on that port from your network. ◦ Verify firewall allows outbound from Zoiper and inbound to LiveKit. • Registration refused or rejected: ◦ LiveKit may not expect REGISTER; it may be expecting unregistered INVITE flows. Try disabling registration and sending the direct INVITE. • Check logs: ◦ Enable Zoiper debug logs (Settings → Debug) to see SIP message flow from the client side. ◦ Check LiveKit server logs for the incoming INVITE and any auth failure messages. • If NAT / audio issues (one-way audio or no audio): ◦ Ensure media ports are open/backed by ICE if LiveKit expects RTP via different addresses. ◦ Try using a client on a public network or adjust NAT traversal settings. Optional advanced checks • Capture the SIP exchange in Zoiper debug logs and compare with LiveKit logs to confirm the challenge/response sequence. • If Zoiper can authenticate but Twilio cannot, compare the exact Authorization header parameters (nonce, realm) from Zoiper’s successful flow to Twilio’s failing flow — this helps reveal credential mismatches or transport differences. If you want, tell me: • Which transport/port your LiveKit SIP endpoint uses (UDP/TCP/TLS). • Whether you want to simulate Twilio exactly (I’ll show the exact dial string to use). • Paste (masked) the Zoiper debug trace or LiveKit log lines and I’ll help interpret them. Would you like the exact dial string to simulate your Twilio number (give me the number format you expect: E.164 like +1234567890)?