Using Telnyx with Plivo

Create a Telnyx account for cheaper calls with your Plivo app
Sign Up

All you need is your email - or you can connect your Google, Facebook or GitHub accounts.

The Telnyx network offers unparalleled security, reliability and call quality. That’s because we’re a true carrier, and unlike many CPaaS providers, we don’t rely on middlemen to provide core communications functionality and routing.

But we appreciate that switching providers is no easy task. That’s why we’ve made our SIP services incredibly easy to integrate with whichever communications provider you’re already using. By making one simple change to your existing XML code, Plivo will send your calls to Telnyx via SIP, and we’ll then deliver your calls to their destination.

So you can still experience all the benefits of our superior network while continuing to use your existing applications.

So… What are the benefits?

The Telnyx network improves call quality, global scalability and lowers latency, all at significantly lower costs than any other provider. Customers typically save around 40% on voice costs when they choose to leverage our private, global network.

How do I get started?

The following instructions will explain how to configure both sides so that calls from Plivo are authenticated using your Telnyx Connection.

In this guide, we use a Plivo XML application as an example, but the token configuration on Plivo side will follow the same analogy for any other Plivo API based application (SDK, node, python, etc).

Telnyx Settings

  1. Login to the Telnyx Mission Control portal.
  2. Click on the Connections menu option and then Add Connection.
  3. Enter a Name and select Type: IP address.
  4. Under Expert IP Auth Settings choose the option Token and register the suggested Token (or define any alphanumeric value that you prefer). Click Save.
  5. On the same connection, click + Add IP to add the following Signaling IP addresses that belong to Plivo:

    • 52.9.254.127
    • 52.9.254.123
    • 107.20.176.37
    • 184.169.138.133
    • 107.20.251.237
    • 54.215.5.82
  1. Click on Save all Changes. Your Connection should look like the image below.

  1. Click on the Outbound menu option and create a new Outbound Profile or use an existing one.
  2. Assign the new Connection to the Outbound Profile to allow outbound calls to be authorized.

Your Telnyx Connection is now ready to accept traffic from your Plivo account!

Plivo Settings

Note: the following example uses a Plivo XML based application, but the same analogy and guidance for the Telnyx Token configuration is the same for any other Plivo API based application, i.e. SDK, Python, Node, etc.

  1. Login to the Plivo Portal.
  2. Create a Plivo application that points to your HTTP endpoint that will host your XML application:

  3. Create an XML application that forwards calls to Telnyx and adds a Token header like the one from this example:

1
2
3
4
5
6
7
8
9
10
11
<?xml
 version="1.0"
?>
<Response>
  <Speak>Please hold while we connect the call.</Speak>
  <Dial>
    <User sipHeaders="Telnyx-Token=<your-connection-token>">
          sip:<your-destination-number>@sip.telnyx.com
    </User>
  </Dial>
</Response>
  1. You can trigger your application by adding it to a call flow, e.g. assigning it to a Plivo phone number and make a call to that number.
  2. Once the application reaches that step, Plivo will send a SIP INVITE message to Telnyx to establish the call like the one from this example (please note the custom X-PH header for Telnyx-Token).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
INVITE sip:<your-to-number>@sip.telnyx.com SIP/2.0
Record-Route: <sip:107.20.251.237:5060;lr;ftag=--------
Via: SIP/2.0/UDP 107.20.251.237:5060;branch=----------
Via: SIP/2.0/UDP 3.93.158.143:5080;received=3.93.158.143;rport=5080;branch=z9hG4bKev8HypZm2DH6g
Max-Forwards: 39
From: "<your-from-number>" <sip:<your-from-number>@3.93.158.143>;tag=----------
To: <sip:<your-to-number>@sip.telnyx.com>
Call-ID: ---------------------------
CSeq: 11074464 INVITE
Contact: <sip:mod_sofia@3.93.158.143:5080>
User-Agent: Plivo
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REFER, NOTIFY
Supported: path, replaces
Allow-Events: talk, hold, conference, refer
Privacy: none
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 371
X-SipUserAgent: None
X-Plivo-ParentAuthID: <your-plivo-id>
X-Plivo-Webrtc: false
X-ParentCallUUID: ---------------
X-PH-Telnyx-Token: <your-token>
P-Asserted-Identity: "<your-from-number>" <sip:<your-from-number>@3.93.158.143>
Remote-Party-ID: "<your-from-number>" <sip:<your-from-number>@3.93.158.143>;party=calling;screen=yes;privacy=off

v=0
o=Plivo 1571228231 1571228232 IN IP4 3.93.158.143
s=Plivo
c=IN IP4 3.93.158.143
t=0 0
m=audio 28282 RTP/AVP 0 8 9 102 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:102 SPEEX/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=rtcp:28283 IN IP4 3.93.158.143
a=silenceSupp:off - - - -
a=ptime:20
  1. Telnyx will accept that SIP INVITE and will place/redirect the call to the PSTN number placed in the SIP URI.



The Telnyx customer support team is available 24/7 to provide you with technical support and answer any questions about using Telnyx with your Plivo application.

Telnyx is not associated with, sponsored or endorsed by Plivo. For more information deep-dive for Voice APIs.

Unlock the power of intelligent connectivity.
Try it Free

Questions on setup? Talk to our experts

By using the site, you agree to our use of cookies. Accept and close Find out more here.