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

+7 -1
View File
@@ -11,7 +11,13 @@ to regenerate configs/ and docker-compose.test.yml. The test harness
REFLECTORS = {
# name prefixes (list) host-port-base redis
"a": {"prefix": ["122"], "trunk_port_base": 15000},
# `a` also carries LOCAL_ALIASES so tests/test_alias.py can verify the
# local-alias feature (short local TG re-homed under an owned prefix):
# 8 <-> 1220008 (two-way)
# 90 (/out) <-> 1220090 (export only: local TG 90 -> mesh, no fold-in)
# 91 (/in) <-> 1220091 (import only: mesh -> local TG 91, no publish)
"a": {"prefix": ["122"], "trunk_port_base": 15000,
"local_aliases": "8:1220008,90:1220090/out,91:1220091/in"},
"b": {"prefix": ["121"], "trunk_port_base": 25000},
"c": {"prefix": ["1"], "trunk_port_base": 35000},
# `d` is sparse-trunked: only connects to `b`. With prefix `1219`