# Configuring TWILIO SMS provider

This example is written for the **Canistracci OIL** tenant. Create the objects with a **Docs Demo** prefix, test them on non-production numbers, and then adapt the same structure for the production tenant.

Twilio has announced a new API to deliver SMS, but the old RESTful simple API is still working. We are going to use it. Configure a new Provider, type SMS with protocol WEB URL.

400px

Use the following link:

https://api.twilio.com/2010-04-01/Accounts/&lt;ACCOUNT SID&gt;/Messages.json

Replacing &lt;ACCOUNT SID&gt; with your Twilio Account SID

400px

Complete the configuration with the Auth Token and the Post Data like:

To=${URIENCODE(${SMSDESTNUM})}&amp;From=${URIENCODE(+18584334434)}&amp;Body=${URIENCODE(${SMSTEXT})}

400px

Once created the provider, create the Routing Profile, type SMS and define the rules, for example as following

400px

If you want to send a MMS, use:

To=${URIENCODE(${SMSDESTNUM})}&amp;From=${URIENCODE(${SMSSOURCENUM})}&amp;Body=${URIENCODE(${SMSTEXT})}&amp;MediaUrl=http://&lt;your server&gt;/pbx/mms/${MMSKEY}/${MMSFILENAME}

## Receiving SMS

To receive SMS with Twilio, the best is to use the Custom format in POST/GET. Twilio seems to have problems in delivering messages over https when using a LetsEncrypt certificate. Not a smart move from them. This will force you to use HTTP as protocol. Beware, if using LetsEncrypt certificate, you may have a redirect forcing all communications to go over HTTPS. You need to disable it in /etc/httpd/conf/httpd.conf.

400px

<figure id="bkmrk-canistracci-oil-exam">![Canistracci OIL example screen for Configuring TWILIO SMS provider.](https://manual.mirtapbx.com/uploads/images/gallery/2026-06/KJBsettings-page-section-18.png)<figcaption>Canistracci OIL example screen for Configuring TWILIO SMS provider.</figcaption></figure>## Validation

- Confirm the tenant selected in the top bar is Canistracci OIL before creating the example.
- Verify the created objects appear in the expected Configuration menu page.
- Place a controlled test call or run the related status check.
- Remove or disable temporary test numbers when the example is no longer needed.