REST ClientCalling

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). Pass a control_id to name the tap so you can stop it later with tap_stop(). The response never carries control_id back — omit it and you have no way to stop this tap afterward.

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

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
client.calling.tap(
call_id="call-id-xxx",
control_id="tap-1",
tap={"type": "audio", "params": {"direction": "both"}},
device={"type": "ws", "params": {"uri": "wss://example.com/tap"}},
)