Member Junction
    Preparing search index...
    • Builds the NCCO (Nexmo Call Control Object) that opens a bidirectional WebSocket media leg to the agent's media endpoint — the Vonage analogue of Twilio's <Connect><Stream>. A connect action with a websocket endpoint is the full-duplex form: Vonage streams inbound caller audio to the socket AND plays back outbound audio frames the agent writes — the leg the agent needs.

      Pure + exported so it unit-tests with no network and the MJAPI POST /telephony/vonage/answer router can return it verbatim.

      Parameters

      • mediaWssUrl: string

        The wss://… media endpoint Vonage connects the call's audio to.

      • contentType: string = 'audio/l16;rate=8000'

        The wire content-type (defaults to audio/l16;rate=8000 — 8 kHz linear, the PSTN rate).

      • Optionalheaders: Record<string, unknown>

        Optional metadata headers Vonage forwards on the websocket handshake.

      Returns NccoAction[]

      The NCCO document (a JSON array of actions) to return to Vonage.