tap

View as Markdown

tap

  • tap(params): Promise<CallTap> - See CallTap for more details.

Intercept call media and stream it to the specified WebSocket endpoint. Prefer using tapAudio if you only need to tap audio.

This is an experimental method. The destination must be a hosted WebSocket/RTP server, with an address that SignalWire can reach.

A current limitation of this method is that the destination device does not receive any metadata regarding the origin of the stream.

Parameters

NameTypeDescription
paramsObject-
params.deviceTapDeviceDestination device. Can be either WebSocket or RTP.
params.audioObjectAn object with the configuration for audio tapping. See “audio parameters” below.

Audio parameters

NameTypeDescription
audioObject-
audio.direction"listen" | "speak" | "both"Direction to tap. Can be "listen" (what the caller hears), "speak" (what the caller says), or "both".

Returns

Promise<CallTap> - See CallTap for more details.

Example

1const tap = await call.tapAudio({
2 device: {
3 type: "ws",
4 uri: "wss://example.domain.com/endpoint",
5 },
6 audio: {
7 direction: "both",
8 },
9});
10
11await tap.stop();