Docs · v0.5.3

Plugins

Plugins are separate programs the recorder runs while it records: uploaders, streamers, scripts. The config says which run and with what settings, recorder-wide under the top-level plugins and per system under each system's plugins. This page lists those keys. For installing, updating and setting up plugins, see using plugins and each plugin's own page.

{
  "plugins": {
    "openmhz": { "enabled": true, "settings": { "server": "https://api.openmhz.com" } }
  },
  "systems": [
    { "shortName": "dcfd", "type": "p25", "sites": [{ "controlChannelsHz": [857987500] }],
      "plugins": { "openmhz": { "apiKey": "...", "systemName": "dcfd" } } }
  ]
}

Plugins are installed from the Plugins page, or with trunk-pro plugin install <id>, into plugins/<id>/ beside the config file. Installing one doesn't turn it on; the config does. The Plugins page and Setup's Plugins tab edit these keys for you, with a form built from each plugin's own description of its settings. Plugins are a desktop feature; the browser version has none.

Recorder-wide settings

The top-level plugins object is keyed by plugin id. Each entry:

Key Required Default Type Description
enabled false bool Run it while recording
settings null any Its settings for the whole recorder, as the plugin's own schema describes them (the config schema in its manifest; trunk-pro plugin describe <executable> prints it)
path "" string Run this executable instead of the installed one: a build of your own, while developing a plugin. Use an absolute path
shareDecrypted false bool Give it calls decrypted with your keys (their audio and files). See Decrypted calls
sitesOff [] integer array The sites (by their id) it's turned off for: their radio activity and status aren't sent to it, nor a recorded call only they heard. In Setup: Sites on the system's card
systemsOff [] integer array The systems (by id) it's turned off for: nothing about them is sent to it (of totals, their sites' and channels' figures; the radios' still are). In Setup: Systems on its card

A plugin with no entry is off. Unknown keys in an entry are dropped on save.

Per-system settings

Each trunked or conventional system's plugins object is keyed by plugin id too. What goes inside is whatever that plugin's per-system schema (system_config in its manifest) asks for: typically an API key and the system's name or ID on the service.

{ "shortName": "wmata", "type": "smartnet",
  "plugins": { "openmhz": { "apiKey": "...", "systemName": "wmata" },
               "broadcastify": { "apiKey": "...", "systemId": 1234 } } }

Plugins know each system by its shortName. Renaming a system in Setup carries its plugin settings with it; renaming it by hand in the file is fine too, since the settings live inside the system.

Overriding the recorder-wide settings

override in a system's settings for a plugin changes those of the plugin's recorder-wide settings the plugin lets a system set again (system_overrides in its manifest), for that system alone, such as sending its calls to another server. Settings it leaves out are the recorder-wide ones. A required setting, such as Rdio Scanner's server, can be left empty recorder-wide when every system that uses the plugin overrides it.

{ "shortName": "dcfd", "type": "p25",
  "plugins": { "rdioscanner": { "apiKey": "...", "systemId": 3,
                                "override": { "server": "https://rdio.example.org" } } } }

In Setup, each plugin that offers some has a shared settings section on a system's card for this. Any other key is ignored, with a warning in its log; its card in Setup → Plugins lists the systems with such keys (Ignored overrides), and Remove clears them. An uploader keeps a separate queue for each server it sends to, so a server that's down doesn't hold up uploads to the others.

Settings for each site

perSite in a system's settings for a plugin gives each of its sites, by the site's id, its own values for those of the plugin's per-system settings the plugin lets a site set again (site_overrides in its manifest). Settings a site leaves out are the system's.

{ "shortName": "dcfd", "type": "p25",
  "sites": [{ "id": 7, "name": "north", … }, { "id": 8, "name": "south", … }],
  "plugins": { "broadcastify": { "apiKey": "...", "systemId": 42,
                                 "perSite": { "8": { "systemId": 77 } } } } }

A call south heard goes to Broadcastify system 77, and one only north heard to 42. In Setup, each site has a row of its own on the system's card. Keys the plugin doesn't offer are ignored, with a warning in its log. Each site gets its id when the config is read, and keeps it through renames.

Several copies of a plugin

A list in place of one object runs the plugin more than once for the system, to upload to two places, say. Each copy has its own settings, and its own override:

"plugins": { "rdioscanner": [
  { "apiKey": "...", "systemId": 3 },
  { "apiKey": "...", "systemId": 1, "override": { "server": "https://club.example.org" } }
] }

The second copy (and any after it) runs as a process of its own, rdioscanner#2, with its own data folder (plugin-data/rdioscanner#2/), for the systems that have a second copy. In Setup, Add plugin on a system's card adds one.

Choosing talkgroups

Everywhere the recorder takes a list of talkgroups (an uploader's talkgroups for a system, a delay, a signal) it reads the entries the same way:

Entry Means
8001 That talkgroup
1000-1099 Every talkgroup from 1000 to 1099, both included (1099-1000 works too; spaces around the dash are fine)
507* Every talkgroup whose number starts with 507: * stands for any digits, any number of them
12??? Every five-digit talkgroup starting with 12: ? stands for one digit

Separate entries with commas, spaces or semicolons: 1001 1000-1099, 507*. The form says when an entry is none of these, and a plugin with such an entry won't start, naming it (dcfd's talkgroups: "10O1" isn't a talkgroup…).

The uploaders (OpenMHz, Broadcastify, Rdio Scanner) have a Talkgroups menu on each system's card:

Choice talkgroupMode Uploads
Every talkgroup "all" Every talkgroup
Only some "only" The talkgroups in Only these (talkgroupAllow), less any in Except these (talkgroupDeny)
All but some "allBut" Every talkgroup but those in Except these (talkgroupDeny)

Only some needs at least one entry in Only these: with none, the plugin won't start. A list the choice doesn't use is kept, hidden, for when it's chosen again. With no talkgroupMode, the plugin takes every talkgroup, whatever the lists say.

"plugins": { "broadcastify": { "apiKey": "…", "systemId": 1234,
  "talkgroupMode": "only", "talkgroupAllow": ["1000-1099", "507*"], "talkgroupDeny": ["1050"] } }

Delays

Plugins can be given calls late: a while after they end, for talkgroups that are sensitive, or for a service that asks for a delay. Delays are rules in a pluginDelays list, at the top of the config (every system) and in any trunked or conventional system (that system). Each rule picks calls by its keys, and a key left out picks everything:

Key Required Default Type Description
plugins every plugin array Plugin ids. One copy of a plugin is id#2, id#3…
talkgroups every talkgroup array Only these talkgroups: numbers, ranges ("1000-1099") and patterns ("507*", "12?45"), as strings or numbers (Choosing talkgroups)
exceptTalkgroups none array Not these, of those talkgroups picks: the same kinds of entry. With talkgroups left out, the rule is for every talkgroup but these
delayS 0 number How long, in seconds (Setup asks in minutes). 0 is no delay, to let something through that a broader rule delays
{
  "pluginDelays": [{ "plugins": ["broadcastify"], "delayS": 120 }],
  "systems": [
    { "shortName": "dcfd", "type": "p25", "sites": [{ "controlChannelsHz": [857987500] }],
      "pluginDelays": [
        { "talkgroups": ["1000-1099"], "delayS": 1800 },
        { "talkgroups": ["1000-1099"], "plugins": ["rdioscanner"], "delayS": 0 },
        { "plugins": ["broadcastify"], "delayS": 0 }
      ] }
  ]
}

When several rules pick the same call for a plugin:

  1. A rule that narrows another replaces it. A rule narrows another when it picks only calls the other picks: a system's rule narrows a top-level one, a rule naming talkgroups narrows one that doesn't, and a rule naming plugins narrows one for every plugin. (Talkgroups are compared as written: ["1001"] is inside ["1001", "1002"], but not inside ["1000-1099"]. A rule is inside one with exceptTalkgroups only when it excepts those too, so "all but 1001" narrows a rule for every talkgroup, but "only 1001" and "all but 2000" are compared by length.)
  2. Of the rules left, the longest delay wins.

So a sensitive system's or talkgroup's delay is never cut short by a plugin's own delay, while a system can still change one plugin's delay for itself. With the example above, Broadcastify gets dcfd's talkgroups 1000–1099 after 30 minutes and dcfd's other calls at once (its own 0 narrows the top-level 2 minutes), and other systems' calls after 2 minutes. Rdio Scanner gets everything at once. Every other plugin gets 1000–1099 after 30 minutes.

In the app, each delay's Talkgroups is a menu: Every talkgroup, Only (with a list, and another of those to leave out) or All but (with the list to leave out). To delay everything on dcfd for 30 minutes but its talkgroup 1001, add one delay of 30 for All but 1001:

"pluginDelays": [{ "exceptTalkgroups": ["1001"], "delayS": 1800 }]

What a delay holds back, for each plugin it applies to:

  • Finished calls wait in plugin-hold/ beside the config, one file each, so a restart doesn't lose them. When their time comes, they go to the plugin if it's running and recording has started. A call waiting for a plugin that's no longer running (turned off, removed), or no longer allowed decrypted calls, is dropped, and the plugin's log says so.
  • Live events about the call (it starting and ending, a unit's activity on its talkgroup) are delayed the same, in memory only.
  • Live audio of a delayed call isn't streamed to that plugin at all.

A call's files stay until every plugin it was held for has had it: the plugin's hour to report on a call counts from when it's given the call. With a RAM spool, held calls wait there; the spool's sweep for forgotten files waits the longest delay longer.

In Setup, a plugin's card on the Plugins tab sets its delay on every system, and Plugin delays on every system below the cards holds the other top-level rules. A system's card has Plugin delays under Plugins for its own, with what they come to for each plugin. The Plugins page shows how many calls are waiting for each plugin.

When changes apply

A change to the delays applies at once, without restarting the plugins, to the calls already waiting too: shortening one lets them go sooner.

A change to a plugin's recorder-wide settings alone is sent to the running plugin as it runs, if it takes its settings that way. Otherwise a change to one plugin's settings (its settings, a system's or site's settings for it, systemsOff, sitesOff, shareDecrypted) restarts that plugin alone, at once, even while recording: it finishes what it was already sent, and what comes meanwhile waits for it. Turning a plugin on or off, its path, a copy more or fewer, or recording.m4a restarts all the running plugins. The OpenMHz, Broadcastify, Rdio Scanner and upload-script plugins save calls still waiting in plugin-data/<id>/queue.jsonl, so a restart doesn't lose them.

Files

Installed plugins (plugins/<id>/), their data (plugin-data/<id>/), calls waiting out a delay (plugin-hold/) and the plugin store's index are kept beside the config file: see Files kept beside the config.

This page on GitHub · written for v0.5.3