Skip to navigation

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

control_id is a caller-chosen identifier for this operation, unique per active operation of this kind on the call. The TypeScript SDK types it as optional, but the API requires it — a request that omits it is rejected.

Keep it to stop the tap later.

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 controlId = "tap-1";
await client.calling.tap(
"call-id-xxx",
{ type: "audio", params: { direction: "both" } },
{ type: "ws", params: { uri: "wss://example.com/tap" } },
{ control_id: controlId },
);