Based on the documentation for the TwiML <Leave>
verb, when a caller exits a queue, their call should continue executing the call logic following the <Enqueue>
that caused them to enter the queue. In my case, my callers enter the queue by processing this TwiML:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Enqueue>business</Enqueue>
<Say>Sorry, no one is currently available. Please leave a message.</Say>
<Record action="${endpoint}/hangup" timeout="10" transcribeCallback="${endpoint}/voicemailHandler"/>
</Response>
Later, I am executing this Javascript logic to trigger the removal of a member from the queue:
await twilioClient
.queues(queueSid)
.members('Front')
.update({url: `${endpoint}/leave`})
The /leave
endpoint directs the member to this bit of TwiML:
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Leave />
</Response>
I'm running into an issue where, once the Javascript executes, instead of hearing the <Say>
, the call just ends and the caller is disconnected. Am I misunderstanding the documentation? If so, how should I restructure my logic to achieve my desired result?