Search code examples
twiliotwilio-apitwilio-twiml

Twilio - Update call in function to studio flow


Is it possible to upgrade a call that is currently being handled in a twilio function to a studio flow?

Something like:

  await client.calls(event.CallSid).update({
    method: 'POST',
    url: encodeURI('https://studio.twilio.com/v2/Flows/FWABVCEFDFD/Executions')
  })

And have that call start going through the studio flow? Or can studio flows only be started by an incoming call to a number or triggered to start a new call out to another number?


Solution

  • You can’t redirect an active call to a Studio Flow. You need to somehow kick it off from a Studio Flow, use the TwiML Redirect Widget to kick it to a Twilio Function and do what you need to do, the redirect back to that Studio Flow which is waiting for the return.

    Otherwise you need to dial into the Studio flow using a DID to kick it off, which isn’t ideal from a cost perspective.