executeRpc

View as MarkdownOpen in Claude

Execute a generic RPC method on a call. This is the low-level interface for cross-call communication. For common operations, prefer the specific helpers rpcDial(), rpcAiMessage(), and rpcAiUnhold().

Parameters

opts
objectRequired

RPC configuration object.

opts.method
stringRequired

RPC method name (e.g., "dial", "ai_message", "ai_unhold").

opts.params
Record<string, unknown>

Parameters for the RPC method.

opts.callId
string

Target call ID for the RPC command.

opts.nodeId
string

Target node ID for the RPC command.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .executeRpc({
5 method: 'custom_method',
6 params: { key: 'value' },
7 });