Problems when the receiver of the call redirects it to another number
We have built a web dialer that uses the programmable voice service. The service works fine with almost all kinds of flows. We have a client JS dialer that uses your JS SDK, and we have a Java backend service that generates all the TwiML responses needed.
The basic flow is pretty simple: we take the incoming call from the web dialer and route it with the following TwiMl response to the final receiver:
<Response> <Dial action="[ourCallBackURL]" answerOnBridge="true" callerId="..." record="record-from-answer-dual"> <Number statusCallback="..." statusCallbackEvent="initiated ringing answered completed">[number of the reciever]</Number> </Dial> </Response>
Wich works fine and the call is properly routed to the proper phone number.
The problem that we are facing is that when the receiver of the puts the call on hold or redirects you to another number, Twilio is sending us an event to the actions endpoint saying that the has been completed and no further information reaches our backend. So the call get's hanged and never redirected to the new number.
I am sure that there has to be a way to handle these scenarios because they are pretty common when calling numbers with extensions, or commercial numbers where the caller gets redirected to different numbers.
I am guessing that somehow the first finishes and we need to open a second one at the action response. But we don't have enough information at the request to know how to open the second .
Just to make the point trickier, it happens with some kinds of redirects and holds, but not with others.
How can we handle this kind of flows?
- 58 All Categories
- 13 Community - Events
- 12 Twilio Relay Developer Conference 2021 Mega Thread
- 1 TwilioQuest Contest!
- 4 Community - Announcements
- 39 Community - Product Discussions
- 1 Functions
- 3 Studio
- 1 Autopilot
- Twilio CLI
- 2 Conversations
- Super SIM
- Elastic SIP Trunking
- 2 WhatsApp API
- 2 Twilio Flex
- 1 SMS
- 4 Voice
- 23 Video & WebRTC
- Community- Twilio Startups
- 2 Community - Other Discussions