The wss://… Media-Streams endpoint Twilio connects the call's audio to.
Optionalparameters: Record<string, string>Optional custom <Parameter> name/value pairs Twilio echoes back on the start frame
(start.customParameters). MJ passes the per-call media token here so the websocket can be authenticated.
The TwiML document string to return to Twilio (REST twiml param or webhook response body).
Builds the outbound-dial / inbound-answer TwiML that opens a bidirectional Media-Streams websocket to the agent's media endpoint.
<Connect><Stream>(not<Start><Stream>) is the bidirectional form: Twilio both sends inbound audio AND accepts outboundmediaframes on the same socket — the full-duplex leg the agent needs.Pure + exported so it unit-tests with no network and the MJAPI router can reuse it verbatim.