Set up Voice Origination with Twilio Bring Your Own Number (BYON) Service

    Overview

    Using the Plivo SIP-trunking platform, you can use your Plivo numbers to route calls to the Twilio voice platform. In this guide, we will walk you through how to set up a Plivo number for voice origination via Twilio’s BYON (Bring Your Own Number) service for routing the calls to a Twilio SIP Domain.

    To achieve this functionality, you must complete the following two configurations on the Twilio and the Plivo platforms:

    1. Create a Twilio SIP domain with an ACL (with Plivo IPs).
    2. Create a Plivo inbound trunk and assign it to a Plivo number.

    Create a Twilio SIP Domain with an ACL

    Follow the steps below to create a Twilio SIP domain and authenticate the calls routed through Plivo.

    • Create an Access Control List (ACL) to authenticate Plivo IPs with Twilio
    • Create a SIP domain and choose the ACL with Plivo IPs

    Create an ACL to authenticate Plivo IPs with Twilio

    To send traffic to a Twilio SIP domain from Plivo, the traffic must be first authenticated with an IP whitelist or username and password.

    To create an IP whitelist:

    • Navigate to the IP Access Control Lists page here.

      New ACL list

    • In the “New Access Control List” page, Enter a friendly name that will help you remember the IP group and then add in the following Plivo IPs:

      RegionsIP Addresses
      North California, USA13.52.9.0/25
      Virginia, USA18.214.109.128/25 18.215.142.0/26
      Frankfurt, Germany3.120.121.128/26
      Sao Paulo, Brazil18.228.70.64/26
      Sydney, Australia13.238.202.192/26
      Singapore18.136.1.128/26

    Create a SIP domain and choose the ACL (with Plivo IPs)

    You need to follow the below instructions to complete the configuration on the Twilio side:

    • You can navigate to the Twilio SIP Domains page hereand provide a domain name for the new SIP domain.
    • Choose the IP ACL (with Plivo IPs) you created in the previous step.
    • Copy and store the SIP URI. This will be helpful while creating the trunk on the Plivo platform (next step).

      New ACL list

      Note: Twilio SIP domain is a custom DNS host name associated with your Twilio account that can accept SIP traffic. This maps a domain name to the IP address (IPv4) of the computer hosting the domain.

    Create a Plivo inbound trunk and assign it to a Plivo number.

    Create an Inbound Trunk

    To create an Inbound Trunk:

    1. On the Inbound Trunks page in your Plivo Console, click Create New Inbound Trunk.
    2. On the New Trunk window, enter a name for your trunk (for example, Twilio Origination).

      Note: The Enabled checkbox is selected by default.

    3. Select the Primary URI and Fallback URI of your PBX.

      Note: The Primary URI is the FQDN or IP address to which all calls are forwarded first. If the Primary URI is unresponsive, the calls will be forwarded to the Fallback URI. Please note that the Fallback URI is optional.

    4. To add a new Primary or Fallback URI, click Add new URI.
    5. On the Create URI window, enter a name for your URI (for example, Twilio_origin), and then enter the SIP URI of the Twilio SIP domain (the one which you stored while configuring the SIP domain in the previous section).
    6. To enable Authentication, click on the Authentication option and provide username & password.
    7. Click Create URI to save and add your URI.
    8. Once you have created and selected your Primary and Fallback URI, click Create Trunk. Your inbound trunk will be created.

    To assign an inbound trunk to a Plivo Number:

    1. Once you click on Create Trunk, in the next window you can link your trunk with Phone numbers.
    2. You can either link the trunk with your existing phone numbers in your account or buy a new phone number and link the trunk.
    3. If you are willing to use your existing numbers, select the phone numbers under the Current Phone Numbers section, and click Link Selected Numbers.
    4. If you are willing to use a new number, navigate to the Buy New Number section and choose the country, prefix, type, capability, and click on Search.
    5. Select a Phone number and click Buy Number.
    6. Once you click on Buy Number, the number will be added to your account and the same will be linked with your inbound trunk.

    To know more about buying a Plivo Phone number, please navigate to the Buy a number section.

    Test & Validate

    Now, your setup is complete. You can make calls to the Plivo number and see that the calls are routed to the Twilio SIP domain to execute the webhook or the application set up at Twilio end.