Prerequisites
The following are required to complete the steps in this guide:
- A DIDWW account. Outbound calls require an account with outbound trunks enabled .
- A purchased phone number (DID) from DIDWW.
- A LiveKit Cloud project .
Create and configure an inbound SIP trunk
Complete the following steps to create and configure your SIP trunk.
Sign in to the DIDWW User Panel .
Select Voice → Inbound Trunks → Create New → SIP Trunk.
On the General tab, complete the following fields:
- Name: A descriptive name for the trunk.
- Type:
Static Endpoint. - User Part of R-URI:
{DID}. This placeholder automatically replaces the DIDWW phone number that you dial. - Host: Your LiveKit SIP endpoint. This is your LiveKit SIP URI without the
sip:prefix, for example:vjnxecm0tjk.sip.livekit.cloud. - Port:
5060. - Transport:
TCP.
Secure trunkingIf you're setting up secure trunking, use port
5061and transportTLSinstead.On the Number Translations tab, for CLI Format, select
E.164.Optional: AuthorizationOn the Authorization tab, select Enable Authorization and enter a username and password. These must match the values for
authUsernameandauthPasswordspecified using the JSON editor tab on the LiveKit SIP trunk.On the Media & DTMF tab, complete the following fields:
- Codecs:
PCMAandPCMUonly. - DTMF Send Mode:
RFC 2833. - SRTP Mode:
Disabled.
Secure trunkingIf you're setting up secure trunking, use SRTP Mode
SRTP SDES.- Codecs:
Save the trunk.
Assign a number to the inbound SIP trunk
Assign a phone number to the trunk by completing the following steps:
- From the DIDWW User Panel , select Phone Numbers → My Numbers.
- Select your phone number and assign the inbound trunk you created in the previous step as its voice trunk.
Create and configure an outbound SIP trunk
Create a DIDWW outbound trunk for outgoing calls, using the following steps:
Sign in to the DIDWW User Panel .
Select Voice → Outbound Trunks → Create New.
In the Friendly name field, enter a name for your trunk.
For the authentication method, select Credentials & IP-Based.
For Allowed SIP IP addresses, add the IP address range for LiveKit Cloud SIP.
Secure trunkingIf you're setting up secure trunking, in the media settings, under encryption mode, specify
SRTP SDES. You also need to settransporttoSIP_TRANSPORT_TLSand specify anencryptionsetting on your LiveKit SIP trunk.Under the CLI Settings, allow your DIDWW phone number as caller ID.
Optionally, configure additional limits:
- Rolling 24-hour limit
- Capacity limit
Create the trunk.
Access the trunk credentials from the Credentials section on the dashboard. You need the following values to configure the credentials for your outbound LiveKit SIP trunk:
- Username
- Password
Choose the DIDWW SIP endpoint closest to your region for optimal performance and use it as the address of your LiveKit outbound trunk. Refer to the DIDWW documentation for Outbound SIP information for the full endpoint list.
LiveKit setup
Finish connecting your inbound and outbound SIP trunks to LiveKit using the main setup documentation.
SIP trunk setup
Configure your DIDWW trunks in LiveKit.
Troubleshooting
If calls fail to connect, check the following common issues.
- DIDWW supports the G.711 codecs, PCMA and PCMU. It doesn't support G.722.
- The address specified in your outbound LiveKit SIP trunk should be a hostname only, without a
sip:prefix, port, or;transport=parameter.
| Issue | Cause |
|---|---|
| 404 response to an inbound call | No inbound trunk or dispatch rule matched the call. Check that User Part of R-URI is {DID}, that the phone number is listed on the LiveKit inbound trunk, and that the dispatch rule matches the trunk. |
| 407 followed by 401 response to an inbound call | If you enabled authorization, the username and password on the DIDWW Authorization tab don't match the LiveKit inbound trunk. A single 407 response is the normal authentication challenge. |
| 400 Bad Request response to an inbound call | The media settings don't match. Set SRTP Mode to either Disabled or SRTP SDES and limit codecs to PCMA and PCMU on the DIDWW inbound trunk. |
| 500 No suitable media response to an outbound call | Secure trunking is enabled on your LiveKit trunk, but SRTP isn't enabled on the DIDWW outbound trunk. Enable SRTP with SDES in the media settings. |
| 401, 403, or 407 response to an outbound call | DIDWW didn't accept the credentials or the source address. Check the username and password on the LiveKit outbound trunk, and the Allowed SIP IP addresses on the DIDWW outbound trunk. |
| 484 response to an outbound call | Wrong number format. Make sure you dial the full international number (E.164 format): for example, +19085550100 (US), +447700900123 (UK). Strip prefixes like 0, 00, or 011 before the dialed number. |
| Outbound call rejected after authentication | Any of the following reasons can cause this error. The caller ID isn't a phone number on your DIDWW account, the destination isn't allowed, the trunk reached its 24-hour limit, or your account balance is too low. |
For additional troubleshooting help, see the SIP troubleshooting guide.
Next steps
The following guides provide next steps for building your telephony app.
Voice AI quickstart
A quickstart guide to build a voice AI agent to answer incoming calls.