# customer/defined

Method: CHANNEL
Version: 1.0.0

## Message:

  - `ConnectRequest` (unknown)

  - `ConnectResponse` (unknown)

  - `AudioFrame` (unknown)
    Raw PCM (Pulse Code Modulation) audio bytes transmitted as a binary WebSocket frame.
**Format:** 16-bit signed linear PCM, mono (single channel), little-endian byte order.
**Frame size:** Audio should be sent in 20ms chunks. At 8 kHz this is 320 bytes per frame (160 samples × 2 bytes);
at 16 kHz it is 640 bytes per frame. Larger chunks are accepted but increase latency.
The sample rate is determined by the value specified in the SVAML `connectStream` command. Raw PCM audio bytes sent as a WebSocket binary message

  - `StreamControl` (unknown)
    Commands that can be executed on an ongoing stream.

## Message payload:

  - `command` (string, required)
    Connect message
    Enum: "connect"

  - `version` (integer, required)
    Protocol version
    Enum: "1"

  - `callId` (string, required)
    Call unique identifier

  - `applicationKey` (string, required)
    Service unique identifier

  - `codec` (string, required)
    Audio codec used for encoding binary audio frames transmitted over the WebSocket connection.
Audio frames are 16-bit signed linear PCM, mono (single channel), with little-endian byte order.
    Enum: "PCM"

  - `sampleRate` (integer, required)
    Audio sample rate in Hertz (Hz). The value is negotiated at call setup via the SVAML `connectStream` command.
Higher sample rates provide better audio quality but increase bandwidth and processing requirements.
- **8000 Hz**: Narrowband telephony quality (standard PSTN)
- **16000 Hz**: Wideband quality, suitable for most voice applications
- **24000 Hz**: High-quality voice
- **44100 Hz**: CD-quality audio
- **48000 Hz**: Professional audio standard
- **96000 Hz**: Ultra high-quality audio

For calls traversing the PSTN, audio is typically sampled at 8 kHz; using a higher value will not improve perceived quality.
    Enum: "8000", "16000", "24000", "44100", "48000", "96000"

  - `callHeaders` (object, required)
    Arbitrary key/value pairs (header name -> header value).

  - `command` (string, required)
    Response to the incoming connection request.
    Enum: "answer", "busy", "reject"

  - `command` (string)
    Enum: "clear", "heartbeat"

