Module streams

Module streams 

Source
Expand description

Query functions for the streams table.

The streams table stores captured D-STAR voice transmissions from Tier 3 deep connections. Each row represents one complete or in-progress voice stream: the D-STAR header metadata, optional slow-data fields (text message, DPRS position), the decoded MP3 audio blob, and upload lifecycle state.

ยงLifecycle

  1. Tier 3 calls insert_stream when a voice header arrives, creating a row with audio_mp3 = NULL and ended_at = NULL.
  2. When the stream ends (EOT or timeout), Tier 3 calls update_audio to fill in the MP3 blob, final frame count, and end timestamp.
  3. The upload processor picks up rows with upload_status = 'pending' and non-null audio_mp3 via the uploads module.

Structsยง

AudioUpdate ๐Ÿ”’
Parameters for updating a stream after voice capture and MP3 encoding complete.
NewStream ๐Ÿ”’
Parameters for inserting a new stream row.
StreamRow ๐Ÿ”’
A single row from the streams table.
StreamStatusCounts ๐Ÿ”’
Aggregated counts of streams grouped by upload_status.

Functionsยง

count_by_status ๐Ÿ”’
Returns aggregated upload-status counts for the streams table.
insert_stream ๐Ÿ”’
Inserts a new stream row and returns its auto-generated id.
query ๐Ÿ”’
Queries streams with optional filters on reflector, time window, and limit.
update_audio ๐Ÿ”’
Updates a stream with the encoded MP3 audio, end timestamp, and frame count.