dSIPRouter and Twilio Elastic Trunking Integration

We have made it super simple to connect dSIPRouter to Twilio Elastic SIP Trunking (ESIPT). The main component that makes this happen is the new CarrierGroup API. This API allows you to programmatically add carriers to dSIPRouter. This API follows the same format as our other dSIPRouter API. In this article, I will explain how to connect to Twilio ESIPT from the dSIPRouter UI and explain how to use the underlying API.

Installing dSIPRouter

The best way to install dSIPRouter is to use the one line installation commands which can be found here or use Terraform to deploy.

Get Twilio Credentials

You can obtain Twilio credentials from the Twilio Console
  1. Create a Twilio account or login to the Twilio Console if you have an existing account.
  2. Save the Account SID and Auth Token from the Twilio Console somewhere safe. You will need them to later

Create Carrier Group for Twilio

Now that dSIPRouter is installed let’s login and create a Carrier Group. This will allow you to setup a SIP connection between dSIPRouter and Twilio.
  1. Click Carrier Groups
  2. Click Add
  3. You will need to enter a name for the Carrier Group, select Twilio from the Plugin, enter in the Twilio Account SID and Account Token that we saved in the last section.
  4. Click Add
This will trigger an API to Twilio Elastic SIP Trunking that will create an Elastic SIP Trunk which can be seen in the Twilio Console.

Setup Default Outbound Route

Now make your new Twilio Carrier Group the default outbound route
  1. Click “Outbound Routes”
  2. Select the first rule and change the route to the MackTwilioCarrierGroup
  3. Click Update
  4. Click “Reload Kamailio” in the upper right of the UI

Testing: Setup an Endpoint Group

We can now test a call by creating an End Point Group using IP Auth or Username/Password Auth. I will use IP Auth
  1. Click Endpoint Groups
  2. Click Add
  3. Click Endpoints Tab
  4. Add your IP address and click Save
  5. Click Add
  6. Click “Reload Kamailio” in the upper right of the UI

Testing: Place a Call

We are going to use Zoiper to place a test call
  1. Start Zoiper
  2. Add Account
  3. Just add a Domain and Username. Note, the username is the Caller ID that will be sent when you place a test call. Note, Twilio will only send calls to validated numbers on the account when your account is in Trial mode.
  4. Place a call. Make sure the number is e.164 format, which looks like this +19544242424