Skip to main content
If you have a phone number with another provider that you can’t port to Plivo, you can still use it with Plivo applications (XML apps, Audio Streaming, AI voice agents). This guide covers two ways to do it.

How It Works

1

Caller dials your external number

The call lands at your existing provider (the carrier where your number lives).
2

Provider routes the call to Plivo

Either as a forwarded call to a Plivo phone number (Option 1), or as a direct SIP INVITE to your Plivo application’s SIP URI (Option 2).
3

Plivo authenticates (Option 2 only)

For direct SIP, Plivo verifies the incoming call against your IP ACL or SIP credentials before accepting it.
4

Plivo executes your Application

The call hits your XML application’s Answer URL. Your server returns XML instructions (e.g., <Stream> to connect to a WebSocket-based AI agent).
5

Conversation continues

Audio flows in real-time between the caller and your application via Plivo’s voice infrastructure.

Two Options

OptionWhat It DoesBest For
DID forwardingYour provider forwards calls from your number to a Plivo numberQuick setup, no SIP knowledge required
Direct SIP (recommended)Your provider sends SIP traffic directly to your Plivo applicationLower cost, lower latency, fewer failure points

When to Use This

  • You have phone numbers with carriers that don’t support porting
  • You have geographic numbers (e.g., specific countries) where Plivo doesn’t offer numbers
  • You have toll-free or vanity numbers you’ve owned for years and can’t move
  • You want to connect existing PBX or contact center extensions to Plivo AI agents
  • You’re testing AI voice agents on existing numbers without committing to porting

Option 1: DID Forwarding

The simplest approach. Configure your existing provider to forward all incoming calls to a Plivo phone number.
Caller dials your external number
   |
   v
Your Provider (Provider X)
   |
   v  [forward leg, outbound from Provider X]
Your Plivo Number (inbound)
   |
   v
Plivo XML App -> Answer URL -> WebSocket / AI Agent

Setup

1

Buy a Plivo number

Purchase a voice-enabled Plivo number and assign it to your XML application.
2

Configure forwarding in your provider

In your existing provider’s dashboard, set up call forwarding to route inbound calls to your Plivo number. The exact steps depend on your provider — look for “call forwarding”, “auto-forward”, or “external destination” settings.
3

Test

Call your external number. It should ring through to your Plivo number, hit your XML app’s Answer URL, and trigger your voice agent.

Trade-offs

  • Pros: Quick to set up, works with any provider that supports forwarding, no SIP knowledge needed
  • Cons: Three call legs (caller → provider, provider → Plivo number outbound, Plivo number inbound). Higher cost and latency.

Configure your existing provider to send SIP traffic directly to your Plivo XML application’s SIP URI. Use SIP Authentication to secure the inbound stream.
Request-URI requirement: For inbound SIP authentication to apply, the Request-URI of the INVITE must be sip:{app_id}@app.plivo.com. Plivo resolves the application from the Request-URI user part, not from the To header. If your SIP provider places a phone number in the Request-URI, configure the provider to send INVITEs to the application’s SIP URI instead. Without this, calls bypass authentication silently.
Caller dials your external number
   |
   v
Your Provider (Provider X)
   |
   v  [SIP INVITE to sip:{app_id}@app.plivo.com]
Plivo SIP Auth check (IP ACL or credentials)
   |
   v
Plivo XML App -> Answer URL -> WebSocket / AI Agent
  • Lower cost — single Plivo SIP termination charge instead of provider forwarding + Plivo inbound
  • Lower latency — eliminates the extra forwarding hop
  • Better quality — fewer transcoding steps means cleaner audio
  • Fewer failure points — fewer legs means fewer things that can go wrong

Setup

1

Find your Plivo application's SIP URI

Every Plivo application has a SIP URI in the format:
sip:{app_id}@app.plivo.com
Find your app_id in the Plivo Console under Voice > Applications, or via the Application API.
2

Create SIP authentication

Choose one auth method:Option A: IP ACL (recommended if your provider has stable outbound IPs)
# Create the IP ACL
curl -X POST "https://api.plivo.com/v1/Account/<auth_id>/SipAuth/IpAccessControlList/" \
  -u "<auth_id>:<auth_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "External Provider"}'
# Response: {"ip_acl_uuid": "acl-abc123"}

# Add your provider's outbound SIP IP
curl -X POST "https://api.plivo.com/v1/Account/<auth_id>/SipAuth/IpAccessControlList/acl-abc123/Entry/" \
  -u "<auth_id>:<auth_token>" \
  -H "Content-Type: application/json" \
  -d '{"ip": "203.0.113.10", "cidr_prefix": 32, "description": "Provider X SIP outbound"}'
Option B: SIP digest credentials (use if your provider’s IPs change)
curl -X POST "https://api.plivo.com/v1/Account/<auth_id>/SipAuth/Credential/" \
  -u "<auth_id>:<auth_token>" \
  -H "Content-Type: application/json" \
  -d '{"username": "external-provider", "password": "<your_password>"}'
# Response: {"credential_uuid": "cred-def456"}
3

Assign auth to your Plivo application

Update your application to require SIP authentication:
# For IP ACL
curl -X POST "https://api.plivo.com/v1/Account/<auth_id>/Application/<app_id>/" \
  -u "<auth_id>:<auth_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "sip_auth_type": "ip_acl",
    "ip_acl_uuid": "acl-abc123"
  }'
4

Configure your external provider

In your existing provider’s dashboard, configure inbound calls to your number to forward via SIP to:
sip:{app_id}@app.plivo.com
Look for “SIP termination”, “SIP forwarding”, or “external SIP destination” settings.If you’re using credentials, configure your provider with the username and password you created in Step 2.
5

Test

Call your external number. The call should hit your provider, route as a SIP INVITE to sip:{app_id}@app.plivo.com, pass Plivo’s auth check, and trigger your XML application.Check the Plivo Console under Voice > Logs > Calls to verify routing.

Connecting to AI Voice Agents

Once your external number routes to a Plivo Application via SIP, your Answer URL can return the <Stream> XML element to connect to a WebSocket-based AI voice agent (Pipecat, LiveKit Agents, or your own framework).
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Connecting you to our AI assistant.</Speak>
    <Stream bidirectional="true" keepCallAlive="true"
        contentType="audio/x-mulaw;rate=8000">
        wss://your-server.com/stream
    </Stream>
</Response>
For full AI voice agent setup, see Build with Audio Streaming.

Cost & Latency Comparison

For a typical 5-minute inbound call:
ApproachLegsCost Components
DID forwarding3 (caller → provider, provider → Plivo number outbound, Plivo number inbound)Provider’s outbound forward rate + Plivo inbound rate
Direct SIP1 (caller → Plivo via SIP)Plivo’s SIP termination rate only
Direct SIP typically eliminates 50-70% of the per-minute cost and shaves 100-300ms of latency.

Verify It’s Working

After setup, make a test call and check your answer_url callback for these parameters:
ParameterWhat It Confirms
SIPAuthTypeAuth method that ran (ip_acl, credential, or ip_acl_and_credential)
SIPAuthUserThe authenticated username (credential auth only)
SIPSourceIPThe caller’s source IP
If SIPAuthType is missing from the callback, auth is not running — the most common cause is the provider placing a phone number in the Request-URI instead of your app_id.

Security (Direct SIP)

  • Always use SIP Authentication — leaving an XML app’s SIP URI open invites toll fraud and abuse
  • Prefer IP ACL when possible — if your provider has stable outbound IPs, IP ACL is faster (no challenge/response handshake) and harder to abuse
  • Use credentials when IPs are dynamic — if your provider rotates IPs, use SIP digest credentials with a strong password
  • Beware of shared IPs — if your provider is on carrier-grade NAT or a shared-IP platform, IP ACL alone is not sufficient. Use ip_acl_and_credential for defense in depth.
  • Combine both for maximum security — set sip_auth_type to ip_acl_and_credential to require both checks
  • Rate limiting is automatic — Plivo locks out IPs after 10 failed auth attempts in 60 seconds

Troubleshooting

IssueSolution
All calls get 403 ForbiddenVerify your provider’s outbound SIP IP matches an entry in your IP ACL, or that the credentials match exactly
Calls succeed but no SIPAuthType in callbackYour provider is placing a phone number in the Request-URI instead of your app_id. Configure the provider to send INVITEs to sip:{app_id}@app.plivo.com.
Call rejected with 407 (then drops)Your provider isn’t responding to the digest challenge. Configure the SIP credentials in your provider’s setup.
Auth passes but no XML executesCheck that the Application has a valid answer_url configured, and that your server returns valid XML
Calls work intermittentlyYour provider may be rotating outbound IPs. Switch to credential auth, or expand your IP ACL CIDR range

Full API Reference