Menu

1 / 2

Rolling deploys without dropping live calls, running a Twilio Media Streams service on AKS

DEV Community: dotnet·Tayyab Hafiz·7 days ago
#LaRaZE6d
#devtodotnet#devto#dev#call#twilio
Long article (1396 words) — no AI summary yet.
Reading 0:00
15s threshold

This article was drafted with AI help and reviewed by the author.

Most ASP.NET Core services on Kubernetes handle short requests. A rolling deploy replaces pods, a few in-flight requests finish during the grace period, and nobody notices.

A service that handles Twilio bidirectional Media Streams is different. Each phone call holds one WebSocket open for its whole length, carrying audio in both directions. If the pod handling that socket goes away, the caller's conversation with your agent goes with it.

This post covers what to change when that service runs on AKS. It looks at what Twilio does when the socket closes, how to drain pods, how to recover a call that does get cut, and how to keep the audio loop fast. Twilio behavior is taken from its TwiML and Media Streams reference, and Kubernetes behavior from the upstream pod lifecycle page, both read on 27 November 2026.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.