RELAYCall

queue_leave

View as MarkdownOpen in Claude

Remove the call from a queue.

This method emits calling.call.queue events. See Call Events for payload details.

Parameters

queue_name
strRequired

Name of the queue to leave.

control_id
Optional[str]

Custom control ID. Auto-generated if not provided.

queue_id
Optional[str]

Specific queue ID to leave (if the call is in multiple queues with the same name).

status_url
Optional[str]

URL to receive queue status webhooks.

Returns

dict — Server response confirming the call left the queue.

Example

1import asyncio
2from signalwire.relay import RelayClient
3
4client = RelayClient(
5 project="your-project-id",
6 token="your-api-token",
7 host="your-space.signalwire.com",
8 contexts=["default"],
9)
10
11@client.on_call
12async def handle_call(call):
13 await call.answer()
14
15 # Enter the queue
16 await call.queue_enter(queue_name="support")
17
18 # Remove from queue after a timeout
19 await asyncio.sleep(300) # 5 minute max wait
20 await call.queue_leave(queue_name="support")
21 await call.play([{"type": "tts", "text": "No agents available. Please try again later."}])
22 await call.hangup()
23
24client.run()