tap
tap
- tap(
params):Promise<CallTap>
Intercept call media and stream it to the specified WebSocket endpoint.
See tapAudio for a more specific method.
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
params
Object containing the parameters for tapping the call.
device
Destination device. Can be either WebSocket or RTP. See TapDevice.
audio
An object with the configuration for audio tapping. See audio parameters below.
direction
Direction to tap. Can be "listen" (what the caller hears), "speak" (what the caller says), or "both".
Returns
Promise<CallTap>
A promise that resolves to a CallTap object that you can use to
view the current state and results of the tap session.
Example
In this example, we dial a phone number and tap the call audio to a WebSocket endpoint. After the call is tapped, we play a TTS message to the caller, and then stop the tap and hangup the call.