0

I am trying to make a call to zoom phone's shared line group using Twilio. I've also set a TwiML so that a message is played when the call is picked up. My code is written as below in Go.

func main() {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    client := twilio.NewRestClient()

    params := &api.CreateCallParams{}
    params.SetTwiml("<Response><Say>My auto-generated message goes here</Say></Response>")

    params.SetTo("${my_zoom_phone_number}")
    params.SetFrom("${my_twilio_phone_number}")

    _, err := client.Api.CreateCall(params)
    if err != nil {
        fmt.Println(err.Error())
    }
}

When I make a call using the above implementation, the message starts playing when the zoom phone starts to ring, so by the time I answer the phone, it would be halfway through the message. When I tried the same implementation but changed it so it would call my personal iPhone, the message started playing once I picked up the call, which is what I expect to happen for when I call my zoom phone account.

I've also tried to check what the call status is for when I call my iPhone vs when I call my zoom phone and here is what I got.

Call status log

The first try is when I called my iPhone, and since I waited a few seconds before picking up the phone, the time between ringing and in_progress seems reasonable. The second try is when I called my zoom phone, and the status immediately changed from ringing to in_progress even though the phone is still ringing. Does anyone have an idea as to why this is happening, and how to fix this?

achang
  • 1
  • 1

1 Answers1

0

Try the "AnswerOnBridge" parameter:

If <Dial> is the first TwiML verb in your TwiML document, 
answerOnBridge="true" will cause the inbound call to ring until the dialed 
number answers.

If your inbound call is a SIP call, Twilio will send a 180 or 183 to your 
SIP server once it connects to Twilio. It will wait until the <Dial> call 
connects to return a 200.

The Zoom number may be SIP/VOIP and signaling an acceptance of the call, but then playing an audio ringing sound until the Zoom telecom actually connects the call into the Zoom conference (which you can hear). The above documentation refers to an inbound call but this also seems to impact outbound Dials. There is some additional explanation on the this page about Dial Verb Enhancements.

There is another StackOverflow post that describes similar behavior.

Should be an easy fix for you to try by adding the parameter. If it doesn't, the issue is likely that Zoom has delays bringing calls into conferences (which is normal). A solution would be for your application to use the Pause verb to create a delay between when Zoom answers and your Say. You'll probably find that the Zoom delay is not super consistent so it may be hard to get an exact Pause value and will either have too long a Pause on some calls or a cutoff Say on other calls.

Hope this helps!

jassent
  • 529
  • 3
  • 10