rpcDial

View as MarkdownOpen in Claude

Dial out to a phone number with a destination SWML URL that handles the outbound call leg. This is commonly used in call screening scenarios: place the caller on hold with hold(), then dial out to a human whose call is handled by a separate SWML agent.

Parameters

toNumber
stringRequired

Phone number to dial in E.164 format.

fromNumber
stringRequired

Caller ID to display in E.164 format.

destSwml
stringRequired

URL of the SWML document that handles the outbound call leg. The SWML at this URL typically runs a screening agent that can accept, reject, or take a message.

deviceType
stringDefaults to phone

Device type for the outbound leg.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .rpcDial('+15551234567', '+15559876543', 'https://example.com/swml');