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). Returns a control_id for stopping the tap.

Request

idstringRequiredformat: "uuid"
The unique identifying ID of a 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

Example

1from signalwire.rest import RestClient
2
3client = RestClient(
4 project="your-project-id",
5 token="your-api-token",
6 host="your-space.signalwire.com",
7)
8
9result = client.calling.tap(
10 call_id="call-id-xxx",
11 tap={"type": "audio", "params": {"direction": "both"}},
12 device={"type": "ws", "params": {"uri": "wss://example.com/tap"}},
13)
14control_id = result.get("control_id")