EDA.Voice.Payload (EDA v0.3.0)

Copy Markdown View Source

Voice Gateway JSON payload builders (v8).

Voice Gateway opcodes:

  • 0: IDENTIFY
  • 1: SELECT_PROTOCOL
  • 3: HEARTBEAT
  • 5: SPEAKING
  • 7: RESUME

Summary

Functions

Builds a DAVE_MLS_COMMIT_WELCOME payload (OP 28).

Builds a DAVE_MLS_INVALID_COMMIT_WELCOME payload (OP 31).

Builds a DAVE_MLS_KEY_PACKAGE payload (OP 26).

Builds a DAVE_READY_FOR_TRANSITION payload (OP 23).

Builds a HEARTBEAT payload with the given nonce and seq_ack.

Builds an IDENTIFY payload for voice gateway authentication.

Builds a RESUME payload for reconnecting to the voice gateway.

Builds a SELECT_PROTOCOL payload with our IP discovery results and encryption mode.

Builds a SPEAKING payload.

Functions

dave_mls_commit_welcome(commit_bytes, welcome_bytes \\ nil)

Builds a DAVE_MLS_COMMIT_WELCOME payload (OP 28).

Per DAVE spec this opcode is sent as a binary frame: <<28, commit::binary, welcome::binary>> where welcome is optional.

dave_mls_invalid_commit_welcome(transition_id)

Builds a DAVE_MLS_INVALID_COMMIT_WELCOME payload (OP 31).

Sent when the client cannot process a commit or welcome, triggering the gateway to remove and re-add the member.

dave_mls_key_package(key_package_bytes)

Builds a DAVE_MLS_KEY_PACKAGE payload (OP 26).

Per DAVE spec this opcode is sent as a binary frame: <<26, mls_key_package::binary>>.

dave_ready_for_transition(transition_id)

Builds a DAVE_READY_FOR_TRANSITION payload (OP 23).

Confirms to the gateway that the client is ready for the protocol/epoch transition.

heartbeat(nonce, seq_ack \\ 0)

Builds a HEARTBEAT payload with the given nonce and seq_ack.

identify(server_id, user_id, session_id, token, dave_version \\ 0)

Builds an IDENTIFY payload for voice gateway authentication.

When dave_version is > 0, includes DAVE protocol negotiation using max_dave_protocol_version.

resume(server_id, session_id, token)

Builds a RESUME payload for reconnecting to the voice gateway.

select_protocol(ip, port, mode)

Builds a SELECT_PROTOCOL payload with our IP discovery results and encryption mode.

speaking(ssrc, speaking \\ true)

Builds a SPEAKING payload.

Flags:

  • 1: Microphone (normal voice)
  • 2: Soundshare (go live / screen share audio)
  • 4: Priority speaker