1
votes

I am trying to integrate Kore.ai bot with Twilio Voice.

I am using Studio Flow, which is triggered by API, then its performing outgoing call and then at some point I am using "Add TwiML redirect" widget, which allows me to talk to my Kore.ai bot. But then after I finish conversation with a bot it hangs up entire call (not sure if Kore.ai is responsible for hanging up or Twilio) and conversations seems to be ended. Still, looking at the logs you can see that flow is ongoing and I have to end it manually. Error shows that reason for this is unexpected event from TwiML redirect which is hangup.

Do you know how could I make TwiML redirect return different event?

Or if it can handle hangup event somehow?

Or if this needs to be handled on the Kore.ai side (change event that it sends at the end of flow - but to what?)?

Below are screens:

enter image description here enter image description here

enter image description here

1

1 Answers

2
votes

The Kore.ai webhook you're redirecting to needs to return TwiML to pass the control back to the Studio Flow as described in the docs for the TwiML Redirect widget.

Something like this:

<Response>
  <Say>Returning you back to the Studio Flow.</Say>
  <Redirect>https://webhooks.twilio.com/v1/Accounts/{AccountSid}/Flows/{FlowSid}?FlowEvent=return&foo=bar</Redirect>
</Response>

Have a look at the above mentioned docs and search for Returning control to Studio.