r/freeswitch • u/RasonYang • 29d ago
FreeSWITCH with no public IP: one Go binary in front of it, and 3 things that bit me
Put 5060 on a public IP and the SIP scanners show up within hours. The usual fix is a commercial SBC with per-session licences, or Kamailio + rtpengine + a database you then maintain for years. I wanted something smaller, so I wrote one.
One Go binary, one YAML file. No database, no Redis, no separate media process. Apache-2.0: https://github.com/rasonyang/freesbc
FreeSWITCH goes on a private IP; clients and carriers only ever see the SBC. Drop-in config for the stock 1.10 vanilla setup is in examples/switch/freeswitch/. HOMER (HEP), a WebUI and Prometheus metrics are built in.
One 4 vCPU VM: 5,000 concurrent calls with media at 80% CPU, and an 8-hour soak of 432,000 calls with 0 failures. (SIPp standing in for the switch, G.711. Method and caveats in docs/performance.md.)
3 things that will bite you:
- Delete any ACL that trusts the SBC's IP. Every client now arrives from that address, so one leftover trust rule and every call skips auth.
- Allowlist the SBC in fail2ban, or it bans the SBC and locks out every client at 3 a.m.
- No tunnels on the private leg. Packets must arrive on the interface that owns
private.ip. Route them through WireGuard and they're dropped silently, with no log line.
What it isn't: no transcoding, not a B2BUA, no clustering, and a restart drops calls. It's not a fraud filter either: your dialplan is still what stands between you and the bill.
What would stop you from putting this in front of a production switch?