Skip to main content

Module protocol

Module protocol 

Source
Expand description

The wire protocol: JSON lines.

The recorder starts a plugin’s executable with no arguments and writes one HostMessage per line to its stdin; the plugin writes one PluginMessage per line to its stdout. stderr is the plugin’s log. Either side ignores message types and fields it doesn’t know, so both can grow within an API_VERSION.

plugin --describe prints the plugin’s Manifest (one JSON object) and exits.

Modules§

base64
Standard base64 (for AudioChunk::pcm).
format
Audio formats a plugin can ask for (Manifest::audio_formats). WAV is always there.
topic
What a plugin can subscribe to (Manifest::subscribe).

Structs§

AudioChunk
A slice of a recording call’s audio: 16-bit mono PCM, little-endian, base64.
CallFiles
CallInfo
A call as it starts or ends.
CallRecord
Trunk Recorder’s call JSON. Fields this crate doesn’t name are in extra.
ConcludedCall
A recorded call whose files are on disk.
Endpoint
A service a plugin talks to, and how it’s answering.
FreqEntry
Hello
HostInfo
Manifest
Who a plugin is and what it wants — printed by plugin --describe.
Metrics
A plugin’s figures (PluginMessage::Metrics). Every field is optional: send what you know. Totals are since the plugin started.
Shutdown
SrcEntry
A radio heard on the call.
Status
SystemInfo
SystemStatus
UnitEvent
Something a radio did on the control channel.

Enums§

EndpointState
HostMessage
Level
Outcome
PluginMessage
State

Constants§

API_VERSION
The protocol version. A plugin states the version it was built for in its manifest; the recorder runs plugins whose api it supports.
CONVENTIONAL
The index calls and events use for the first conventional system; the next ones count down from it (65534, 65533, …). Each is a system of its own in Hello::systems, with its own short name and settings.
EXIT_CONFIG
Exit status of a plugin that can’t run with its configuration: the recorder shows the error and doesn’t restart it until recording next starts. (Any other exit is a crash, and the plugin is restarted with backoff.)