Twilio outbound call hold disconnecting callee

176 Views Asked by At

I am implementing hold function in Twilio. Whenever I call the hold function, the callee is getting disconnected. The code below only applies to the caller, not the callee.

if call_sid:
    client = Client(self.account_sid, self.auth_token)
    twiml_string = """
         <Response>
             <Enqueue>xx</Enqueue>
         </Response>
    """
    client.calls(call_sid).update(method="POST", twiml=twiml_string)
1

There are 1 best solutions below

0
On BEST ANSWER

You will want to use a Conference and anchor the legs, so you don't have one leg disconnect as is happening above, when you modify it.

Call Control Concepts

Conference Participant Resource

*Reference: Place a participant on hold with music (Code Example)