tap
Start a media tap that streams call audio to an external endpoint. Supports
WebSocket (wss://, ws://) and RTP (rtp://) destinations.
Raises ValueError if direction is not "speak", "listen", or "both",
if codec is not "PCMU" or "PCMA", or if rtp_ptime is not a positive integer.
Parameters
uri
Destination URI for the media stream. Supported formats:
"rtp://IP:port"— RTP stream"ws://example.com"— WebSocket stream"wss://example.com"— Secure WebSocket stream
control_id
Identifier for this tap. Pass the same ID to stop_tap() to end this
specific tap. If omitted, a default ID is generated.
direction
Audio direction to tap.
"speak"— what the party says"hear"— what the party hears"both"— both directions
codec
Audio codec for the stream.
"PCMU"— G.711 mu-law"PCMA"— G.711 A-law
rtp_ptime
Packetization time in milliseconds for RTP streams. Must be a positive integer.
status_url
URL to receive tap status change webhooks.
Returns
FunctionResult — self, for chaining.