djangotwiliotwilio-python

Twilio outbound call hold disconnecting callee


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)

Solution

  • 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)