Skip to content

Add P25 Call Alert (TSBK 0x1F) decoding with plugin hook#1143

Merged
robotastic merged 2 commits into
masterfrom
call-alert-cleanup
Jun 27, 2026
Merged

Add P25 Call Alert (TSBK 0x1F) decoding with plugin hook#1143
robotastic merged 2 commits into
masterfrom
call-alert-cleanup

Conversation

@robotastic

Copy link
Copy Markdown
Collaborator

Picks up #1126 from @hoosierscanner and finishes the wiring that was
described in the original patch notes but not actually included.

What the original PR did

  • Added CALL_ALERT = 18 to MessageType (parser.h)
  • Decoded TSBK 0x1F in p25_parser.cc — extracts source unit (bits
    16–39) and target unit (bits 40–63), sets message.message_type,
    message.source, message.talkgroup, logs at info level
  • Added a case CALL_ALERT: to the dispatch switch in
    monitor_systems.cc (empty break)

What this PR adds on top

The CALL-ALERT-PATCH.md in the original PR claimed it added a
unit_call_alert plugin hook, but those changes weren't actually in
the diff — the switch case was a no-op so plugins never saw the
event. Fixed here:

  • Plugin_Api::unit_call_alert(System*, long source_id, long talkgroup)
    no-op default in plugin_api.h — backward-compatible with existing
    plugins
  • plugman_unit_call_alert(...) declared in plugin_manager.h and
    implemented in plugin_manager.cc, matching the
    plugman_unit_answer_request pattern
  • unit_call_alert() helper in monitor_systems.cc, and the
    CALL_ALERT case now calls it so plugins actually receive the event

Also drops three files from the original PR that don't belong in the
tree:

Test plan

  • cmake .. && make trunk-recorder builds cleanly
  • Run against a live P25 system, confirm tsbk1f Call Alert lines
    appear with correct source/target unit IDs
  • Confirm a plugin that overrides unit_call_alert receives the
    event

Credits: original decoding work by @hoosierscanner in #1126.

hoosierscanner and others added 2 commits May 30, 2026 08:36
Decodes Call Alert messages from the P25 control channel:
- Extracts source unit ID (bits 16-39) and target unit ID (bits 40-63)
- Sets message_type = CALL_ALERT and populates source/talkgroup fields
- Logs at info level: tsbk1f\tCall Alert\tSource Unit: X\tTarget Unit: Y
- Adds CALL_ALERT case to monitor_systems.cc message dispatch switch

Includes Dockerfile and patch script for building against a pinned
upstream commit to maintain plugin ABI compatibility.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The original PR added CALL_ALERT decoding and a switch case, but left
the case as an empty break so plugins never saw the event. This adds
the missing plugin-manager hooks the patch notes described:

- Plugin_Api::unit_call_alert(...) no-op default in plugin_api.h
- plugman_unit_call_alert(...) in plugin_manager.{h,cc}, matching the
  unit_answer_request pattern
- unit_call_alert() helper in monitor_systems.cc, and the CALL_ALERT
  case now actually calls it

Also drops files that don't belong in the tree:
- CALL-ALERT-PATCH.md (developer patch notes, not user docs)
- Dockerfile.call-alert (builder-specific Dockerfile)
- patches/simplestream-dangling-pointer.patch (already merged in #1107)
@robotastic

Copy link
Copy Markdown
Collaborator Author

Let's do this!

@robotastic robotastic merged commit e63b1a4 into master Jun 27, 2026
2 checks passed
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.

2 participants