Skip to main content

Create and configure a Plivo SIP trunk

Step-by-step instructions for creating inbound and outbound SIP trunks using Plivo.

Connect Plivo's SIP trunking with LiveKit for inbound and outbound calls.

Prerequisites

The following are required to complete the steps in this guide:

Inbound calling

To accept inbound calls with Plivo and LiveKit, complete the steps in the following sections.

Create a SIP trunk

Create an inbound trunk in Plivo, setting your LiveKit SIP endpoint as the primary URI.

  1. Sign in to the Plivo Console.

  2. Navigate to ZentrunkInbound Trunks.

  3. Select Create New Inbound Trunk and provide a descriptive name for your trunk.

  4. For Primary URI, select Add New URI and enter your LiveKit SIP endpoint. Include ;transport=tcp in the URI. For example, vjnxecm0tjk.sip.livekit.cloud;transport=tcp.

    If you're signed in to LiveKit Cloud, your SIP endpoint is automatically included in the following example:

    <your SIP subdomain>.sip.livekit.cloud;transport=tcp
    Secure trunking

    If you're setting up secure trunking, use ;transport=tls instead of ;transport=tcp.

  5. Select Create Trunk.

Connect your phone number

Connect your Plivo phone number to the inbound trunk.

  1. Navigate to Phone NumbersYour Numbers.
  2. Select the phone number to connect to the trunk.
  3. In the Number Configuration section → Application Type, select Zentrunk.
  4. For Trunk, select the trunk you created in the previous step.
  5. Select Update.

Configure LiveKit to accept calls

Set up an inbound trunk and dispatch rule in LiveKit to accepts calls to your Plivo phone number.

Test incoming calls

Start your LiveKit agent and call your Plivo phone number. Your agent should answer the call. If you don't have an agent, see the Voice AI quickstart to create one.

Troubleshooting

For help troubleshooting inbound calls, check the following logs:

Outbound calling

To make outbound calls with LiveKit and Plivo and LiveKit, complete the steps in the following sections.

Create an outbound trunk in Plivo

Set up an outbound trunk with username and password authentication in Plivo.

  1. Sign in to the Plivo Console.

  2. Navigate to ZentrunkOutbound Trunks.

  3. Select Create New Outbound Trunk and provide a descriptive name for your trunk.

  4. In the Trunk Authentication section → Credentials List, select Add New Credentials List.

  5. Add a username and strong password for outbound call authentication. Make sure these values match the username and password you use for your LiveKit outbound trunk.

  6. For Secure Trunking, select Enabled (recommended).

    Secure trunking

    If you enable secure trunking in Plivo, you must also enable secure trunking in LiveKit. To learn more, see Secure trunking.

  7. Select Create Trunk to complete your outbound trunk configuration.

    Copy the Termination SIP Domain for the next step.

Configure LiveKit to make outbound calls

Create an outbound trunk in LiveKit using the Termination SIP Domain, and username and password from the previous section.

Place an outbound call

Test your configuration by placing an outbound call with LiveKit using the CreateSIPParticipant API. To learn more, see Creating a SIP participant.

Troubleshooting

If the call fails to connect, check the following common issues:

  • Verify your SIP URI. It must include ;transport=tcp.
  • Verify your Plivo phone number is associated with the correct trunk.

For outbound calls, check the following logs:

For error codes, see the Plivo hangup codes reference.

Regional restrictions

If your calls are made from a Plivo India phone number, or you're dialing numbers in India, you must enable region pinning for your LiveKit project. This restricts calls to India to comply with local telephony regulations. Your calls will fail to connect if region pinning is not enabled.

For other countries, select the region closest to the location of your call traffic for optimal performance.

Next steps

The following guides provide next steps for building your LiveKit telephony app.