Rate this page:

TwiML™ Voice: <Leave>

The <Leave> verb is used in conjunction with <Enqueue> to manage control of a call that is in a queue.

When Twilio executes the <Leave> verb on a call, the call is removed from the queue and Twilio executes the next TwiML verb after the the original <Enqueue>.

Verb Attributes

The <Leave> verb doesn't support any attributes.

Example: Leaving a Queue

Consider the following scenario: There are several calls waiting in a call queue for a customer support agent. The customer support line closes at 9PM and the callers must be notified that they have been removed from the queue and will have to try again tomorrow.

The original call TwiML might look like this:

Loading Code Sample...

        Enqueue call in a closed line

        Configure wait.xml to play hold music before 9pm:

        Loading Code Sample...

              Play audio

              After 9PM, wait.xml dequeues the call and returns call control to the <Say> block in the original call TwiML:

              Loading Code Sample...

                    Leave a call

                    Rate this page:

                    Need some help?

                    We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                    Loading Code Sample...

                          Thank you for your feedback!

                          Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!