High-performance voice relay and instant messaging server for the Whelm/Aerochat platform.
- Voice Calling: 48kbps Opus audio relay (96kbps both ways)
- Instant Messaging: Real-time message routing with MariaDB persistence
- Live Status: Heartbeat-based online/offline status tracking
- Bandwidth Limiting: Configurable 100Mbps up/down limits
- Capacity Planning: ~400 simultaneous calls max
Based on my 6 vCPU, 12GB RAM, 275mbps down / 225mbps up Debian server:
| Resource | Allocation | Notes |
|---|---|---|
| CPU | 1-2 vCPU | Go is efficient, mostly I/O bound |
| RAM | ~100MB | Minimal memory footprint |
| Storage | 10MB binary | + logs if enabled |
| Bandwidth | 100/100 Mbps | Self-limited, configurable |
Audio bitrate: 48 kbps per direction
Per call (server relay): 96kbps in + 96kbps out = 192 kbps
Bandwidth limit: 100 Mbps = 100,000 kbps
Max theoretical calls: 100,000 / 192 ≈ 520 calls
With 20% safety margin: ~400 simultaneous calls
sudo apt update
sudo apt install golang-go mariadb-clientgit clone https://github.com/YOUR_USER/voiceMt.git
cd voiceMt
go build -o whelm-voice-server .wget https://github.com/YOUR_USER/voiceMt/releases/latest/download/whelm-voice-server-linux-amd64
chmod +x whelm-voice-server-linux-amd64
mv whelm-voice-server-linux-amd64 /usr/local/bin/whelm-voice-serverSet environment variables before running:
export WHELM_DB_DSN="whelm:yourpassword@tcp(db.example.com:3306)/whelm?parseTime=true"./whelm-voice-serversudo cp whelm-voice.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable whelm-voice
sudo systemctl start whelm-voiceCommands (newline-terminated):
| Command | Description |
|---|---|
AUTH <token> |
Authenticate with session token |
HEARTBEAT [status] |
Keep-alive, optionally update status |
CALL <user_id> |
Initiate call to user |
ACCEPT <caller_id> |
Accept incoming call |
REJECT <caller_id> |
Reject incoming call |
HANGUP |
End current call |
MSG <recipient_id> <content> |
Send instant message |
Server responses:
| Response | Description |
|---|---|
OK AUTH <user_id> <username> |
Auth successful |
OK HEARTBEAT |
Heartbeat acknowledged |
OK CALLING <user_id> |
Call request sent |
INCOMING <caller_id> <username> |
Incoming call notification |
START_CALL <partner_id> <username> |
Call connected |
REJECTED <user_id> |
Call was rejected |
HANGUP <user_id> |
Call ended by other party |
MSG <json> |
Incoming message |
ERROR <message> |
Error occurred |
- Register with:
HELLO <user_id> - Send Opus packets directly (server relays to call partner)
Uses existing Whelm users and messages tables:
-- users table must have: id, username, session_token, status, last_seen
-- messages table must have: id, sender_id, channel_id, content, timestamp