Commit Graph
6 Commits
Author SHA1 Message Date
Audric 05c4c88ff3 Require matching trunk section names and cap audio debug at 500 frames
Trunk link matching now requires the peer's hello ID (section name) to
match the local [TRUNK_x] section name. Both sides of a trunk link must
use the same section name, agreed upon by both sysops. This replaces
the previous matching by secret+prefix only.

BREAKING CHANGE: existing deployments must rename their [TRUNK_x]
sections so both sides use the same name for each link.

Also cap TRUNK_DEBUG audio frame logging at 500 frames per trunk link
to prevent excessive log output during sustained transmissions.
2026-04-05 18:22:04 +02:00
Audric 4e6bff7962 Merge /config into /status and remove /config endpoint
All static configuration fields (version, local_prefix, listen_port,
http_port, mode, satellite/satellite_server) are now included directly
in the /status JSON response. The /config endpoint is removed.
2026-03-29 15:29:45 +02:00
Audric accb4b3686 Fix bidirectional trunk routing and monitoring client notifications
Two bugs prevented real-world trunk conversations from working:

1. onTrunkTalkerUpdated only notified clients selected on a TG, not
   clients monitoring it. SvxLink repeaters monitoring a foreign TG
   never received MsgTalkerStart and could not auto-switch. Fixed by
   adding TgMonitorFilter to trunk talker broadcasts, matching the
   existing behavior of onTalkerUpdated for local talkers.

2. Trunk TG routing was one-way: when a client visited a foreign TG,
   isSharedTG forwarded to the owner, but the owner had no return
   path. Added per-link peer interest tracking — when a peer sends
   MsgTrunkTalkerStart for a TG, the receiving side records interest
   and forwards local activity on that TG back. Interest refreshes
   on audio, expires after 10 minutes idle, clears on disconnect.

New integration test verifies the full round-trip: client-A talks on
a foreign TG, monitoring client-B receives the notification, client-B
replies, and client-A receives audio back through the trunk.
2026-03-28 19:09:38 +01:00
Audric eca3c71122 Fix TG number substring match in log grep and remove debug logging
The interactive tester's log parser matched "TG #1" as a substring of
"TG #12001", "TG #10", etc., causing false positives for short TG numbers.
Use a regex negative lookahead (?!\d) so "TG #1" only matches when not
followed by another digit. Same fix applied to test_15 satellite routing.

Also remove debug logging accidentally left in TrunkLink::onLocalTalkerStart.
2026-03-27 15:19:13 +01:00
Audric d2f4acffcd Add satellite integration tests
5 new tests covering satellite protocol: handshake and /status visibility,
audio delivery from satellite to parent's local clients, trunk-to-satellite
audio forwarding, satellite audio routed to trunk peers via parent, and
disconnect cleanup. Reflector-a acts as the satellite parent with a
[SATELLITE] section; a SatellitePeer class connects as a fake satellite
using MsgTrunkHello with ROLE_SATELLITE.
2026-03-27 14:58:51 +01:00
Audric 685d7253ff Fix trunk receive-side TG filtering and add integration test suite
The receive-side handlers (handleMsgTrunkTalkerStart, handleMsgTrunkAudio,
etc.) used isSharedTG() which only checks the remote peer's prefix. This
caused non-cluster TGs to be silently dropped on the receiving reflector —
e.g. a client on reflector-a talking on TG 40001 (owned by reflector-b)
would never reach reflector-b because reflector-b checked the TG against
reflector-a's prefix instead of its own.

Add isOwnedTG() that accepts TGs matching either the local or remote
prefix, and use it in all four receive handlers. The send-side still uses
isSharedTG() (remote prefix only) which is correct.

Also add a Docker-based integration test suite (tests/) with 11 automated
tests covering handshake, routing, cross-reflector audio delivery, cluster
TGs, heartbeat, disconnect cleanup, and trunk-to-trunk isolation. An
interactive mode lets users test arbitrary TG numbers with routing verified
via reflector logs. Topology is defined once in tests/topology.py.

Fix Dockerfile to copy built shared libraries to the runtime image.
2026-03-27 14:43:57 +01:00