rpcAiMessage

View as MarkdownOpen in Claude

Inject a message into the AI agent running on another call. Useful for cross-call coordination, such as notifying a held caller’s agent about a status change or instructing it to relay information.

Parameters

callId
stringRequired

Call ID of the target call whose AI agent should receive the message.

messageText
stringRequired

The message text to inject into the target AI’s conversation.

role
stringDefaults to system

Role for the injected message. Typically "system" for instructions.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .rpcAiMessage('call-id-123', 'The caller needs help with billing.');