I started building the thing I actually wanted to deploy. It's on GitHub now, AGPL-3.0. This is a write-up of the architecture and, more usefully, the bugs that cost me real sleep.

The stack, and why

Kamailio at the SIP edge — high CPS, and secsipid for STIR/SHAKEN

FreeSWITCH for media — bgapi originate, mod_avmd, ESL, a Lua script per call

Go for the engine — pacing, lead claiming with SELECT FOR UPDATE SKIP LOCKED, a per-call state machine driven off ESL events