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

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