maarkn.dev
Back to all posts
·7 min read·
  • Backend
  • Architecture

What I learned building a VoIP product from scratch

Real-time provisioning, transcription, multitenancy and the audio knob nobody told me about. Eleven months of lessons from leading the architecture of Nectar's VoIP.

voip-from-scratch

VoIP looks deceptively simple from the outside. People talk, computers route, money is charged. From the inside it's a minefield of provisioning races, codec choices, and the kind of bugs that only happen at 11:47 PM in Belém.

Three lessons I keep coming back to

Provisioning is harder than the product. Onboarding a new customer means picking DIDs, configuring extensions, setting billing rules — all in real time. We learned to make every state transition idempotent. If the operator hits "save" twice, the system shrugs.

Audio is a knob, not a switch. We optimized bandwidth without losing quality, and the negotiation between codecs gave us back 30% of audio costs. The knob was hiding behind a four-line config in Asterisk.

Multitenancy is a discipline, not a feature. Every query had to be scoped, every cache key namespaced, every webhook signed. We didn't get this right on day one. We rewrote the cache layer twice.

If you're building real-time products: respect the protocol, distrust the network, and budget for one rewrite of the part you were most confident about.