Skip to content

Twilio

The Twilio modules allow you to watch, create, update, list, and/or delete messages, recordings, notifications, and phone numbers in your Twilio account.

Prerequisites

  • Account SID and Auth Token

  • Upgraded Twilio account

  • Twilio phone number

In order to use Twilio with Ibexa Connect, it is necessary to have a Twilio account. If you do not have one, you can create a Twilio account at https://www.twilio.com/try-twilio.

Note

The module dialog fields that are displayed in bold (in the Ibexa Connect scenario, not in this documentation article) are mandatory!

Connecting Twilio to Ibexa Connect

To connect your Twilio account to Ibexa Connect, you need to obtain your SID and Auth Token.

  1. Log into your Twilio Account.

  2. On the Dashboard page, you can find ACCOUNT SID and AUTH TOKEN.

    61d6b979d0ef0.png

  3. Go to Ibexa Connect and open the Twilio module's Create a connection dialog.

    61d6b97b25578.gif

  4. Enter the SID and Auth Token provided in step 2 to respective fields.

  5. Click the Continue button.

The connection has been established.

Messages

Watch Messages

Retrieves message details when a new message is created.

To phone number Enter the phone number to Filter messages sent to the specified number.
From phone number Enter the phone number or sender ID to filter messages received from the specified number.
Limit Set the maximum number of messages Ibexa Connect will return during one execution cycle.

Create a Message

Sends a new outgoing message.

Send a Message From

Enter a Twilio phone number in E.164 format, an alphanumeric sender ID, messaging service or a Channel Endpoint address that is enabled for the type of message you want to send. Phone numbers or short codes purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using messaging_service_sid, this parameter must be empty.

Phone Number/Message service/Channel

Enter or select phone number, message service, or channel you want to associate the sent message to.

To

Enter the destination phone number in E.164 format for SMS/MMS or Channel user address for other 3rd-party channels.

Body

Enter the text of the message you want to send. Max. 1,600 characters.

Media URL

The URL of the media to send with the message. The media can be of type gif, png, and jpeg and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for other types of accepted media.

You can include up to 10 media URLs. You can send images in an SMS message only in the US and Canada.

Smart Encoded

Select the Yes option to detect and replace Unicode characters that have a similar GSM-7 character.

Validity Period

Set how long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds.

Status Callback

Insert the URL from the New Message Status Event instant trigger module to send status information to the module. If specified, we POST these message status changes to the URL: queued, failed, sent, delivered, or undelivered. Twilio will POST its standard request parameters as well as some additional parameters including MessageSid, MessageStatus, and ErrorCode.

Application

Select the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback.

Max Price

The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds Max Price, the message will fail and a status of Failed is sent to the status callback. If Max Price is not set, the message cost is not checked.

Provide Feedback

Whether to confirm delivery of the message. Select Yes if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the Message Feedback API. This option is set to No by default.

List Messages

Retrieves a list of messages associated with your account.

To phone number Enter the phone number to Filter messages sent to the specified number.
From phone number Enter the phone number or sender ID to filter messages received from the specified number.
Limit Set the maximum number of messages Ibexa Connect will return during one execution cycle.

Get a Message

Retrieves message details.

Message ID Enter (map) the ID of the message you want to retrieve details about.

Delete a Message

Deletes a message.

Message ID Enter (map) the ID of the message you want to delete.

List Message Media

If media exists on a specified message, you can retrieve information about images and other media.

Message ID Enter (map) the ID of the message you want to retrieve media from.

Calls

Watch Calls

Retrieves call details when a new call is created.

To phone number Enter the phone number to filter calls made to this phone number, SIP address, Client identifier or SIM SID.
From phone number Enter the phone number, SIP address, Client identifier or SIM SID to filter calls by.
Parent Call SID Enter the SID to filter calls by.
Status Select the status to filter calls by.
Limit Set the maximum number of calls Ibexa Connect will return during one execution cycle.

Create a Call

Makes a new call to a phone number, SIP address, or client identifier.

Make a Call From

The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified outgoing caller id for your account. If the To parameter is a phone number, From must also be a phone number.

Phone Number/Outgoing Caller

Enter or select the phone number, or outgoing caller you want to associate the call to.

To

Enter the phone number, SIP address, or client identifier to call.

Set Instructions From

Select the source of instructions for the call.

URL

  • URL

    Enter the absolute URL that returns the TwiML instructions for the call. Please find more details in the Twilio documentation.

  • Method

    The HTTP method we should use when calling the url parameter's value. Can be: GET or POST and the default is POST.

  • Fallback

    URL Enter the URL that we call using the fallback_method if an error occurs when requesting or executing the TwiML at url.

  • Fallback Method

    The HTTP method that we should use to request the Fallback URL. Can be: GET or POST and the default is POST.

  • Status Callback URL

    Enter the URL we should call using the Status Callback Method to send status information to your application. If no Status Callback Event is specified, we will send the completed status.

  • Status Callback Method

    Select the HTTP method we should use when calling the Status Callback URL. Can be: GET or POST. Default is POST.

  • Status Callback Event

    Select one or more call progress events that we will send to the Status Callback URL. It can be: initiated, ringing, answered, and completed. If no event is specified, we send the completed status.

Twiml

Enter TwiML (Twilio Markup Language) instructions for the call Twilio will use without fetching Twiml from url parameter. For more information about TwiML please refer to the Twilio documentation.

Application

The SID of the Application resource that will handle the call.

BYOC

Enter the SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that BYOC is only meaningful when To is a phone number; it will otherwise be ignored.

Send Digits

A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (0-9), '#', '*' and 'w', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be ww1234#. Remember to URL-encode this string, since the '#' character has special meaning in a URL. If both Send Digits and Machine Detection parameters are provided, then Machine Detection will be ignored.

Timeout

The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is 60 seconds and the maximum is 600 seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as 15 seconds, to hang up before reaching an answering machine or voicemail.

Trim

Select whether to trim any leading and trailing silence from the recording.

Caller ID

Enter the phone number, SIP address, or Client identifier that made this call. Phone numbers are in E.164 format (e.g., +16175551212). SIP addresses are formatted as [email protected].

SIP Call Authentication

  • Username

    Enter the username used to authenticate the caller making a SIP call.

  • Password

    The password required to authenticate the user account specified above.

Recording

Select whether to record the call. Can be Yes to record the phone call, or Not to not record. The default is No.

  • Channels

    Set the number of channels in the final recording. The default is mono. mono records both legs of the call in a single channel of the recording file. dual records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call.

  • Status Callback URL

    Enter the URL that we call when the recording is available to be accessed.

  • Status Callback Method

    Select the HTTP method we should use when calling the Status Callback URL.

  • Status Callback Events

    Select the recording status events that will trigger calls to the URL specified in Status Callback.

Enable Machine Detection

Select whether to detect if a human, answering machine, or fax has picked up the call.

  • Timeout

    Enter the number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with AnsweredBy of unknown. The default timeout is 30 seconds.

  • Speech Threshold

    Enter the number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400.

  • Speech End Threshold

    Enter the number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200.

  • Speech Silence Timeout

    The number of milliseconds of initial silence after which an unknown AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000.

Answering Machine Detection

Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed.

  • Status Callback URL

    Enter the URL that we should call using the Status Callback Method to notify customer application whether the call was answered by human, machine or fax.

  • Status Callback Method Select the HTTP method we should use when calling the Status Callback URL. Can be: GET or POST and the default is POST.

List Calls

Retrieves a list of calls associated with your account.

To phone number Enter the phone number, SIP address, Client identifier or SIM SID to filter results by.
From phone number Enter the phone number or Sender ID to filter calls from the specified number.
Parent Call SID Filter calls spawned by calls with this SID.
Status Select the status of the call to filter results by.
Limit Set the maximum number of calls Ibexa Connect will return during one execution cycle.

Get a Call

Retrieves call details.

Call ID (SID) Enter (map) the ID of the call you want to retrieve details about.

Delete a Call

Deletes a call.

Call ID (SID) Enter (map) the ID of the call you want to delete.

Recordings

Watch Recordings

Returns recording details when a new recording is created.

Call ID (SID) Enter (map) the ID of the call you want to filter retrieved recordings from.
Conference ID Enter (map) the ID of the conference you want to filter retrieved recordings from.
Limit Set the maximum number of recordings Ibexa Connect will return during one execution cycle.

Download a Recording Media

Downloads a recording media file in wav or mp3 format.

Recording ID

Enter (map) the ID of the recording you want to download.

Format

Select the format of the media file you want to download.

  • WAV

    A binary WAV audio file with mime-type "audio/x-wav" is returned. WAV files have a bitrate of 128kbps.

  • MP3

    A binary MP3 audio file with mime-type type "audio/mpeg" is returned. MP3 files have a bitrate of 32kbps.

List Recording Transcriptions

Retrieves transcriptions generated from the recording (if any). The transcription text itself is the result of converting an audio recording to readable text.

Recording ID Enter (map) the ID of the recording you want to retrieve the transcription for.
Limit Set the maximum number of transcriptions Ibexa Connect will return during one execution cycle.

Transcriptions

Watch Transcriptions

Retrieves a transcription when a new transcription is created in your account.

Limit Set the maximum number of transcriptions Ibexa Connect will return during one execution cycle.

Notifications

Watch Alerts

Returns an alert when a new alert is generated for an account.

Log Level

Filter the monitored alerts by the log level.

Start Date

Filter alerts that occurred on or after this date and time. Specify the date and time in GMT and format as YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ.

Queries for alerts older than 30 days are not supported.

End Date

Filter alerts that occurred on or before this date and time. Specify the date and time in GMT and format as YYYY-MM-DD or YYYY-MM-DDThh:mm:ssZ.

Note

Queries for alerts older than 30 days are not supported.

Limit

Set the maximum number of alerts Ibexa Connect will return during one execution cycle.

Callback Webhooks

New Message Status Event

Triggers when a message status is changed to: queued, failed, sent, delivered, or undelivered.

  1. Add the module to the scenario.

  2. Copy the provided webhook URL.

    61d6b97d39ff1.png

  3. Insert the copied URL to the Status Callback field in the Create a Message module.

Make an API Call

Allows you to perform a custom API call.

URL

Enter a path relative to https://api.twilio.com. E.g. /2010-04-01/Accounts.json

For the list of available endpoints, refer to the Twilio API Documentation.

Method

Select the HTTP method you want to use:

GET

to retrieve information for an entry.

POST

to create a new entry.

PUT

to update/replace an existing entry.

PATCH

to make a partial entry update.

DELETE

to delete an entry.

Headers

Enter the desired request headers. You don't have to add authorization headers; we already did that for you.

Query String

Enter the request query string.

Body

Enter the body content for your API call.

Example of Use - List Messages

The following API call returns the SMS messages from your Twilio account:

URL:

2010-04-01/Accounts/{{accountSid}}/Messages.json

accountSid The SID of the account that created the Message resources to read.

Method:

GET

61d6b97e3c94a.png

Matches of the search can be found in the module's Output under Bundle > Body > messages.

In our example, 2 messages were returned:

61d6b97f3b0a2.png