How ysamouhos/brew-server works
brew-server is an experimental Rust service that links MidnightBlue TETRA Basestations and Flowstations. Its main workflow accepts Brew client connections, decodes protocol messages, routes calls and SDS between clients, and records monitoring data. Separate branches provide SIP voice interconnection, server federation, station telemetry and position reporting, administration, and active/standby high availability. The source index identifies important modules, but many implementation details were not sampled; edges below are limited to documented relationships or references shown there.
Main entry points: router.rs Call and SDS router · state.rs Shared runtime state · dashboard.rs Admin dashboard · server.rs Brew server
Components 27
Brew core
- Service startup
src/main.rs - Brew server
src/server.rs - Brew protocol
src/protocol.rs - Call and SDS router
src/router.rs - Shared runtime state
src/state.rs - Configuration
src/config.rs - ISSI blacklist
src/blacklist.rs - Emergency calls
src/emergency.rs
Voice and messaging
- SIP transport
src/sip/transport.rs - SIP call routing
src/sip/routing.rs - SIP-Brew bridge
src/sip/bridge.rs - RTP media relay
src/sip/media.rs - Voice transcoding
src/transcode/task.rs - SMS center
src/sms_center.rs
Federation and telemetry
- Federation links
src/federation.rs - Federation routing
src/fedroute.rs - Station telemetry
src/telemetry.rs - Position reporting
src/position.rs - APRS reporting
src/aprs.rs - WebSocket networking
src/fsnet.rs
Operations
- Admin dashboard
src/dashboard.rs - Control commands
src/control.rs - Call monitoring
src/monitor.rs - History store
src/store.rs
High availability
- HA election and VIP
src/ha.rs - HA replication
src/ha_repl.rs
Other components
- TETRA stations
Connections 30
- TETRA stations → Brew server: connect
README.md - Service startup → Brew server: starts
src/main.rs - Service startup → Configuration: loads
src/main.rs - Brew server → Brew protocol: decodes
src/server.rs - Brew server → Shared runtime state: uses
src/server.rs - Call and SDS router → Brew protocol: routes messages
src/router.rs - Call and SDS router → Shared runtime state: reads and updates
src/router.rs - Call and SDS router → SMS center: reports delivery
src/router.rs - Call and SDS router → Federation routing: routes remotely
src/router.rs - Call and SDS router → ISSI blacklist: checks
src/router.rs - Call and SDS router → SIP call routing: uses
src/router.rs - Call and SDS router → Emergency calls: handles calls
src/emergency.rs - SIP transport → SIP call routing: resolves calls
src/sip/transport.rs - SIP transport → SIP-Brew bridge: bridges calls
src/sip/transport.rs - SIP-Brew bridge → RTP media relay: relays media
src/sip/bridge.rs - SIP-Brew bridge → Voice transcoding: uses
src/sip/bridge.rs - Federation links → Federation routing: exchanges routes
src/federation.rs - Federation links → WebSocket networking: serves links
src/federation.rs - Station telemetry → WebSocket networking: receives station data
src/telemetry.rs - Station telemetry → Federation routing: advertises positions
src/telemetry.rs - APRS reporting → Position reporting: reports positions
src/aprs.rs - Admin dashboard → Call monitoring: shows status
src/dashboard.rs - Admin dashboard → SMS center: manages messages
src/dashboard.rs - Admin dashboard → HA election and VIP: controls role
src/dashboard.rs - Admin dashboard → Shared runtime state: reads state
src/dashboard.rs - Control commands → Shared runtime state: updates control state
src/control.rs - Call monitoring → History store: persists history
src/monitor.rs - Shared runtime state → History store: opens
src/state.rs - HA election and VIP → HA replication: replicates state
src/ha.rs - HA election and VIP → Shared runtime state: coordinates role
src/ha.rs