queueEnter

View as MarkdownOpen in Claude

Place the call into a named queue. The caller waits in the queue until they are dequeued by another operation (such as an agent picking up) or removed via queueLeave().

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

Parameters

queueName
stringRequired

Name of the queue to enter.

controlId
string | undefined

Custom control ID. Auto-generated if not provided.

statusUrl
string | undefined

URL to receive queue status webhooks (position updates, dequeue events).

Returns

Promise<Record<string, unknown>> — Server response confirming the call entered the queue.

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11 await call.play([{ type: 'tts', text: 'You are being placed in the support queue.' }]);
12
13 // Enter the queue
14 await call.queueEnter('support', {
15 statusUrl: 'https://example.com/queue-status',
16 });
17
18 // The call stays in the queue until an agent dequeues it
19});
20
21await client.run();