Skip to navigation

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

import { RelayClient } from '@signalwire/sdk';
const client = new RelayClient({
project: process.env.SIGNALWIRE_PROJECT_ID!,
token: process.env.SIGNALWIRE_API_TOKEN!,
contexts: ['default']
});
client.onCall(async (call) => {
await call.answer();
const result = await call.sendDigits('1w2');
console.log(`Digits sent: ${JSON.stringify(result)}`);
});
await client.run();