Page 1 of 1

Release 7.2.0, Beta 1 - Support for Twilio Studio Flows

PostPosted: Wed May 09, 2018 4:56 pm
by FlyingDiver
Now has a new action for initiating a Twilio Studio Flow via the REST API. Requires a Flow SID (from your Twilio Portal) and a destination phone number.

All the heavy lifting for using this is done in Twilio Studio. I'll be writing up an example that does the following:

1. Makes a voice call to a given phone number. Plays a message via TTS.

2. Waits for a DTMF tone (number input).

3. Makes an HTTPS request back to Indigo via my HTTPd plugin. The number entered on the phone is included in the HTTPS request, which is saved to a variable.

Indigo can trigger on changes to that variable to do whatever you want.

For security purposes, a random authentication code (16 digit alphanumeric) is generated by the plugin and sent as part of the request to Twilio. It's also stored in a state for the Twilio device.

The example Flow includes that auth code with the http request back to Indigo. The triggered Indigo script should compare the auth code in the httpd_ variable against the last_auth state in the device to verify that the request is legitimate. I have not yet implemented this in my testing.

You will need the current pre-release Twilio plugin: https://github.com/FlyingDiver/Indigo-Twilio/releases
And the pre-release HTTPd plugin: https://github.com/FlyingDiver/Indigo-HTTPd/releases

The HTTPd plugin was updated because Twilio does not send the Basic Authentication header unless it gets a 401 reply from an initial request without the header.

Re: Release 7.2.0, Beta 1 - Support for Twilio Studio Flows

PostPosted: Wed May 09, 2018 5:10 pm
by Colorado4Wheeler
That's super cool, I may have to install this plugin just to play with this!

Re: Release 7.2.0, Beta 1 - Support for Twilio Studio Flows

PostPosted: Wed May 09, 2018 7:31 pm
by FlyingDiver
First cut at the instructions for setting this all up are at https://github.com/FlyingDiver/Indigo-T ... o-Flow-API

Re: Release 7.2.0, Beta 1 - Support for Twilio Studio Flows

PostPosted: Mon Jun 04, 2018 8:19 am
by whmoorejr
I'm already having a lot of fun with this. Many thanks for piecing this together.

Re: Release 7.2.0, Beta 1 - Support for Twilio Studio Flows

PostPosted: Mon Jun 04, 2018 8:30 am
by FlyingDiver
I've marked the updated HTTPd plugin as released. That was a pretty minor change.

I'm going to look at the Twilio plugin again this week and see if anything else needs to be added.