Twilio SMS

The Twilio SMS Integrated System enables IPFusion to communicate with mobile devices, applications, services, and systems using the Short Message Service (SMS).

Definitions

Short Message Service (SMS) — A text messaging service component used to exchange short text messages between devices.

Setup

See the Data Servers page for information on configuring driver communication.

Compatibility

The Twilio SMS integrated system is compatible with the cloud hosted API client.

Prerequisites

Software Minimum Version
.NET Framework 4.7.2
IPFusion — Twilio SMS 1.3
Important: A Twilio Account is required to be registered and configured. The account will automatically generate and provide an Account SID and an AuthToken. Phone numbers must be registered into the account.
Warning: When many consumers are using the same Twilio account, this may cause your Twilio service to slow down.

When completing your setup, be sure to have the Twilio SMS documentation available for reference.

Ports

These ports must be open in your network firewall for the integration to work.

Purpose Default Value Configurable
Dataserver 9622 Yes
Debug Tools 9623 No

Twilio Account Type

Trial Account

A trial account has limitations with SMS messages:
  • When you send an SMS from your free trial phone number, it will always begin with Sent from a Twilio trial account. The message is removed after you upgrade.
  • One Twilio number is allowed per trial account.
  • While in trial mode, you can only send messages to non-Twilio phone numbers that you have verified with Twilio.
    Note: You can still receive messages from unverified numbers.
  • Twilio gives you a small preloaded balance to test out their functionality. You will not be charged for Twilio phone numbers or usage until you upgrade.

Full Account

Once a trial account is upgraded, the limitations of the trial account are removed.

Note: All messages sent and received to your account can be seen in the Usage section or on the SMS Dashboard.

Disable Automated SMS Responses

Active Numbers are configured to automatically reply to messages that are sent to the Active Number. To disable the automatic reply:

  1. Navigate to the Active Numbers page in your desired project.
  2. It should show the Number, Friendly Name, Capabilities, and Configuration for your number. The Configuration should show the messaging is configured to respond with https://demo.twilio.com/welcome/sms/reply/. This can be changed to respond with another message or disabled entirely. For our purposes we will disable it.
  3. Select the number to activate its properties.
  4. Navigate to Messaging. Here we see three fields: Configure With, A Message Comes In, and Primary Handler Fails. Notice that the A Message Comes In field is populated with the response described earlier.
  5. Change the field type from Webhook to TwiML Bin.
  6. Select the plug icon beside the empty field. This will allow you to customize the response.
  7. Add <Response></Response> to the body.
  8. Add a friendly name such as No Response. Create the new TwiML Bin.
  9. Click Save.

Communication Configuration

Information about the SMS is required in order for a Workstation to connect to the Twilio services. In the Integrated System configuration panel enter the below Communication Settings:

Account Security Identifier Acts as a username, learn more at Twilio Help Center.
Authentication Token Acts as a password, learn more at Twilio Help Center.
Note: Only one account can be utilized per site.
Note: Red X indicates an invalid or out of range value given for field.

Assets

Phone Asset

This asset represents the connection between a source phone number and the destination an SMS message is being sent to.

Required Property Grid Fields

External Phone Number The phone number the SMS message is being sent to.
Twilio Phone Number The Twilio phone number the message is being sent from.

View all properties

Supported States

Normal The asset is online and in its default state.
Masked The asset has been masked over its true state.
Fault An issue has been detected in a connected asset.
Acknowledged An asset alarm has been acknowledged.
No Communication Communication has been lost with the driver or asset. This status can also occur if the communication configuration for the system or asset is invalid.
Note: This status is required in all status tables.

See the Configure a Status Table page for more information on configuring status tables.

Supported Commands

Send Message Sends a user-defined message from the Twilio number to the external phone number.
Mask Mask the asset's true state.
Acknowledge Acknowledge an asset alarm.
Reset Resets the asset to its true hardware state.
Cancel Deselects all selected assets.

See the Command Tables page for more information on configuring command tables.

System Asset

This asset represents the connection state of the Twilio SMS system.

View all properties

Supported States

Normal The asset is online and in its default state.
Masked The asset has been masked over its true state.
Fault An issue has been detected in a connected asset.
Acknowledged An asset alarm has been acknowledged.
No Communication Communication has been lost with the driver or asset. This status can also occur if the communication configuration for the system or asset is invalid.
Note: This status is required in all status tables.

See the Configure a Status Table page for more information on configuring status tables.

Supported Commands

Mask Mask the asset's true state.
Acknowledge Acknowledge an asset alarm.
Reset Resets the asset to its true hardware state.
Cancel Deselects all selected assets.

See the Command Tables page for more information on configuring command tables.

Workflow Integration

System Commands

System commands are commands executed through Workflows at the system level. For more information about Workflows, see the Workflows section.

Send Message Command

The Send Message command is used to send text messages from a local phone number to an external phone number.

Table 1. Parameters
Message Content The body of the message that is being sent.
Destination Number The phone number of the device that is receiving the message.
Source Phone Number The Twilio phone number that is sending the message.

If a message fails to send, it will attempt to resend the message after five seconds. If the message fails to send for a second time, the command will terminate.

System Events

System events are events used to trigger Workflow actions at the system level. For more information about Workflows, see the Workflows section.

Message Received

The Message Received event is triggered when a message is received by Twilio.

Table 2. Properties
Source Phone Number The phone number Twilio received a message from.
Destination Phone Number The Twilio phone number which the message was sent to.
Message Content The body of the message that was sent.
Received Timestamp The time the message was received by Twilio.
Note: Source Phone Numbers includes local phone numbers. Local phone numbers can be filtered out in the Workflow.
Note: Utilizing Display blocks in Interactive Workflows can stop messages from being seen by the Workflows.

Asset Events

Asset events are events used to trigger Workflow actions at the asset level. For more information about Workflows, see the Workflows section.

Message Received from External Number

This event is triggered when a message is received by Twilio from the external number associated with the triggering phone asset.

Table 3. Properties
Message Content The body of the message that was sent.
Received Timestamp The time the message was received by Twilio.
Note: External Phone Numbers includes local phone numbers. Local phone numbers can be filtered out in the Workflow.
Note: Utilizing Display blocks in Interactive Workflows can stop messages from being seen by the Workflows.

Troubleshooting

Logs from the driver and Runtime can be viewed in the Debug Tools client. These messages contain information which can provide further context for issues during initialization, or while actively running. This can help diagnose problems.