How to add Programmability to your existing SIP network
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 to receive SIP inbound phone calls from your SIP infrastructure to Twilio
Twilio Programmable SIP Domain makes it possible to create Enterprise Grade features, contact center feasible functionality in minutes. It's possible to add to programmable logic to your calls to make your business applications more intelligent. Twilio also offers global reach with its rich and reliable PSTN network.
- Configure SIP Domain
- Configure your SIP Endpoint
- Make an inbound SIP call from Twilio Registered Endpoint
Let's get started!
To receive SIP traffic from your network, configure a SIP Domain in Twilio. In this example, we use a Twilio Registered Endpoint to send SIP traffic to Twilio, so the following procedure enables SIP Registration and associates a credential list.
Info
The SIP registration steps in the following SIP Domain procedure are only required if you're using a Twilio Registered Endpoint. If you're not, skip them.
-
Configure a Credential List.
Twilio ConsoleLegacy Console- Open Twilio Console and go to Voice > SIP Domains > Credential Lists.
- Select Create Credential List.
- Enter a Credential list friendly name of
Endpoint. - In the Add credentials section, enter a Username (this can be an E.164 number, extension number, or name) of
UserAand a Password ofyourpassword. - Select Save.
These credentials are used by your SIP Endpoints to authenticate with Twilio.
-
Configure a SIP Domain.
Twilio ConsoleLegacy Console- Open Twilio Console and go to Voice > SIP Domains.
- Select Create SIP Domain.
- In the Properties section, enter a SIP domain friendly name of
T1and a SIP URI ofTrunk1. SIP URIs must be unique across Twilio — ifTrunk1is taken, choose another name. - In the Voice authentication section, select the
Endpointcredential list from Credential lists. - Select Create.
- On the SIP Domain details page, find the SIP registration section and select Edit SIP registration.
- Set Enable SIP registration to Enabled.
- Select the
Endpointcredential list from Credential lists. - Select Save.
A SIP Endpoint can be a desk phone or a softphone. In this guide we use a softphone and configure it to register with the SIP Registrar.
Info
If you're not using a Twilio Registered Endpoint, skip this section.
-
Download and install SIP Endpoint. Zoiper is used for example
-
Provide login name -
UserA@Trunk1.sip.us1.twilio.com(do add us1 region parameter to your sip domain) and password- Username and password from your Credential List in Twilio Console or the legacy Console.
- Yourdomain from your SIP Domain in Twilio Console or the legacy Console. For example,
Trunk1.sip.us1.twilio.com(do add us1 region parameter to your sip domain while configuring zoiper).
-
Click "Next/continue" to confirm the Domain.
-
Optional settings can be skipped
-
Done! You see in Zoiper that it is "Registered" and has "Tick" next to your login name.
-
You can also verify the successfully registered endpoints in the Registered SIP Endpoints section of your SIP Domain page in Twilio Console.
It is possible to add programmable logic to your call when the call is received by Twilio. For example, we will have the code that greets the caller and make a call to your cellphone.
With Twilio you can make calls only from a verified phone number or from Twilio number. If you plan to use a number other than Twilio phone number, then go to Verified callerID page and click + to ensure your number is valid and verified.
We will now write the TwiML for our application. Because this is a static application, we will use a TwiML Bin. Visit the TwiML Bin page and click the + icon to add a new bin.
Set the Friendly Name as Greet and call and copy and paste the TwiML below:
1<?xml version="1.0" encoding="UTF-8"?>2<Response>3<Say>Thank you for doing the tutorial. Will now call your cellphone</Say>4<Dial callerId="+1233451789">+15557650987</Dial>5</Response>6
Warning
Make sure to add a verified number for callerId to dial.
Create the TwiML Bin and copy the URL, see below

With our TwiML Bin created, now we need to wire it up to our SIP Domain.
- Open the SIP Domains page in Twilio Console or the legacy Console and select the domain you created.
- Scroll down to "Voice Configuration" paste the copied URL from above to "Request URL" and click "Save"
Now go to zoiper SIP client and dial your cellphone. You will hear the greeting in zoiper and it will ring your cellphone. Congratulations, you have made your inbound SIP call.
Great work!
- How to route calls to your SIP network with an outbound call
- More about Programmable SIP Trunk and its feature
- Pricing
Happy hacking!