tap

View as MarkdownOpen in Claude

Start tapping audio from an active call and sending it to an external endpoint (e.g., a WebSocket or RTP destination). Returns a control_id for stopping the tap.

Request

idstringRequiredformat: "uuid"
The unique identifying ID of an existing call.
paramsobjectRequired
An object of parameters that will be utilized by the active command.

Response

Call LegobjectRequired
Returned when the call is a standard PSTN, SIP, or WebRTC call.
OR
Fabric Subscriber Device LegobjectRequired

Returned when the call is a Fabric subscriber device leg. The status field is always null for this type.

Example

import { RestClient } from "@signalwire/sdk";
const client = new RestClient({
project: "your-project-id",
token: "your-api-token",
host: "your-space.signalwire.com"
});
const result = await client.calling.tap("call-id-xxx", {
tap: { type: "audio", params: { direction: "both" } },
device: { type: "ws", params: { uri: "wss://example.com/tap" } },
});
const controlId = result.control_id;