rich-application-94483
03/17/2026, 1:51 PMtall-airline-16756
03/17/2026, 1:52 PMtall-airline-16756
03/17/2026, 1:52 PMauth_username and auth_password when creating the inbound trunk.
What you can do
1. Provide auth_username and auth_password as part of the SIPInboundTrunkInfo when you create the trunk.
2. Those fields are sent in the CreateSIPInboundTrunkRequest (server-side / SDK code).
Example (Python-style snippet)
inbound_trunk_request = CreateSIPInboundTrunkRequest(
trunk=SIPInboundTrunkInfo(
name="My Inbound Trunk",
numbers=["+1234567890"],
auth_username="your_sip_username",
auth_password="your_sip_password",
krisp_enabled=True
),
)
Notes and next steps
• This ensures incoming SIP requests to that trunk require the provided basic-auth credentials.
• Digest authentication or other SIP auth mechanisms are not specified here. If your provider requires a different auth method, tell me which method they require and I’ll suggest next steps or workarounds.
• If you’d like, tell me which SDK/language you’re using (Node, Go, Python, etc.) and I’ll give a concrete example for that environment. Sources: sip | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit Documentation, with interactive elementsrich-application-94483
03/17/2026, 2:41 PMtall-airline-16756
03/17/2026, 2:41 PMrich-application-94483
03/17/2026, 2:43 PMtall-airline-16756
03/17/2026, 2:44 PMauth_username and auth_password to be presented on incoming SIP requests. Configure FreeSWITCH to send those credentials in the SIP Authorization header when it sends the INVITE to the LiveKit trunk. TLS is recommended to protect the credentials in transit.
What to configure in FreeSWITCH
1. Define a gateway (or profile/route) toward LiveKit that includes the username and password you set on the LiveKit inbound trunk.
◦ Typical fields you set on the gateway are username and password (or `from-user`/`from-domain` depending on your dialplan/gateway config).
1. Ensure the outbound INVITE uses that gateway so FreeSWITCH will attach an Authorization header. FreeSWITCH will normally perform SIP authentication using Digest when challenged; by configuring credentials on the gateway it will automatically respond to a 401/407 challenge and include the proper Authorization header.
Example (gateway snippet for sofia gateway)
• In sofia/gateway/<livekit>.xml (or via dialplan variables), set:
◦ username="your_sip_username"
◦ password="your_sip_password"
◦ proxy="sip.livekit.example:5060" (use the LiveKit host and port)
◦ Use transport="tls" if you configured LiveKit for TLS
What that achieves
• When FreeSWITCH sends an INVITE to LiveKit, one of these will occur:
◦ If LiveKit challenges with 401/407, FreeSWITCH responds with an Authorization: Digest ... header computed from the configured `username`/`password`.
◦ If LiveKit expects credentials up-front, many SIP gateways also allow prepopulating the Authorization header (or send a preemptive REGISTER/INVITE response) using the configured `username`/`password`.
Practical notes and troubleshooting
• Digest vs Basic:
◦ SIP normally uses Digest authentication (Authorization: Digest ...) via challenge/response. LiveKit trunk fields are auth_username and auth_password — FreeSWITCH will use them to compute Digest responses to a 401.
◦ If LiveKit requires a Basic Authorization header (Authorization: Basic ...), FreeSWITCH does not send Basic by default for SIP auth. Let me know if LiveKit strictly requires Basic and I’ll outline a workaround (for example, adding a custom header or manipulating the outbound INVITE).
• Transport:
◦ Use TLS if possible so credentials and SIP signaling are encrypted.
• Logs:
◦ If authentication fails, enable SIP trace on the appropriate FreeSWITCH Sofia profile and capture the INVITE/401/Authorization exchange to see what header LiveKit receives.
• From/To headers:
◦ Ensure your From or from-user matches the auth_username if LiveKit expects that mapping. Some trunks validate the From header user against the configured auth_username.
If you want, tell me:
• The exact FreeSWITCH gateway/profile XML you’re using (or the Sofia gateway fields), and the LiveKit SIP host/port and whether you’re using TLS.
• Whether LiveKit challenged with a 401 (so FreeSWITCH should reply with Digest) or authentication is being rejected immediately.
I can then:
• Show a concrete gateway XML example tailored to your setup.
• Provide the exact debug commands to capture the SIP exchange and diagnose a failed auth. Sources: sip | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit Documentation, with interactive elements