Skip to main content
Connect Plivo SIP trunking to Retell AI to enable your voice agents to make and receive phone calls through Plivo’s global voice network. This guide uses Retell’s elastic SIP trunking approach recommended for connecting custom telephony providers. You can configure Plivo using the Console or the API; each step in this guide includes both options. This guide follows a single linear flow: set up both trunks in Plivo, then import your number into Retell once.

Prerequisites

RequirementDescription
Plivo AccountSign up with SIP trunking enabled
Phone NumberPurchase a voice-enabled number
Retell AccountCreate account with at least one agent configured
If you’re using the API, you also need:
  • Your Plivo Auth ID and Auth Token, available on the Plivo Console home page. The Plivo API uses HTTP Basic authentication.
  • Your Retell API key, available on the API Keys page of the Retell dashboard. The Retell API uses Bearer authentication.
Export your credentials as environment variables to use with the code samples in this guide:
Indian phone numbers: TRAI regulations require voice AI platforms to terminate SIP traffic on servers located in India. Confirm with Retell support that your deployment meets this requirement before using Indian phone numbers.

How the integration works

DirectionCall pathWhat you configure
InboundCaller → Plivo number → Plivo inbound trunk → sip.retellai.com → Retell agentInbound trunk in Plivo pointing to Retell’s SIP server
OutboundRetell agent → Plivo outbound trunk → PSTN → CalleeOutbound trunk in Plivo; its termination domain and credentials go into Retell’s number import
Set up both trunks for a fully working number. The outbound trunk is always required — Retell won’t import a number without its termination URI, even for inbound-only use. The inbound trunk routes calls to your agent; skip the inbound trunk and phone number steps only if your agent exclusively makes outbound calls.

Set up the integration

1

Create an outbound trunk in Plivo

Set up an outbound trunk with username and password authentication in Plivo. Retell uses the trunk’s Termination SIP Domain and these credentials to place outbound calls.
  1. Sign in to the Plivo Console.
  2. Navigate to SIP TrunkingOutbound Trunks.
  3. Select Create Trunk and provide a descriptive name for your trunk.
  4. In the Trunk Authentication section → Credential, select Create new credential.
  5. Add a credential name, and a username and strong password for outbound call authentication, then select Create credential.
    • Username: 5 to 20 characters, alphanumeric only.
    • Password: 5 to 20 characters, using only alphanumeric characters and the special characters ~!@#$%^&*()_+, with at least one special character.
    • Use the same username and password when you import your number into Retell.
  6. For Authentication, select the credential you created in the previous step.
  7. Optional: enable Secure Trunking to encrypt SIP signaling over TLS.
  8. Select Create Trunk to complete your outbound trunk configuration.
Copy the Termination SIP Domain (for example, 21784177241578.zt.plivo.com). You need it when you import your number into Retell.
2

Create an inbound trunk in Plivo

Create an inbound trunk that routes calls from your Plivo phone number to Retell’s SIP server.
  1. Navigate to SIP TrunkingInbound Trunks.
  2. Select Create Trunk and provide a descriptive name for your trunk.
  3. For Primary URI, select Add New URI and enter Retell’s SIP server: sip.retellai.com;transport=tcp.
  4. For Link Numbers, select your phone number from the dropdown menu. Or connect your phone number in the next step.
  5. Select Create Trunk.
3

Connect your phone number

Connect your Plivo phone number to the inbound trunk. You can skip this step if you connected your phone number when you created the inbound trunk.
  1. Navigate to Phone NumbersPurchased Numbers.
  2. Select the phone number to connect to the trunk.
  3. For Application Type, select SIP Trunk.
  4. For Trunk, select the inbound trunk you created in the previous step.
  5. Select Save changes.
4

Import your number into Retell

Import your Plivo phone number into Retell using the Termination SIP Domain and the credential username and password from the outbound trunk you created earlier.
  1. Sign in to the Retell dashboard.
  2. Navigate to Phone Numbers, select the option to add a number, and choose Connect to your number via SIP trunking.
  3. Configure the import with the following values:
FieldValue
Phone NumberYour Plivo number in E.164 format. For example, +15105550100.
Termination URIYour Plivo Termination SIP Domain. For example, 21784177241578.zt.plivo.com. Don’t enter Retell’s SIP server URI here.
SIP Trunk User NameThe credential username from your Plivo outbound trunk.
SIP Trunk PasswordThe credential password from your Plivo outbound trunk.
Nickname (optional)A descriptive label. For example, Plivo support line.
Outbound TransportKeep the default, TCP. Select TLS if Secure Trunking is enabled on your Plivo outbound trunk.
  1. Select Save.
  2. After the number is imported, bind an inbound agent and an outbound agent to it. A number can only receive or make calls after an agent is bound in that direction.
To learn more, see the Retell custom telephony guide.
Changing trunk configuration: Retell doesn’t support editing an imported number’s SIP trunk settings. To change the termination URI or credentials, delete the number in Retell and import it again.
5

Test your integration

Inbound: Call your Plivo phone number. The Retell agent bound to the number should answer the call.Outbound: Place a call from the Retell dashboard, or use Retell’s Create Phone Call API. Set from_number to your imported Plivo number:

Troubleshooting

Trunk configuration errors typically surface only when a call is placed, so test both directions after setup. If a call fails to connect, check the following common issues:
IssueSolution
Inbound call doesn’t connectVerify the inbound trunk’s primary URI is sip.retellai.com;transport=tcp and your phone number is connected to the inbound trunk. Confirm an inbound agent is bound to the number in Retell.
Outbound call failsVerify the termination URI in Retell matches your Plivo Termination SIP Domain exactly, with no spaces or sip: prefix. Confirm the credential username and password match.
Authentication errorsVerify credentials match exactly in both Plivo and Retell. Use the credential username, not the credential name.
Calls drop or have no audioIf Secure Trunking is enabled on your Plivo outbound trunk, set Outbound Transport to TLS in Retell.
Debug logs: For error codes, see Plivo hangup codes.

SIP Trunking API overview

Plivo SIP Trunking API reference.

SIP Trunking for voice agents

Concepts and architecture for building voice agents with Plivo SIP trunking.

Retell custom telephony guide

Retell’s guide to connecting custom telephony providers.

Retell API reference

Retell’s Import Phone Number API documentation.