Zum Hauptinhalt springen

Twilio

Navigate to SMS Management

Add an SMS provider

  • Log into your Vodia Tenant portal.

  • Click Trunks on the left menu then SMS Management

  • Under the Providers tab click the [+ | Add] button

  • Complete the information.

  • Name: Provide a name (for your purposes)

  • Provider: Select Twilio

  • Username: Enter your Twilio Account SID.

    Optionally, you can append a custom API base URL (for example, when using a regional or test endpoint) in the format accountSid/baseUrl:

    ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/https://api.twilio.com/2010-04-01

    If you enter only the Account SID, Vodia defaults the base URL to https://api.twilio.com/2010-04-01.

  • Password / Application Secret: Enter your Twilio Auth Token.

    note

    Twilio uses HTTP Basic authentication built from the Account SID (username) and Auth Token (password). Find both in your Twilio Console — consult the Twilio documentation for the exact location.

  • Click [Save].

Add your SMS numbers

Now you need to add your DIDs into the Numbers tab.

  • Under the section SMS Management (Trunks on the left menu then SMS Management)
  • Click the Numbers tab and click the [+ | Add] button.
  • Provide a name (for your purposes)
  • Enter your phone number in E.164 format (e.g., +12025551234). Numbers are passed to Twilio exactly as entered.
  • Policy: If you have any policy in place, choose it. (optional)
  • Provider: Choose the provider name you have created.
  • URL prefix for receiving messages: Enter something you will use for your SMS callback URL. Eg: twilioinbound
  • Source: It could be your extension number.
  • Destination: It could be your extension number.
  • Click [Save].

Configure the Twilio inbound webhook

To receive SMS and MMS messages, configure your Twilio number's messaging webhook to point at your PBX. In the Twilio Console, open the phone number's Messaging configuration (consult the Twilio documentation for the exact location) and set:

  • "A message comes in" webhook URL: Your PBX URL with the prefix you specified above, for example: https://your-pbx-domain.com/twilioinbound
  • Method: HTTP POST

Vodia expects Twilio's standard form-encoded inbound POST containing From, To, Body, SmsStatus (must be received), and NumMedia/MediaUrl0 for MMS. Media is downloaded, following redirects.

Outbound messages are sent to <baseUrl>/Accounts/<AccountSid>/Messages.json. MMS is sent via the MediaUrl parameter.

10DLC registration (US local numbers)

If you are sending from a US local (10DLC) number to US destinations, US carriers require the number to be registered under a 10DLC campaign before messages will be delivered. Register a Brand and Campaign and assign your number's Messaging Service in the Twilio Console. Toll-free and non-US numbers do not require 10DLC registration.

Your Twilio SMS integration is now configured and ready to use.