feat(alias): add LOCAL_ALIASES to re-home short local TGs under an owned prefix

Re-home a short local talk group (e.g. 8) under the reflector's own owned
prefix as a globally-unique number (e.g. 2620008) via a single [GLOBAL]
LOCAL_ALIASES entry, so it routes across the trunk mesh like any owned TG
while local users keep dialing the short number.

- Config: LOCAL_ALIASES=localTG:aliasTG[/dir] (dir in|out, omitted = two-way);
  aliasTG must be owned by a LOCAL_PREFIX. Rejects unowned alias, an owned
  short side, duplicate short keys, and numeric overflow.
- Boundary rewrite: prefix routing / owner-relay / peer-interest run on the
  long owned number; local delivery and talker arbitration run on the short
  number, bridged in the four inbound trunk handlers.
- Rewrite-on-select folds a client that dials the long number onto the short
  number (select + monitor), so the two are one conversation locally and on
  the mesh.
- Twin: external-talker notify uses the short number to match the audio
  mirror; disconnect cleanup folds to short so an aliased TG cannot wedge.
- /status exposes local_aliases; satellite nodes warn that the setting is
  ignored (a local alias belongs on the mesh parent that owns the prefix).
- Docs (PEER_PROTOCOL, CONCEPTS, conf template) and integration tests
  (tests/test_alias.py): two-way / in / out, rewrite-on-select, status,
  validation, disconnect-wedge, and duplicate-key coverage.
This commit is contained in:
Audric committed 2026-07-03 18:17:16 +02:00
1 parent 7e625dd514
commit 5da075f150
12 files changed
+1187 -64

No files matched your search

+6
View File
@@ -25,6 +25,12 @@ def generate_reflector_conf(name: str) -> str:
"TG_FOR_V1_CLIENTS=999",
f"LOCAL_PREFIX={T.prefix_str(r['prefix'])}",
f"CLUSTER_TGS={cluster_str}",
]
# Optional local-alias re-homing (tests/test_alias.py). Only reflectors
# that declare "local_aliases" in topology.py get the line.
if r.get("local_aliases"):
lines.append(f"LOCAL_ALIASES={r['local_aliases']}")
lines += [
f"TRUNK_LISTEN_PORT={T.INTERNAL_TRUNK_PORT}",
f"HTTP_SRV_PORT={T.INTERNAL_HTTP_PORT}",
"COMMAND_PTY=/dev/shm/reflector_ctrl",