span8
span4
span8
span4
Building automated phone systems is easier than it has ever been with services such as Twilio. Twilio has built a communications platform transforming actions such as sending and receiving calls/SMS messages, which traditionally needed investment in significant hardware, into simple API calls. One use-case for Twilio is making automated calls to groups of people based on a set of business rules being true. However, what we really want to do is make intelligent automated calls - that is where location comes in - often notifications are only applicable if the user is in a certain location.
The first thing I have done is created a series of Twilio FME custom transformers that allow you to easily interact with Twilio in FME Desktop.
TwilioMakeCalls: Make automated calls, the content of the call can be set at runtime.
TwilioSendSMS: Send SMS messages, the message content including text and images can be set at runtime.
The scenario we will look at is related to flooding. Let’s say that we want to monitor real-time flood data, based on the level of the river dynamically generate flood plain maps, and then select everyone that lies within the floodplain and send them an automated message if there is a problem.
Flood data: The USGS provides real-time gage height and discharge for the whole of the USA now. We read in the data for the Gilmer County catchment.
Floodplain map: Point cloud data for the drainage basin including z values.
Users: A database of users who have subscribed to receive alerts. You will need to build a subscribe workflow to allow users to signup for the service, details on how to do that here.
We read the USGS feed every 1 minute using the schedule functionality on FME Server.
Using the point cloud data we can create polygons representing the different flood risk zones. I created two zones: people at immediate risk and people who need to be warned. The polygons are dynamically created based on flood height. For example, if the gauge is currently at 10ft - which is above the flood trigger level - we create the following polygons:
Immediate Risk: Containing the land mass below gauge height and up to 5 feet above gauge height.
Warning risk: Containing the land mass between 5 feet to 15 feet above gauge height.
These are the transformers we used to achieve this complex workflow, all 12 of them!
Now that we have selected our subscribers that are at risk of flooding we need to send them a notification to warn them. We do this using the Twilio web service. There are two custom transformers in the FME Store, TwilioMakeCall and TwilioSendSMS. Using the telephone number from the database we send the immediate risk people a automated call and the people at moderate risk a SMS.
We need to run this workspace every minute to check the latest data coming from USGS. To do this we publish the workspace up to FME Server and schedule it to run every minute. The failover and fault tolerance capabilities of FME Server ensures that the workspace will always run.
Hi @stewart.harper!
Thank you for the article, very informative and helpful! I have been trying to build a similar workspace using the TwilioSMSSender using a trial Twilio account. I have to verify each number I want to send the text to before it works, otherwise the TwilioSMSSender will not work. Is this the same with the paid version of Twilio? Because the purpose of my workspace kind of gets lost if I do need to verify each number... Thank you in advance!!
Hi @ev2019, Unless Twilio has changed, this wasn't the case for me when I was using the paid version. All I did was loaded about $30 of credit onto the account. I then had to choose the number I was sending from. After that, I could just send SMS out to any number. It was about 1 year ago since I tried it though.
Sending email, Part 5: Sending an email with attachments (2015)
Sending email, Part 1: Setting up a topic and an email subscriber (2015)
Receiving email, Part 3: Using email attachments (2015)
Sending email, Part 3: Sending an email when a workspace completes (2015)
Receiving email, Part 1: Setting up a topic and an email address (2015)
Sending email, Part 2: Sending an email using the FMEServerNotifier (2015)
Sending email, Part 4: Sending prettier email using HTML (2015)
Receiving email, Part 2: Processing email with a workspace (2015)
© 2019 Safe Software Inc | Legal