This is the current API V1 documentation. Explore our API V2 if you’d like to test new features.

Open SidemenuDocs
Close Sidemenu

How to use Telnyx as a Termination Carrier for Plivohow-to-use-telnyx-as-a-termination-carrier-for-plivo

If you have both Telnyx and Plivo accounts, you can easily send calls from Plivo to Telnyx using Elastic SIP Trunking and your calls will terminate on the PSTN.


Here we explain how to configure both accounts so your calls from Plivo are sides authenticated using your Telnyx Connection.

Throughout this walkthrough, we'll use a Plivo XML application, but the token configuration on Plivo side will follow the same analogy for any other Plivo API based application (SDK, node, python, etc).

Telnyx Settingstelnyx-settings

  1. 1Login to the Telnyx Mission Control portalTelnyx Developers.
  2. 2Click on the Connections menu option and then Add Connection.
  3. 3Enter a Name and select Type: IP address.
  4. 4Under Expert IP Auth Settings choose the option Token and register the suggested Token (or define any alphanumeric value that you prefer). Click Save.
  5. 5On the same connection, click + Add IP to add the following Signaling IP addresses that belong to Plivo:
  6. 6Click on Save all Changes. Your Connection should look like the image below.
  7. 7Click on the Outbound menu option and create a new Outbound Profile or use an existing one.
  8. 8Assign 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 Settingsplivo-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. 9Login to the Plivo PortalTelnyx Developers.
  2. 10Create a Plivo application that points to your HTTP endpoint that will host your XML application:
    Plivo Setup
  3. 11Create an XML application that forwards calls to Telnyx and adds a Token header like the one from this example:
      <Speak>Please hold while we connect the call.</Speak>
        <User sipHeaders="Telnyx-Token=<your-connection-token>">
  4. 12You 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.
  5. 13Once 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).
    INVITE sip:<your-to-number> SIP/2.0
    Record-Route: <sip:;lr;ftag=--------
    Via: SIP/2.0/UDP;branch=----------
    Via: SIP/2.0/UDP;received=;rport=5080;branch=z9hG4bKev8HypZm2DH6g
    Max-Forwards: 39
    From: "<your-from-number>" <sip:<your-from-number>@>;tag=----------
    To: <sip:<your-to-number>>
    Call-ID: ---------------------------
    CSeq: 11074464 INVITE
    Contact: <sip:mod_sofia@>
    User-Agent: Plivo
    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>@>
    Remote-Party-ID: "<your-from-number>" <sip:<your-from-number>@>;party=calling;screen=yes;privacy=off
    o=Plivo 1571228231 1571228232 IN IP4
    c=IN IP4
    t=0 0
    m=audio 28282 RTP/AVP 0 8 9 102 3 101t
    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
    a=silenceSupp:off - - - -
  6. 14Telnyx will accept that SIP INVITE and will place/redirect the call to the PSTN number placed in the SIP URI.

Need some more help?need-some-more-help-

Our team is always ready to chat- just click the icon in the lower right hand corner for 24/7/365 support.