Problems when the receiver of the call redirects it to another number

earranz
earranz
edited May 24 in Voice

Good afternoon,

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?

Thank you!

Answers

  • Just as an update, we have discovered some more information regarding this problem.

    It happens when the receiver side uses a SIP system and sends to twilio an INVITE with the encoding codec G729 that twilio does not support. With that twilio sends a 488 Not Acceptable here SIP response and closes the call.

    Since we are not the ones managing the SIP trunk, is there a way to force the receiver to use another codec?

    Thank you!

If this is an emergency, please contact Twilio Support. This is not an official Support channel. https://support.twilio.com/
Have an urgent question?
Please contact Twilio Support. This is not an official Support channel.
Contact Support