tap
Intercept call media (audio) and stream it to an external destination such as a
WebSocket or RTP endpoint. Returns a
TapAction that you can use to stop
the tap or wait for it to finish.
This method emits calling.call.tap events. See Call Events for payload details.
Parameters
tap
Tap configuration specifying which audio to intercept.
tap.type
Tap type. Valid values: "audio".
tap.params
Tap parameters. Supports a direction key with the following values:
"listen"— capture audio heard by the caller"speak"— capture audio spoken by the caller"both"— capture audio in both directions
device
Destination device for the tapped media.
device.type
Device type.
"ws"— WebSocket endpoint"rtp"— RTP endpoint
device.params
Device-specific parameters (e.g., uri for WebSocket, addr/port for RTP).
controlId
Custom control ID. Auto-generated if not provided.
onCompleted
Callback invoked when the tap operation ends.
Returns
Promise<TapAction> — An action handle with
stop() and wait() methods.