HOWTO Configure the Twilio Provider



Twilio is a cloud communications platform that allows software developers to programmatically make and receive phone calls, send and receive text messages, and perform other communication functions using its web service APIs.

The SMS feature on PBXware allows users to select Twilio as a provider in their configuration so that messaging service is fully utilized. In order to successfully set up Twilio on PBXware, a number of steps must be followed beforehand. A user must first obtain the Twilio account, and afterwards log in to set up additional configuration.

NOTE: In order to use Twilio as a provider, it has to be enabled in a licence. If using the Multi Tenant Edition, Tenant Code(s) have to be provided.


1. Purchase Numbers With Twilio

Twilio enables users to search for and purchase numbers while ensuring easy management of the orders.
For more information on how to purchase numbers, please refer to the next section of this document.
Purchasing a Number
twilio-side-menu.png

To purchase numbers, please do the following:

1. Navigate to ‘Phone Numbers’ (if it is present, if not, refer to the next step) on the side menu on the Twilio portal.
1.1 Navigate to ‘Explore Products’ on the side menu on the Twilio portal. Find the ‘Super network’ section. In that section, find ‘Phone Numbers’ and click the pin button so it is visible on the side menu. Then repeat step 1.
2. Click the 'Buy a number' tab.
3. Users will be prompted to a different window where they can configure details regarding numbers.

twilio-search-num.png


  • Country
Populate this field with a desired country
(E.g. United States)
([a-z][0-9])
  • Capabilities
Check the SMS box.
NOTE: If a user chooses a number in the US or Canada and also wishes to send MMS messages, they can select the 'MMS' box.
  • Number Type
Check the Local box

Once the configuration is complete, it should look as shown in the example. To search numbers, a user should click the 'Search' button. After clicking the button, a list of available numbers will appear together with all other necessary data:

  • Type
  • Capabilities
  • Address requirement
  • Monthly Fee
buy-a-number-twilio.png

The next step would be to buy the desired number.. This is done by pressing the 'Buy' button as shown in the screenshot.

After clicking ‘Buy’, a pop-up will appear to review the phone number you selected, make sure to accept the Emergency calling terms and conditions and click Buy.

buy-a-number-twilio2.png



For every phone number, you should set up a webhook for incoming messages. In order to set up inbound webhook correctly, a valid URL has to be entered.

A webhook address is the address that Twilio uses to send inbound SMS messages. - https://%YOURPBXDOMAIN%/smsservice/twilio

1. Navigate to ‘Phone numbers’
2. Click ‘Manage’ to expand the side menu
3. Select ‘Active numbers’ - (This will open the list of currently active numbers.)
4. Select the phone number you wish to set the webhook to
5. Scroll down to the 'Messaging' section
6. Configure the following two fields:
input-webhooktwilio.png
  • A message comes in
Enter a valid URL
(E.g. https://pbx.test1.com/smsservice/twilio)
([a-z][0-9])
NOTE: To prevent any security issues, it is highly recommended to use the 'https' protocol. Please refer to the example above.
  • Primary handler fails
If needed, enter a secondary URL in case the primary one fails
(E.g. https://pbx.secondtest1.com/smsservice/twilio)
([a-z][0-9])

auth-twilio.png

Users can find the Auth Token and Account SID in the Project Info panel of the Console Dashboard page.

Please note that the Auth token is hidden by default.

Users can show it by clicking the ‘Show’ button. If there is any need to change the auth token, please refer to this link: Auth Tokens and How to Change Them


Adding an Account SID and Auth Token to PBXware

pbxware-twilio-config.png

To add an Account SID and Auth Token to PBXware, please do the following:

For Multi-Tenant:

1. Navigate to 'Master Tenant' -> 'SMS' -> 'Trunks' -> 'Add SMS Trunk'

For Contact Center:

1. Navigate to 'Home' -> 'SMS' -> 'Trunks' -> 'Add SMS Trunk'

2. Select 'Twilio' as a provider
3. Paste the Account SID in the 'Account SID' field
4. Paste the Auth Token in the 'Auth Token' field
5. Save the settings
SMS Trunks


To add a SMS Trunk to PBXware, please do the following:

For Multi-Tenant:

1. Navigate to 'Master Tenant' -> 'SMS' -> 'Trunks' -> 'Add SMS Trunk'

For Contact Center:

1. Navigate to 'Home' -> 'SMS' -> 'Trunks' -> 'Add SMS Trunk'

2. Enable the SMS Trunk
3. (For MT) Enter a name of the provider that is relevant only for easier navigation in the GUI
4. Select 'Twilio' as a provider
5. Paste the Account SID and Auth Token
6. Enter a suitable description regarding this Trunk (optional)
7. Save the settings
SMS Trunks and Tenants

sms-trunksandtenants-mt-still.png


To assign a specific SMS Trunk to a Tenant that has been previously created, please do the following:

For Multi-Tenant:
1. Navigate to 'Master Tenant' -> 'SMS' -> 'Trunks and Tenants'
2. Click the Tenant's name to edit the configuration or click the 'Edit' button
3. Select a specific Trunk from the drop-down menu
4. Save the settings


Adding Numbers to PBXware Automatically

csvupload-pbxware.png


To automatically add numbers to PBXware, please do the following:

For Multi-Tenant:

1. Navigate to a specific 'Tenant' -> 'SMS' -> 'Numbers'

For Contact Center:

1. Navigate to 'Home' -> 'SMS' -> 'Numbers'

2. Click the 'CSV Upload' button.
3. Upload the CSV file that is exported from Twilio to PBXware.
Adding Numbers to PBXware Manually
addnumbers-pbxware.png

sms-number-add-plus.png


To manually add numbers to PBXware, please do the following:

For Multi-Tenant:

1. Navigate to a specific 'Tenant' -> 'SMS' -> 'Numbers'

For Contact Center:

1. Navigate to 'Home' -> 'SMS' -> 'Numbers'

2. Click the 'Add SMS Numbers' button.
3. Add numbers purchased from Twilio.

NOTE: Please use +E.164 formatted phone numbers, such as '+1-xxxxxxxxxx' or '+44-xxxxxxxxxx' when adding them manually.