clearDigitBindings

View as MarkdownOpen in Claude

Clear all digit bindings, optionally filtered by realm.

Parameters

realm
string | undefined

If provided, only clear bindings in this realm. If omitted, all bindings are cleared.

Returns

Promise<Record<string, unknown>> — Server response confirming the bindings were cleared.

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();
// Bind some digit shortcuts
await call.bindDigit('*0', 'calling.transfer', {
bindParams: { dest: 'operator' },
realm: 'shortcuts',
});
// Later, remove all shortcut bindings
const result = await call.clearDigitBindings('shortcuts');
console.log(`Bindings cleared: ${JSON.stringify(result)}`);
});
await client.run();