In addition to receiving calls from Twilio within Cognigy.AI, you can also trigger Twilio to make a call.
Cognigy will use a HTTP Node to trigger Twilio to make a call and then connect the call back to a Cognigy.AI Flow.
For this, you need to perform the following steps:
First you need to set up a Flow and Twilio Voice Endpoint in Cognigy and connect them to a Twilio number as per Deploy a Twilio Voice Endpoint.
Twilio can host TwiML for you. For that, create a TwilML bin under Runtime. This TwiML is called from Cognigy.AI and tells Twilio what to do after the call connects.
You can see the TwiML to use below. Replace YOUR ENDPOINT URL with a valid Cognigy Endpoint URL.
<?xml version="1.0" encoding="UTF-8"?> <Response> <Redirect>YOUR ENDPOINT URL</Redirect> </Response>
Copy the TwiML Bin URL. You'll need it later.
Build a Flow that contains a HTTP Request Node with the following parameters:
|Payload is JSON||false|
|Authorization Type||Basic Auth|
You can find the Twilio Account SID and Auth Token on your Twilio Dashboard.
This HTTP Request will trigger the call, connect it to your Endpoint specified in the TwiML Bin and return a call SID, which you could use to tie sessions together using Contact Profiles.
Updated over 3 years ago