I'm currently building an IVR flow using Twilio Studio, and I'm facing an issue with handling calls. Here's an overview of the flow:
1.I initiate an outgoing call to the user using the "Make Outgoing Call" widget.
2.After the user answers, I ask some IVR questions.
3.Upon correct answers, I connect the call to my employee using TwiML like this:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Dial>
<Number
statusCallbackEvent="answered"
statusCallback="{{call_back_url}}/yes/{{attempt}}/{{flow_id}}"
statusCallbackMethod="POST">
{{doctor_number}}
</Number>
</Dial>
<Redirect>
https://webhooks.twilio.com/v1/Accounts/xxx/Flows/xx?FlowEvent=return&test=success&child_call_sid={{ChildCallSid}}&child_call_status={{child_call_status}}&child_call_duration={{child_call_duration}}
</Redirect>
</Response>
The problem arises when the user ends the call (parent call); it terminates both the parent and child calls. However, I want to keep the child call active even if the parent call ends so that I can reconnect the user with my agent or employee.
How can I achieve this in Twilio Studio? Is there a way to hold the child call independently of the parent call?
In a Voicecall, if either the caller or the callee disconnect, then all call legs will end.
If you do not want this behavior, then use a Voice Conference. A Voice Conference can be setup to not end if one of the members hangs up. This totorial "How to build a conference call line with Twilio Studio" will walk you through the setup. Using a "conference" even with only two callers works great and unlocks many features only available within the conference.