How do I return to a Studio Flow after playing a custom voice message to a person?
Here's the code:
if(calledNumber == "+11234567890")
{
twiml.say("Biden is closed.");
}
return callback(null, twiml)
With this code above, it hangs up the call after telling me that Biden is closed instead of returning to my flow.
If I try it with a redirect like Twilio says is required:
if(calledNumber == "+11234567890")
{
twiml.say("Biden is closed.");
twiml.redirect({method: 'POST},'https://webhooks.twilio.com/v1/Accounts/<accountSID>/Flows/<flowSID>')
}
return callback(null, twiml)
... the Twilio logs show that the URL for the Studio Flow is called twice, the first call returning the valid TwiML but no redirect URL, and the second call has all the proper paramters (Called, CallSid, etc.), but a completely empty body.
The calls just... quit. How can I get back to my flow?
Using a TwiML Redirect isn't an option because the TwiML needs to be customized, not static. Thank you!