README:
- Quick start: drop the Docker command block. The repo ships no ready-to-run
svxreflector.conf (only the .conf.in template) and the compose bind-mount
hits the 'auto-create a directory' trap, so the inline 'docker compose up'
steps fail for a newcomer. Point step 1 at the template and step 2 at
INSTALL.md / DOCKER.md instead.
- Section 5 routable example: use real countries with ISO-alphabetical section
names (TRUNK_DE_IT, TRUNK_DE_FR) per the naming standard, plus a clearly
sub-national name for the regional uplink; real MCCs (IT 222, DE 262, FR 208).
docs/DOCKER.md:
- Rewrite step 1: you must create config/svxreflector.conf before first start;
warn about the bind-mount directory trap and how to recover; copy from the
.conf.in template; link the README quick start and INSTALL.md.
docs/DEPLOYMENT_ITALY.md + _IT.md:
- Add a 'Reaching international TGs' section (EN + IT): the national mesh needs
an international gateway plus ROUTABLE_PREFIXES on each region's gateway trunk
to reach foreign TGs; notes on '*' for a single-uplink leaf and BLACKLIST
precedence.
- tests/test_satellite_secrets.py: remove a stale internal spec path from the
module docstring; describe the per-satellite secret resolver rule directly.
- .gitignore: drop local-only working-artifact patterns and their headings;
those paths are now ignored via the untracked .git/info/exclude so no tracked
file names them. Kept the neutral .worktrees/ rule.
The gateway example (section 2) only traced the foreign->Zone direction,
which works via gateway prefix routing because the gateway holds the direct
trunk. The reverse — a regional Zone client calling an international TG —
does NOT work by default: the Zone's prefix table has only 222 + Zone
prefixes, so a foreign TG matches nothing and stays local. Without
ROUTABLE_PREFIXES a regional reflector can never call an international TG.
Add a subsection to section 2 (in both TOPOLOGY_EXAMPLES.md and the PDF
source topology.html) showing the Zone uplink config
(ROUTABLE_PREFIXES=262,240 alongside REMOTE_PREFIX=222), the explicit-prefix
rule for a multi-trunk Zone vs the '*' default route for a single-uplink
leaf, and the multi-trunk '*' warning. Cross-links to README section 5 and
CONCEPTS.md. Rebuilt TOPOLOGY_EXAMPLES.pdf.
A reflector does not impose the prefix convention on its nodes. Make explicit
the third routing case (previously undocumented): a TG matching no prefix in
the mesh has no owner and stays local-only (relayed among the reflector's own
nodes, never trunked), exactly like stock SvxReflector.
Routing is decided solely by longest-prefix-match on the number itself,
regardless of length: a conforming number is routable wherever its prefix
points *if that prefix is owned by a reflector in the mesh* (e.g. 22210->222
Italy, 26201->262 Germany); a non-matching number (e.g. short 1-199 in a
typical MCC scheme) stays local and is unreachable by international traffic.
Conversely a 'local' number that happens to match a configured prefix will be
routed to that owner.
Use real in-repo MCC examples (222/262) instead of unassigned 201/401, and
state the 'if owned in the mesh' precondition. Updated README (How TG
ownership works), CONCEPTS.md (section 2), and TOPOLOGY_EXAMPLES.md; rebuilt
TOPOLOGY_EXAMPLES.pdf from the matching topology.html change.
International trunk sections are named TRUNK_<ISO>_<ISO> using each
country's ISO 3166-1 alpha-2 code with the two codes in alphabetical order
(e.g. TRUNK_DE_FR, TRUNK_DE_IT). Sorting alphabetically makes the name
deterministic so both sysops independently arrive at the same section name
with no 'my country first' dispute.
This convention was already used and explained in WW_DEPLOYMENT.md but was
only a passing 'readable convention' note in INSTALL.md and absent from the
README section-name rule (the most-read spot). State it as the standard in
README section 4 and INSTALL.md section 6b, with the rationale.
ROUTABLE_PREFIXES is read and applied locally per link (matchesRoutable /
isSharedTG / collectAllTrunkPrefixes); it is never sent on the wire
(absent from ReflectorMsg.h / MsgPeerHello) and is not validated against the
peer. It therefore does NOT need to be identical on both ends of a link -
only the section name and SECRET must match. The previous wording implied
forward-path symmetry and that the return leg relies solely on interest;
both were imprecise. Clarify the per-direction model and the return-leg
options (downstream ROUTABLE_PREFIXES or peer interest; * leaf via interest
+ wildcard accept).
Additive newcomer docs building on the onboarding intro:
- docs/CONCEPTS.md: the bridge between the README glossary and the wire-level
PEER_PROTOCOL.md. Explains TG-ownership/longest-prefix-match, owner-relay,
peer interest (+10-min timeout), cluster TGs (single-hop), and talker
arbitration (lower nonce wins), with a worked three-way-QSO walkthrough.
- docs/TROUBLESHOOTING.md: symptom-first checklists (trunk won't connect,
audio won't cross, one-way audio, satellite/twin issues, flapping links),
grounded in the real connect/routing rules and pointing at /status + logging.
- README: add a Contents TOC, a 'Which setup fits my deployment?' table that
surfaces the topology decision guide near the top, and index both new docs.
All in-page anchors and cross-doc links verified.
Both docs existed but were absent from the README Documentation list:
TWIN_PROTOCOL.md was only mentioned in a feature bullet, and
MCC_COUNTRY_CODES.md was only reachable via a link inside INSTALL.md.
Every docs/*.md is now indexed from the README.
test_routable.py is now wired into run_tests.sh (commit bdba042), so the
suite no longer runs on a 'separate stack'. Update TESTS.md: two phases ->
three phases (89 tests), add the routable run step, fix the orchestrator
summary and the file-table entry (it uses unittest, not pytest), and
reword the twin/routable section headers that called them 'separate'.
The README opened assuming the reader already runs SvxReflector, with no
plain-language explanation of what a reflector or talk group is and no
zero-prerequisite path to a running instance.
- Add a 'New to SvxLink reflectors? Start here' section: a four-bullet
plain-language overview plus an 8-term glossary (node, reflector, talk
group, trunk, prefix, cluster TG, satellite, twin). Existing operators
get a skip-ahead link.
- Add a 'Quick start - one standalone reflector' section making clear that
trunking is optional, with a minimal accurate config snippet and a
three-step Docker run.
- Fix stale facts: test count 18 -> 89 across six suites; /status example
version 1.0.0 -> 1.3.99.13+trunk.twin2.
The routable-prefix suite (added with the ROUTABLE_PREFIXES feature) had a
test file and docker-compose.routable.yml but was never invoked by the
runner, so it was silently skipped. Add a ROUTABLE phase after the TWIN
tests (generate --topology routable, bring up the dedicated mesh, run
test_routable.py, tear it down) and extend the cleanup trap to down the
routable compose file on interrupt.
Full suite now runs 89 tests: 52 trunk + 7 mqtt + 5 satellite-secrets
+ 6 logging + 17 twin + 2 routable.
- Replace wrong "ownership caveat" in all three files with a neutral
delegation note: a more specific routable prefix intentionally delegates
that sub-range via longest-prefix-match; point it at the reflector that
actually owns those TGs.
- Fix the README example: align it with the actual test topology
(leaf 222100 → natlit 222 → natlde 262 → far 263, two transit nodes,
three trunk links); every REMOTE_PREFIX now equals the peer's LOCAL_PREFIX
with no collisions; add the natlde return-path trunk section.
- Add a sentence in both README and PEER_PROTOCOL.md explaining that the
*-leaf accepts returning audio via matchesRoutable on its inbound-accept
gate (hasPrefixRoute cannot serve this role since * is not in m_all_prefixes).
- Fix tests/TESTS.md: remove non-existent topology_routable.py reference
(routable topology lives in topology.py/ROUTABLE_REFLECTORS, generated by
python3 generate_configs.py → docker-compose.routable.yml); correct
"two hops away" to "two transit nodes away (three trunk links)".
Document both forward and return legs of the 263xx transit chain in
topology.py ROUTABLE_REFLECTORS comment block, making clear that
natlde's routable entry toward natlit is the return-path hop and that
the natlit→leaf final hop is carried by peer-interest (not a routable
entry). Add inline note on natlde's entry.
Drop ROUTABLE_NAMES from topology.py (dead — test files define their own
sorted() locals, matching the REFLECTOR_NAMES/TWIN_NAMES convention).
Remove duplicate sys.path.insert and unused COMPOSE_FILE/TESTS_DIR
constants from test_routable.py. Add clarifying comment above the
per-peer routable/blacklist injection in generate_configs.py.
Generated configs are byte-identical; no topology routing changes.
Adds an isolated 4-node chain topology (leaf → natlit → natlde → far) to
exercise the planned ROUTABLE_PREFIXES feature. TG 26305 is owned by `far`
(prefix 263) which is unreachable from `leaf` without transit; test_01
asserts forward + return audio delivery and fails until the C++ feature lands.
test_02 asserts that BLACKLIST_TGS=26307 on leaf's uplink vetoes that specific
TG while leaving 26305 unaffected.
Files added/modified:
tests/topology.py — ROUTABLE_REFLECTORS dict + port/secret helpers
tests/generate_configs.py — generate_routable_reflector_conf/docker_compose +
ROUTABLE_PREFIXES/BLACKLIST_TGS emission in
per-peer trunk loop; routable in default run
tests/test_routable.py — new test file (mirrors test_twin.py pattern)
tests/docker-compose.routable.yml — generated chain compose (4 services)
Extend the curses status monitor to render the fork-specific /status
sections below the node table:
- TRUNKS: endpoint, connection direction, local/remote prefixes,
active talkers, node and muted counts
- TWIN: endpoint, direction, priority/peer-priority, node count
- SATELLITES: id, auth state, active TGs, node count, optional filter
Up links render green, down links red; absent sections are omitted.
Columns size to content and shrink to fit the terminal width, and the
node table auto-caps so the panel always fits.
Add table rows for test_21b (filter trims node roster) and test_21c
(filter trims monitoredTGs in the status blob), and correct the
test_trunk.py count from 50 to 52 in all three places. The count was
already a step behind: 7cf6589 added test_21b without updating TESTS.md.
The roster trim added in 7cf6589 dropped a peer node entirely when its
*selected* TG was filtered, but a kept node (selected on a permitted TG)
still carried its full monitoredTGs list verbatim in the status blob, so
blacklisted / non-ALLOW_TGS TGs it was only monitoring leaked into
/status.trunks[<section>].nodes[*].monitoredTGs and the MQTT/Redis mirrors.
Filter each entry's monitoredTGs array in TrunkLink::handleMsgPeerNodeList
with the same composite gate as the selected TG and the audio receive path
(isBlacklisted(tg) || isBlacklisted(mapTgIn(tg)) || !isAllowed(tg)), so
TG_MAP translation is honoured and the blacklist wins over an allow-prefix.
Non-permitted and malformed (non-uint) entries are dropped; the array may
become empty. Visibility-only: m_partner_nodes feeds statusJson() and
onPeerNodeList() (MQTT/Redis), never routing.
Adds test_21c_filter_trims_monitored_tgs_in_blob and documents the
monitor-list trim in PEER_PROTOCOL.md.
BLACKLIST_TGS / ALLOW_TGS previously gated only audio and active-talker traffic on a trunk link; the full client roster (MsgPeerNodeList) was stored verbatim, so a peer node parked on a filtered TG still appeared in /status.trunks[<section>].nodes and the MQTT/Redis mirrors.
Filter each node-list entry in TrunkLink::handleMsgPeerNodeList using the same composite gate as the audio receive path (isBlacklisted(tg) || isBlacklisted(mapTgIn(tg)) || !isAllowed(tg)), so TG_MAP translation is honoured. Filtered entries are dropped entirely. Safe because m_partner_nodes feeds only statusJson() and onPeerNodeList() (MQTT/Redis) -- no routing depends on it.
Adds test_21b_filter_drops_nodes_from_roster and documents the receive-side trim in PEER_PROTOCOL.md and svxreflector.conf.in.
- TWIN_PROTOCOL.md: note that the trunk->twin mirror delivers to selected
AND monitoring clients (the composite selected-OR-monitor filter),
pairing with the TwinLink fix in f1d4afd; complete the MsgTrunk* ->
MsgPeer* rename in the steady-state message table and design narrative.
- TESTS.md: bring in line with the current suite — trunk 35->50, twin
11->17. Document test_trunk 33-47 (satellite cross-visibility, prefix
routing/cluster fanout, monitor-TG fanout, trunk resilience) and the
test_twin X1-X5 series including the new X5 monitor regression; add the
mqtt-deltas, satellite-secrets, and logging suites to the run sequence;
update the five-client roster.
- Rename stale MsgTrunk* references to MsgPeer* (wire IDs unchanged, per
18d92a2) across README, DEPLOYMENT_ITALY{,_IT}, WW_DEPLOYMENT,
JAY-additions, and DESIGN_SATELLITE_AND_CLUSTER. PEER_PROTOCOL.md keeps
its two MsgTrunk* mentions — they document the rename itself.
TwinLink::handleMsgPeerAudio and handleMsgPeerFlush broadcast to local
clients with a selected-only TgFilter, whereas the sibling receive paths
(TrunkLink, SatelliteLink, SatelliteClient) use the composite
selected-OR-(passive-observer monitor) filter. TwinLink was the lone
outlier — the bare filter was copied in when the trunk->twin mirror was
added (6a6cfad) without the monitor arbitration the other paths already had.
When a PAIRED external peer that OWNS a TG fans audio into a twin pair it
picks a single sticky socket, so the non-sticky twin only receives that
audio via the trunk->twin mirror. A monitor-only listener on the non-sticky
twin was silently dropped, while a selecting listener there (and any
listener on the sticky twin, which gets the direct trunk path) heard fine.
Reported in the field on a 255/256 twin+single deployment: clients
monitoring the single peer's TG were silent on one twin and fine on the other.
- TwinLink::handleMsgPeerAudio / handleMsgPeerFlush: use the same composite
selected-OR-monitor filter as TrunkLink, preserving the passive-observer /
earliest-monitor-talker arbitration.
- tests: test_X5_paired_inbound_owner_tg_reaches_monitoring_twin_clients —
mirror image of test_X4 (TG owned by the remote PAIRED peer; selecting and
monitoring receivers on both twins). Red before the fix, green after.
- topology.py: add two test users (N0FOUR, N0FIVE) so the test can place
five distinct callsigns.
A non-paired trunk link could abort the reflector (assert sock >= 0 in
AsyncTcpConnection::write) when an inbound peer was timed out by the
heartbeat. disconnect() closes the socket but does not emit the disconnected
signal, so onInboundDisconnected never runs and m_inbound_con /
m_ib_hello_received stay set. isInboundReady() then reports the dead link as
ready, and the next send — e.g. a MsgPeerTgInterest scheduled by a client
publishing its monitored-TG list — falls through to sendMsgOnInbound and
writes to the closed socket. Reproduces the production abort seen on v1.3.12;
TrunkLink is unchanged through v1.3.13.
- sendMsgOnInbound / isInboundReady: bail when the inbound socket is closed.
- inbound heartbeat timeout: drive the full cleanup (onInboundDisconnected +
drop the dead connection from the reflector inbound map) so the link
self-heals and /status is honest, instead of leaving a phantom inbound that
makes acceptInboundConnection reject every reconnect until restart.
- defense in depth: same isConnected() guard on sendMsgOnOutbound and
SatelliteLink::sendMsg (currently unreachable, but never write to a closed
socket regardless).
- tests: test_46 (no crash on timeout + TG-interest send), test_47 (inbound
recovers after a timeout).
A satellite (SATELLITE_OF set) returns early from Reflector::initialize()
before initSatelliteServer() runs, so any [SATELLITE] block is silently
ignored. Child satellites then get connection-refused with nothing in
the parent's log explaining why. Emit a warn at startup so the misconfig
surfaces immediately.
- §1 (01_intl_mesh.dot): full mesh now includes ES (214), SE (240),
DE (262), IT (222), UA (255) — 5-node pentagon with 10 edges.
- §2 (02_flat_mesh.dot): international side likewise widened to the
5-country full mesh; IT 222 stays as the rightmost gateway vertex.
National-side Zones spread into a 2x2 block mirroring the
international layout so the 10 national edges have room to breathe.
- ASCII art in TOPOLOGY_EXAMPLES.md §1 and §2 updated to match.
- TOPOLOGY_EXAMPLES.pdf rebuilt via docs/build_topology_pdf.sh.
- New docs/MCC_COUNTRY_CODES.md: 25-country table with ISO codes and
MCC(s), notes on countries with multiple MCC allocations, and a
pointer to the ITU-T E.212 source for everything else.
- INSTALL.md §6a/6b: replace toy single-digit LOCAL_PREFIX/REMOTE_PREFIX
examples with MCC-anchored ones (LOCAL_PREFIX=262, REMOTE_PREFIX=240,
TRUNK_DE_SE) plus a cross-reference to the new MCC table.
- DESIGN_SATELLITE_AND_CLUSTER.md: MCC-anchor the two stale config
snippets (LOCAL_PREFIX 01->22201, REMOTE_PREFIX 02->22202) so the
historical design doc no longer teaches the bare-regional-digit
anti-pattern.
Bare 2-digit regional codes (e.g. LOCAL_PREFIX=01) carried no country
namespace and would collide with any other country picking the same
regional digits. Prefix every LOCAL_PREFIX and REMOTE_PREFIX with the
Italy MCC (222), so each value sits inside the 222 prefix space
(e.g. Lazio = 22201, Lombardia = 22221). Section names
[TRUNK_xx_yy] and SECRET=IT_xx_yy keep the 2-digit form as readable
identifiers — only the prefix values themselves are MCC-anchored.
Inventory table, prose explanation, complete Lazio config block,
per-region checklist, and the parallel Italian translation all
updated in lockstep.
- WW_DEPLOYMENT.md, DEPLOYMENT_ITALY.md (+ IT translation): add the
per-id SECRET_<id>= snippet alongside the existing single-secret
example so operators see both forms.
- TOPOLOGY_EXAMPLES.md: rewrite the obsolete 'future work:
per-satellite secrets' callout in §3 to reflect the shipped feature;
touch up §4 reference to the parent's SECRET.
- DESIGN_SATELLITE_AND_CLUSTER.md: preserve the original design body;
add a brief postscript pointing readers to the per-id form in the
README.
SatelliteLink's heartbeat timer was constructed with the default
enabled=true, so it started ticking at connect time. When a hello was
rejected, m_con->disconnect() closed the socket but the timer kept
running; at the t=10s tx tick it called sendMsg, which hit
assert(sock >= 0) in TcpConnection::write and crashed the reflector.
TcpConnection::disconnect() intentionally does not emit the
disconnected signal (header comment), so the TcpServer's
clientDisconnected handler never ran -- the SatelliteLink stayed in
m_satellite_con_map with no path to cleanup. TrunkLink avoids this
by constructing its heartbeat with enabled=false and enabling it only
after auth (TrunkLink.cpp:197); SatelliteLink just missed the pattern.
Mirror TrunkLink: construct the heartbeat disabled, enable it after
successful authentication in handleMsgPeerHello. On all four rejection
branches, fire linkFailed(this) after m_con->disconnect() so the
existing onSatelliteLinkFailed -> processSatelliteCleanup path deletes
the leaked link.
Add test_rejection_does_not_crash_parent regression test that sends
a hello with a wrong-for-pinned-id secret, waits past the 10s
heartbeat threshold, and confirms /status still responds and shows
no phantom satellite entry.
Underscores are not in the configured per-id charset [A-Za-z0-9-]+,
so SECRET_SAT_PINNED= was correctly rejected as malformed at startup.
Switch SAT_PINNED -> SAT-PINNED (and same for SAT_UNPINNED) so the
test fixture matches the spec.
When an external PAIRED=1 peer transmits to a twin pair, it picks a
single sticky socket per transmission and sends every frame on it. The
sticky-selected twin's TrunkLink::handleMsgPeerAudio used to broadcast
locally and to satellites but never relayed to the partner twin — so
local clients on the non-sticky twin were deaf to the audio even though
the talker state was mirrored correctly. The satellite-receive path
already had the symmetric forwarder (forwardSatelliteRawAudioToTwin);
the trunk path was just missing it.
Add Reflector::forwardTrunkAudioToTwin and forwardTrunkFlushToTwin,
modelled on the satellite variants, and invoke them from
TrunkLink::handleMsgPeerAudio and handleMsgPeerFlush after the local +
satellite broadcasts. Loop safety: TwinLink::handleMsgPeerAudio does
not re-forward to trunks, so there is no echo back to the originating
peer. Requires the external peer to use PAIRED=1 with both twin
hostnames in a single section — two independent trunk sections would
defeat the source-trunk exclusion at the external owner and cause
duplicates/echo. The docs now flag PAIRED=1 as mandatory for this
topology.
Test: test_twin.py::test_X4_paired_inbound_reaches_both_twins drives a
refa client on TG 26201 and asserts both ref1 and ref2 receive audio
frames and flush. Also rewrite test_01_twin_handshake and
test_05_twin_wiring_no_errors to read /status.twin instead of scraping
a 120s docker-logs window — the previous form flaked when the mesh had
been up long enough for boot-time log lines to scroll off.
Add a subsection to "Build" covering CMAKE_INSTALL_SYSCONFDIR for
baking a custom config directory into the binary (the common case:
-DCMAKE_INSTALL_SYSCONFDIR=/etc to read /etc/svxlink/svxreflector.conf),
the --config runtime override, and the full lookup order at startup.
A client with a non-zero selected TG must never receive UDP audio
for a monitored TG. svxlink's priority/auto-switch for monitor TGs
is driven by the TCP TalkerStart message; once svxlink decides to
switch, it sends MsgSelectTG and from then on the audio arrives via
the selected-TG arm of the fanout (TgFilter). The monitor arm is
only meaningful for passive observers (currentTG=0).
a661879 (v1.3.10) introduced the monitor arm to support passive
multi-hop monitoring, but gated it loosely. dc3a8c0 narrowed the
gate to "selected TG idle right now" — too eager, since a real
QSO has 0.5-3s inter-PTT gaps where the selected TG is talkerless.
5c585be added first-talker-wins on top, masking but not fixing
the leak. The net effect: while a user was mid-QSO on TG 9 with
TG 110 in MONITOR_TGS, TG 110 audio bled into the inter-PTT gaps
and was played by svxlink. Tragedy.
Replace SelectedTgIdleFilter with PassiveObserverFilter
(`m_current_tg == 0`) at all 9 UDP fanout sites in Reflector.cpp,
SatelliteClient.cpp, SatelliteLink.cpp, and TrunkLink.cpp.
EarliestMonitorTalkerFilter is retained — passive observers with
multiple monitor TGs still need first-talker-wins to avoid Opus
decoder mixing (test_44).
Tests:
- New test_45 pins down the contract: A select_tg=9,
monitor_tgs=[110]; C continuously talks on 110; A receives zero
TG 110 UDP frames. Fails on master, passes after fix.
- test_43 repurposed from "first-talker-wins for selected" (a
property that should never have been asserted) to the
multi-monitor variant of test_45.
- test_39/40/41/42/44 stay green by construction.
All suites: 48 trunk + 7 mqtt + 6 logging + 15 twin = 76/76.