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
- Tier 3 calls
insert_streamwhen a voice header arrives, creating a row withaudio_mp3 = NULLandended_at = NULL. - When the stream ends (EOT or timeout), Tier 3 calls
update_audioto fill in the MP3 blob, final frame count, and end timestamp. - The upload processor picks up rows with
upload_status = 'pending'and non-nullaudio_mp3via theuploadsmodule.
Structsยง
- Audio
Update ๐ - Parameters for updating a stream after voice capture and MP3 encoding complete.
- NewStream ๐
- Parameters for inserting a new stream row.
- Stream
Row ๐ - A single row from the
streamstable. - Stream
Status ๐Counts - Aggregated counts of streams grouped by
upload_status.
Functionsยง
- count_
by_ ๐status - Returns aggregated upload-status counts for the
streamstable. - 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.