# VTScada and Twilio Inbound Access

- Link: https://www.agilicus.com/anyx-guide/vtscada-and-twilio/
- Published: 2024-05-14T00:25:43+00:00
- Author: Don Bowman

1. [Home](https://www.agilicus.com/)
 2. VTScada and Twilio Inbound Access

![vtscada-twilio-factory](https://www.agilicus.com/www/ac2583bf-vtscada-twilio-factory.
svg)

# VTScada and Twilio Direct Access Through Firewall

This is a technical walk through of how to set up Agilicus AnyX with Twlilio® and
VTScada for remote use without a VPN or DMZ. See the [Infosheet](https://www.agilicus.com/infosheet/zero-trust-vtscada-twilio-alerts/)
for a high level view.

The [Case Study](https://www.agilicus.com/case-studies/zero-trust-remote-operations-and-asset-management/)“
[Zero Trust Remote Operations and Asset Management](https://www.agilicus.com/case-studies/zero-trust-remote-operations-and-asset-management/)”
provides more detail on how this can be leveraged.

## 󠀁[Overview: VTScada (v12.1.30+) and Twilio Inbound Access](https://www.agilicus.com/anyx-guide/vtscada-and-twilio/ VTScada (v12.1.30+) and Twilio Inbound Access)󠁿

Twilio® requires inbound access for the Twilio Telephone API to interact with the
VTScada® environment. 

This can be challenging to achieve since it is never recommended to have a VTScada
system exposed to the Internet. 

Thin security policies like a port-forward or a DMZ are insufficient. 

In this example we show VTScada and Twilio Inbound Access without opening the firewall,
without a VPN, without a fixed IP, without port-forwarding.

## As of VTScada v12.1.30 

( [https://www.vtscada.com/general-release-v12-1-30/](https://www.vtscada.com/general-release-v12-1-30/)),

The use of custom address lists for server connections in the Thin Client/Server
Setup dialog simplifies the configuration steps and no longer requires custom SSL
certificate installations.

In this guide we are going to be making some changes to the VTScada setup. Notably:

 1. We will configure the Agilicus inbound server name in the VTScada address connection
    dialog
 2. We will create a Twilio endpoint on VTScada
 3. We will create an application in Agilicus AnyX
 4. We will select and enable a firewall rule in the Agilicus AnyX for the Twilio endpoint

This is a technical walk through of how to set up Agilicus AnyX with Twlilio® and
VTScada for remote use without a VPN or DMZ. See the [Infosheet](https://www.agilicus.com/infosheet/zero-trust-vtscada-twilio-alerts/)
for a high level view.

The [Case Study](https://www.agilicus.com/case-studies/zero-trust-remote-operations-and-asset-management/)“
[Zero Trust Remote Operations and Asset Management](https://www.agilicus.com/case-studies/zero-trust-remote-operations-and-asset-management/)”
provides more detail on how this can be leveraged.

### Requirements

The following requirements need to be satisfied in the VTScada configuration to 
enable Twilio:

 * VTScada must be version v12.1.30 or newer,
 * not be the free version, and must support alarms

 * The VTScada “Connection Addresses” dialog tab of thin client manager must be 
   configured with a host entry that matches exactly the Agilicus configured application
   hostname in the Server List.  In this walkthrough, we will be using the hostname**“
   waterdemo.cloud.egov.city”**

Additionally, to complete this exercise, you will need access to a Twilio account,
complete verification of the telephone number you wish to add to the roster, and
register a telephone number in your Twilio account.

In this guide, we will set up a VTScada environment to be authenticated by proxy.
This means a server will be available by a hostname, but no traffic will be allowed
to the VTScada environment until the authorization rules have been met. 

This may include identity and multi-factor credential verification. The Agilicus
AnyX will manage a valid third-party signed TLS certificate via our partner Let’s
Encrypt, configure to ensure the best practices for TLS are followed, and ensure
all network traffic is audited and subject to the additional access control measures
enabled through Agilicus AnyX.

## Agilicus AnyX Application Configuration

Use the ‘New Application’ stepper to create a new application. 

In this example, the endpoint we are creating will be called ‘waterdemo’ in the 
Organization using the cloud.egov.city subdomain.

Choose “My application is accessed: from my site via an onsite connector”

[⌊VTSCADA Twilio Integration: Send SMS alerts from your VTSCADA system using Twilio
and AnyX. Image shows the AnyX platform connecting VTSCADA with Twilio for reliable
SMS notifications, enhancing SCADA system monitoring and response.⌉⌊VTSCADA Twilio
Integration: Send SMS alerts from your VTSCADA system using Twilio and AnyX. Image
shows the AnyX platform connecting VTSCADA with Twilio for reliable SMS notifications,
enhancing SCADA system monitoring and response.⌉[

Configure the upstream service to match the server realm being used by VTScada. 
Here we can use the “Default” Realm server configured on HTTP Port 80 .

![VTSCADA Twilio Integration: Agilicus AnyX showing data flow between VTScada, AnyX,
and Twilio for SMS alerts and notifications. Learn how to connect your VTScada system
to Twilio using AnyX for reliable alarm delivery.](https://www.agilicus.com/www/
04320ae1-vtscada-1.png)

For the upstream local hostname/ip address, we can enter the IP address as used 
by the Realm server seen above (ie: 192.168.10.15 ).   If selecting the internal
hostname, enter the value of `hostname` lowercase (e.g. open a ‘cmd’ shell on the
VTScada machine and run that to get the exact computer name), ensure the host running
the Agilicus connector can both resolve the hostname locally, and has reachability
to the TCP port as well

![VTSCADA Twilio Integration: Using ANYX to connect VTSCADA alarm events to Twilio
SMS for reliable remote alarm notifications and enhanced SCADA monitoring.](https://
www.agilicus.com/www/a036a3ab-2024-06-18_15-32.png)

For authentication, select is authenticated by a proxy, has named users with a single
role.

[⌊VTSCADA Twilio Integration: Configure SMS alerts in VTSCADA using Twilio and ANYX.
Step-by-step guide to sending SMS notifications from your VTSCADA system for enhanced
monitoring and control. Agilicus ANYX enables seamless connectivity between VTSCADA
and Twilio.⌉⌊VTSCADA Twilio Integration: Configure SMS alerts in VTSCADA using Twilio
and ANYX. Step-by-step guide to sending SMS notifications from your VTSCADA system
for enhanced monitoring and control. Agilicus ANYX enables seamless connectivity
between VTSCADA and Twilio.⌉[

Navigate to Applications/Overview, and select the “Configure Application” action
for the newly created application. This will move you to the application’s details.

Choose the Security tab to configure the firewall to configure the Twilio firewall
rules. 

Open the ‘**Configure Application’** for the newly created VTScada application. 

Choose the **‘Security’** tab to configure the firewall. 

Create a new Firewall Rule allowing **POST** and **GET ** methods for anyone matching
the prescribed path.

The path can be described as containing the Realm name, Realm GUUID and Telecom 
specific syntax. 

The <realm> will be a GUUID and can be seen in the URL when loading up the Anywhere
Client, e.g. 48708544-07e3-4d1b-9b6e-ea8ace4b00fe.  

The GUUID follows a standard string pattern.

We can then **select** **one of three** Firewall rule option that employ ever stricter
limitations to access the VTScada server path for the Twilio endpoint.

The first rule, can use a Regular Expression to match the Twilio path with a GUUID
pattern across all Realms:

Option 1.

    ```wp-block-code
    /[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}/TELECOM/Twilio
    ```

![VTSCADA and Twilio integration architecture diagram. The diagram shows how VTSCADA
can send SMS notifications via Twilio. It illustrates the connection between VTSCADA,
AnyX, and Twilio for sending alarm notifications. This integration allows users 
to receive critical alerts directly on their mobile phones.](https://www.agilicus.
com/www/c66d8aba-2024-06-18_15-17.png)

If we wish to limit to the particular realm (eg: Default) , we can anchor (^) the
firewall rule and match the Realm specific URL path precisely.  This rule would 
be:

Option 2.

    ```wp-block-code
    ^/Default/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}/TELECOM/Twilio
    ```

![VTSCADA and Twilio integration using ANYX. The diagram illustrates data flow from
VT SCADA to ANYX, which triggers an SMS via Twilio. Ideal for SCADA alarm notifications
and remote monitoring solutions. Learn how to connect VT SCADA with Twilio for enhanced
alerting.](https://www.agilicus.com/www/f8828db2-2024-06-18_15-19.png)

Finally, if we wish to filter specifically for both the Realm and GUUID path, we
can anchor the path match (^) to the beginning of the URL and also the specific 
GUUID value.

Option 3.

    ```wp-block-code
    ^/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio
    ```

## VTScada Configuration

In the **“Thin client/Server setup”** menudialog,  select **“Connection Addresses”**
and configure the Agilicus external server name exactly as previously configured
in the Agilicus Application stepper (in this case, the waterdemo FQDN).  Make sure
to check the **“Secure”** checkbox and specify port **443**.

![VTSCADA and Twilio integration: ANYX platform enables SMS alerts from VTSCADA 
SCADA system via Twilio. Image shows ANYX architecture diagram for connecting VTSCADA
to Twilio for alarm notifications.](https://www.agilicus.com/www/fe6a3687-2024-06-
18_15-21.png)

![VTSCADA Twilio Integration: Configure SMS alerts in VTScada using Twilio for remote
monitoring and critical alarm notifications. Agilicus AnyX simplifies secure access
and enhances operational efficiency.](https://www.agilicus.com/www/f51702b1-2024-
06-18_15-23.png)

![VTSCADA Twilio Integration: Send SMS Alerts with ANYX. Screenshot of VTSCADA configuration
showing how to set up SMS notifications using Twilio and ANYX for critical system
alerts. Learn how to integrate VTSCADA with Twilio for reliable alarm delivery.](
https://www.agilicus.com/www/8a148032-2024-06-18_15-24.png)

Configure the user credentials, domain and realm in the Alarm properties. The realm
matches the configured realm and domain must be https://<agilicusexternalname>

## Testing the Alarm Call-Out

To test alarm call-out, use Idea-studio to create new page with “Roster Alarm Test”
widget

[⌊0024b716-image⌉⌊0024b716-image⌉[

The widget is located underTag Types\Communications\Alarm Notification\RosterAssign
the tag “Default Call-Out Off

[⌊52377a3d-image⌉⌊52377a3d-image⌉[

You can now use the newly created page to configure the roster and trigger an alarm.

Checking the checkbox will trigger an alarm.

Right clicking the checkbox will allow you to edit the call-out roster.

[⌊bcebdda9-image⌉⌊bcebdda9-image⌉[

Create a contact row. Link the contact to the user with alternate contact details.

[⌊e883e506-image⌉⌊e883e506-image⌉[

If you have successfully configured Twilio and Agilicus, you will receive a phone
call-out repetitively until the alarm is acknowledged after the roster callout checkbox
has been toggled. You can see the call-out status in the alarms page.

[⌊0247b9ee-image⌉⌊0247b9ee-image⌉[

## Troubleshooting

VTScada Twilio logs will also be present in your VTScada installation path under:

    ```has-small-font-size
     <VTScada Installation Path>\<Application Name>\Data\TwilioLogs 
    ```

New log files are only written when the max # of lines (configurable) is reached
or the application is stopped.  So it’s possible the log files for the current troubleshooting
session are not present until the application is stopped.

Here we can verify the callback URLs are being passed correctly to Twilio, in log
lines such as:

    ```has-small-font-size
      "Body": {
          "VoiceUrl": "https://waterdemo.cloud.egov.city/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio/3ea70e49-40fc-4c6a-87ad-9b8537e89ed2/Answer",
          "StatusCallback": "https://waterdemo.cloud.egov.city/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio/3ea70e49-40fc-4c6a-87ad-9b8537e89ed2/Status",
          "FallbackUrl": "https://waterdemo.cloud.egov.city/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio/3ea70e49-40fc-4c6a-87ad-9b8537e89ed2/Error",
          "VoiceMethod": "POST",
          "SmsUrl": "https://waterdemo.cloud.egov.city/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio/3ea70e49-40fc-4c6a-87ad-9b8537e89ed2/SMSMessage",
          "SmsMethod": "POST",
          "SmsFallbackUrl": "https://waterdemo.cloud.egov.city/Default/48708544-07e3-4d1b-9b6e-ea8ace4b00fe/TELECOM/Twilio/3ea70e49-40fc-4c6a-87ad-9b8537e89ed2/SMSError",
    ```
