Skip to main content

Steps

1

Create Elastic SIP Trunking

We’ll start by creating the SIP trunk inside Twilio. Once it’s configured, we can import it into Diga very simply.
1

Create the trunk, give it a name, and configure the general settings

Screenshot of the Twilio SIP trunk general settings
You must enable the Call Transfer (SIP REFER) option and click Enable PSTN Transfer to allow call transfers.
2

Configure termination (for outbound calls)

The termination SIP URI is important, you’ll use it in later steps. We recommend using a localized termination URI near your region. You can view your localized URIs in the Twilio console. This URL is used to make outbound calls — that is, calls initiated by a Diga agent.
Screenshot of the Twilio termination URIs
For your Elastic SIP trunk to accept outbound call requests, you need to use username and password authentication. You’ll be able to enter these later in Diga.
3

Configure origination (for inbound calls)

Here you’ll specify Diga’s SIP server address as the origination SIP URI: sip:sip.diga.io
GIF showing how to add Diga's origination URI in Twilio
2

Move numbers to the Elastic SIP Trunking

You’ve created the Elastic SIP trunk, now you need to purchase new numbers or move existing numbers to this trunk.
3

Import numbers to Diga

Now that the number is set up with your Elastic SIP trunking, you need to import the number into Diga so we know how to route the calls.
Screenshot of the phone numbers list in Diga
Here you’ll provide the termination SIP URI you set up in Step 1. Enter it in the Address field (under the Outgoing configuration tab) without the sip: prefix (for example, my-termination.example.com:5060). If you set up credential authentication, you’ll also need to provide the username and password.
Screenshot of the import phone number modal in Diga
You can also import numbers programmatically via the Import Number API.Once the number is imported, you can make and receive calls with this number just like a number purchased from Diga. It will appear in your dashboard and you can make calls directly from it.

Common Issues

Check your termination SIP URIIf there’s a space, remove it. Make sure you entered the address in the Address field without the sip: or sips: prefix. You should also use a localized termination URI near your region. Check the Twilio documentation to select one.Check your username and credentialsMake sure you entered the correct username and credentials shown in the configuration dialog. Note that the username is not the “friendly name” shown in the credentials list. The friendly name is different from the username, so double-check you didn’t enter a different name.
  1. Search “geo” to find the “Voice Geographic Permissions” setting.
  2. Choose “Elastic Sip Trunking” in the selector and select the countries you’d like to dial.

Phone Number Masking

If you have a personal phone number or a trusted business number you would like to display to the callee, verified phone numbers can be imported into Twilio to serve as the caller ID.

Add a Caller ID

  1. Go to the Verified Caller IDs page
  2. Click Add a new Caller ID
  3. Enter the desired phone number to verify, select the desired verification method, and then click Verify Number
  4. The number entered will receive an OTP Authentication code for verification. Enter this verification code on the next window.
  5. Once you click Submit, if the correct OTP code was entered, you will receive a Successful notification and the number will be added to your account as a verified caller ID.

Configure SIP Header Rules to Display Caller ID

  1. In the Twilio Console, navigate to Elastic SIP Trunking > Trunks > [your trunk] > Termination
  2. Scroll down to Header Manipulation and open View all SIP header manipulation policies
  3. Click on Create a policy in the top right and give your policy a friendly name
  4. Click on + Add request rule and give the rule a friendly name
  5. Under the Actions section, set the following values:
    • SIP header field: From number
    • Action: Replace with
    • Value: Your caller ID in E.164 format (e.g. +18881230987)
  6. Click Add rule, and then click Save policy
  7. Return to the Termination tab within your trunk, and select the new header manipulation policy from the dropdown
  8. Now, any number imported from this Twilio trunk into your Diga account will use your verified caller ID. Place an outbound test call to validate the changes.
You will need at least one number purchased from Twilio in your SIP trunk in order for the caller ID to be applied.