Skip to content

Add unit_call_alert for P25 Call Alert (TSBK 0x1F) messages#8

Open
hoosierscanner wants to merge 1 commit into
TrunkRecorder:mainfrom
hoosierscanner:feature/call-alert
Open

Add unit_call_alert for P25 Call Alert (TSBK 0x1F) messages#8
hoosierscanner wants to merge 1 commit into
TrunkRecorder:mainfrom
hoosierscanner:feature/call-alert

Conversation

@hoosierscanner
Copy link
Copy Markdown

Summary

Adds unit_call_alert() to the mqtt_status plugin to publish P25 Call Alert events (TSBK opcode 0x1F) to MQTT.

Call Alerts are directed unit-to-unit pages — one radio paging another with no audio. Previously these were silently discarded.

Topic

topic_unit/<shortname>/call_alert

Payload

{
  "sys_num": 1,
  "sys_name": "pscsite4",
  "unit": 4810011,
  "unit_alpha_tag": "",
  "target_unit": 4811289,
  "target_unit_alpha_tag": ""
}

Depends on

Requires CALL_ALERT message type and unit_call_alert plugin API added to trunk-recorder core:

Verified

Tested on a live P25 system. Call Alert events decode correctly, publish to MQTT, and are received by downstream consumers.

🤖 Generated with Claude Code

Publishes directed unit-to-unit page events to MQTT when trunk-recorder
decodes a Call Alert (TSBK opcode 0x1F). Call Alerts contain only source
and target unit IDs — no audio, no talkgroup.

Topic: topic_unit/<shortname>/call_alert
Payload:
  {
    "sys_num": 1,
    "sys_name": "pscsite4",
    "unit": 4810011,
    "unit_alpha_tag": "",
    "target_unit": 4811289,
    "target_unit_alpha_tag": ""
  }

Requires the CALL_ALERT message type added to trunk-recorder core:
  TrunkRecorder/trunk-recorder#1126

Verified on a live P25 system — call_alert events fire correctly and
are received by downstream consumers (tr-engine).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hoosierscanner added a commit to hoosierscanner/tr-engine that referenced this pull request Apr 11, 2026
⚠️  DEPENDS ON TWO UPSTREAM PRs — DO NOT MERGE UNTIL BOTH ARE IN:
    1. TrunkRecorder/trunk-recorder#1126 — decodes TSBK 0x1F into
       CALL_ALERT message type and dispatches via plugin API
    2. TrunkRecorder/tr-plugin-mqtt#8 — implements unit_call_alert()
       in mqtt_status plugin, publishes to tr/units/{sys}/call_alert

Without those two PRs, trunk-recorder will never emit call_alert MQTT
messages and this handler will never fire.

---

Ingest (internal/ingest/):
- router.go: routes tr/units/{sys}/call_alert → unit_event handler
- messages.go: adds TargetUnit/TargetUnitAlphaTag fields to UnitEventData
- handler_units.go: handles call_alert subtype — upserts both source
  and target units, stores target_unit in metadata_json, publishes SSE
  as unit_event:call_alert with target_unit/target_unit_alpha_tag fields
- router_test.go, handler_units_test.go: full test coverage for routing,
  payload parsing, and round-trip

API (openapi.yaml):
- Adds call_alert to EventType enum
- Documents target_unit/target_unit_alpha_tag SSE payload fields

Web UI:
- events.html: red bold CALL ALERT badge, Unit A → Unit B detail,
  dedicated filter checkbox
- index.html (Event Horizon): call alert row in rate meter (red),
  red streak in background canvas
- omnitrunker.html: red CALL ALERT badge, target unit in TG columns,
  Call Alert filter option
- omnitrunker-classic.html: same as omnitrunker
- irc-radio-live.html: 🚨 CALL ALERT: UnitA → UnitB posted to *status
  (no talkgroup affiliation, so it goes to the system status channel)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant