sendDigits

View as MarkdownOpen in Claude

Send DTMF tones on the call. Use this to navigate IVR menus on outbound calls or to send tone signals.

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

Parameters

digits
stringRequired

The DTMF digit string to send. Valid characters: 0-9, *, #, A-D, W (0.5s pause), w (1s pause).

controlId
string | undefined

Custom control ID. Auto-generated if not provided.

Returns

Promise<Record<string, unknown>> — Server response confirming the sendDigits operation.

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
12 const result = await call.sendDigits('1w2');
13 console.log(`Digits sent: ${JSON.stringify(result)}`);
14});
15
16await client.run();