Skip to navigation

Calling

View as MarkdownOpen in Claude

The Calling resource provides REST-based call control through the RestClient. All 37 commands are dispatched as POST requests to a single endpoint (/api/calling/calls) with a command field identifying the operation.

Access via client.calling on a RestClient instance.

Every method takes the call ID first, then any required command fields as positional arguments, then an optional options object for the remaining fields. The options object also accepts extras, a bag of additional fields merged into the command as-is. A final optional requestOptions argument sets the timeout, retries, and abort signal for that one request.

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const call = await client.calling.dial("+15551234567", "+15559876543", {
url: "https://example.com/call-handler",
});
const controlId = "greeting-1";
await client.calling.play(call.id, [{ type: "tts", params: { text: "Hello!" } }], { control_id: controlId });
await client.calling.playStop(call.id, controlId);
await client.calling.end(call.id, { reason: "hangup" });

Unlike the Relay client which uses persistent WebSocket connections, the Calling namespace sends each command as an independent HTTP request. This is suitable for server-side orchestration where you do not need real-time event streams.

Methods

Call Lifecycle

Call Control

Media and Playback

Recording

Input Collection

Detection

Audio Tap

Audio Streaming

Noise Reduction

Transcription and Translation

AI Session Control

Fax

SIP

Custom Events