Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

How to route calls to your SIP network with an outbound call


(information)

Info

If you are looking to explore SIP functionality, we recommend following the SIP Quickstart to get you up and running in a few clicks!

Are you interested in learning how to make calls using SIP with Twilio programmability? This guide will show you how to use Programmable Voice(link takes you to an external page) to make SIP outbound phone calls from Twilio to your Twilio Registered SIP Endpoints.

It's possible to connect an existing Twilio Voice Application directly to your SIP network. You can do this by requesting Twilio make a SIP call from either an existing incoming call, or from an outbound API request. Not only does this give you access to all the powerful Programmable Voice solutions, but it also allows you to lean on the savings by not routing your call through normal PSTN.


Steps to route calls to your SIP Network

steps-to-route-calls-to-your-sip-network page anchor
  1. Buy a Twilio Number
  2. Configure SIP Registration
  3. Configure your SIP Endpoint
  4. Make an outbound SIP call

Let's get started!


In the Twilio console(link takes you to an external page), search for and purchase an available phone number capable of making outbound calls. You'll use this phone number as the "From" phone number when you initiate an outbound call.

Search for voice capable numbers.Endpoint , Username (this can be E164 number, Extention number or name) as UserA and Password as yourpassword and click Create. Note: The credential username and password created here will be used on your SIP Endpoints for authentication.
  • Configure SIP Domain

    1. Select " Domains(link takes you to an external page) "
    2. Click the "+" icon to create SIP Domain(link takes you to an external page) .
    3. Add a Friendly Name as T1 and a unique SIP URI as Trunk1 . Note: SIP URI names needs to be unique, I have used Trunk1 in my example. You might have to find a name that is available
    4. Scroll down to "Voice Authentication" and associate the "Credential Lists" Endpoint that you created
    5. Scroll down to "SIP Registration" and click "Enabled"
    6. In "SIP Registration Authentication" associate the "Credential Lists" that you created. Then click "Save"

  • Note: If you are not using Twilio Registered Endpoint then this step is not applicable to you.

    A SIP Endpoint can be desk phone or soft phone. In this guide, we will use the soft phone and will configure the phone to successfully register to SIP Registrar.

    1. Download and install SIP Endpoint. Zoiper(link takes you to an external page) is used for example
    2. Provide login name - UserA@Trunk1.sip.us1.twilio.com (do add us1 region parameter to your sip domain) and password

    3. Click "Next/continue" to confirm the Domain(link takes you to an external page)
    4. Optional settings can be skipped
    5. Done! You see in Zoiper that it is "Registered" and has "Tick" next to your login name.
    6. You can also verify the successfully registered endpoints under your SIP domain > Registered SIP Endpoints in the Twilio console
    Reg.

    _10
    <?xml version="1.0" encoding="UTF-8"?>
    _10
    <Response>
    _10
    <Say>Welcome to xyz.com. Your call will be routed to an agent now</Say>
    _10
    <Dial>
    _10
    <Sip>sip:UserA@Trunk1.sip.us1.twilio.com</Sip>
    _10
    </Dial>
    _10
    </Response>

    (information)

    Info

    Make sure to add us1 region parameter as part of your SIP domain

    With our TwiML Bin created, now we need to wire it up to our number.

    1. Go to your Twilio Number(link takes you to an external page) page
    2. Click the Number you have purchased
    3. Scroll down to "Voice" under "A Call Comes in" select your configured TwiML Bin as SIP Outbound call from the dropdown menu and click "Save"
    URL.Rate this page:

    Need some help?

    Terms of service

    Copyright © 2024 Twilio Inc.