For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions & Utilities
      • LiveWire
      • PomBuilder
      • Prefabs
      • SkillBase
      • SkillManager
      • SkillRegistry
      • Skills
      • SwaigFunction
      • SwmlBuilder
      • SWMLService
    • RELAY
      • Overview
      • Actions
      • Call
        • ai
        • aiHold
        • aiMessage
        • aiUnhold
        • amazonBedrock
        • answer
        • bindDigit
        • clearDigitBindings
        • collect
        • connect
        • denoise
        • denoiseStop
        • detect
        • disconnect
        • echo
        • hangup
        • hold
        • joinConference
        • joinRoom
        • leaveConference
        • leaveRoom
        • liveTranscribe
        • liveTranslate
        • on
        • pass
        • pay
        • play
        • playAndCollect
        • queueEnter
        • queueLeave
        • receiveFax
        • record
        • refer
        • sendDigits
        • sendFax
        • stream
        • tap
        • transfer
        • unhold
        • userEvent
        • waitFor
        • waitForEnded
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • ChatResource
      • Compat
      • Datasphere
      • Fabric
      • ImportedNumbersResource
      • Logs
      • LookupResource
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSubResource
      • Queues
      • Recordings
      • Registry
      • RestClient
      • RestError
      • Short Codes
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
RELAYCall

bindDigit

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

clearDigitBindings

Next
Built with

Bind a DTMF digit sequence to automatically trigger a RELAY method when the caller presses those digits. This enables in-call DTMF shortcuts without requiring an active collect operation.

Use clearDigitBindings() to remove bindings.

Parameters

digits
stringRequired

The DTMF digit sequence to bind (e.g., "*1", "##").

bindMethod
stringRequired

The RELAY calling method to execute when the digit sequence is detected (e.g., "calling.transfer", "calling.play").

bindParams
Record<string, unknown> | undefined

Parameters to pass to the bound method when triggered.

realm
string | undefined

A namespace for grouping digit bindings. Useful for selectively clearing bindings by realm.

maxTriggers
number | undefined

Maximum number of times this binding can be triggered. After reaching the limit, the binding is automatically removed.

Returns

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

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_API_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11
12 // Bind *0 to transfer to an operator
13 const result = await call.bindDigit('*0', 'calling.transfer', {
14 bindParams: { dest: 'operator' },
15 realm: 'shortcuts',
16 });
17 console.log(`Digit binding created: ${JSON.stringify(result)}`);
18
19 // Bind *9 to play a help message
20 await call.bindDigit('*9', 'calling.play', {
21 bindParams: { play: [{ type: 'tts', text: 'Press star-zero for an operator.' }] },
22 realm: 'shortcuts',
23 });
24});
25
26await client.run();