Accepts the websocket media leg for an inbound call already delivered by the answer webhook.
The inbound call UUID from the webhook.
Places an outbound call via the Vonage Voice API (POST /v1/calls) with an NCCO that connects a
bidirectional websocket to the agent's media leg.
Destination number (E.164).
The agent's Vonage number / verified caller-id the call originates from.
Optionalargs: Record<string, unknown>Provider-specific options (event-webhook URL, websocket media URL, recording flags, …).
The created call UUID.
Discards the audio Vonage has QUEUED on the media leg (sends the {"action":"clear"} websocket
command). Called on barge-in so the agent's not-yet-played voice is dropped instead of draining
Vonage's deep (~60s) playback queue over the caller's new turn.
The call UUID whose queued outbound audio to flush.
Ends the call (Voice API PUT /v1/calls/:uuid with { action: 'hangup' }).
The call UUID to hang up.
Registers the call-ended callback (event-webhook completed/failed/rejected/cancelled or the
websocket close event).
The call UUID.
Invoked when the call ends.
Registers the inbound DTMF callback (NCCO input/dtmf results delivered to the event webhook).
The call UUID.
Invoked with each received DTMF digit string.
Registers the inbound websocket audio callback for the call (what the agent hears).
The call UUID whose inbound media to subscribe to.
Invoked with each inbound PCM audio frame.
Sends DTMF digits on the call (Voice API PUT /v1/calls/:uuid/dtmf with { digits }).
The call UUID.
The DTMF digit string.
Pushes one outbound audio payload onto the call's websocket media leg (the agent's voice).
The call UUID whose media leg to write to.
The audio bytes (the adapter encodes to the websocket media frame).
Transfers the live call (Voice API PUT /v1/calls/:uuid with { action: 'transfer', destination: { type: 'ncco', ncco: [...] } }).
The call UUID to redirect.
The transfer destination.
The minimal Vonage client surface VonageCallSdk drives. A production deployment implements this over the real
@vonage/server-sdk(Voice API) + a websocket media handler; this package never imports@vonage/server-sdkso it builds and tests with no network. When no bindings are supplied, VonageCallSdk throws the explicit "bind the real Vonage client" error from every operation.The shapes are intentionally tiny and provider-neutral at the value level (strings / byte buffers) so the Vonage SDK's types do not leak into the bridge package.