惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News: Ask HN
Hacker News: Ask HN
H
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog RSS Feed
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
量子位
博客园_首页
Vercel News
Vercel News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Forbes - Security
Forbes - Security
IT之家
IT之家
N
News and Events Feed by Topic
S
Security Affairs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Webroot Blog
Webroot Blog
Recorded Future
Recorded Future
L
LangChain Blog
Y
Y Combinator Blog
AI
AI
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Know Your Adversary
Know Your Adversary
AWS News Blog
AWS News Blog
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google Online Security Blog
Google Online Security Blog
V2EX - 技术
V2EX - 技术
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
PCI Perspectives
PCI Perspectives
I
Intezer
T
Tenable Blog
G
Google Developers Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
L
LINUX DO - 最新话题
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
有赞技术团队
有赞技术团队
O
OpenAI News
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
C
Check Point Blog
Last Week in AI
Last Week in AI
S
Schneier on Security
Simon Willison's Weblog
Simon Willison's Weblog
Blog — PlanetScale
Blog — PlanetScale

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Stop Handling RTP in Your AI Agent — Let the Infrastructure Do It
voipbin · 2026-04-29 · via DEV Community

voipbin

If you have ever tried to build a real AI voice agent — not a demo, but something that actually picks up phone calls — you know the moment everything stops being fun.

It is not the AI logic. That part is usually clean. It is everything underneath: RTP streams, jitter buffers, DTMF detection, SRTP negotiation, codec transcoding, VAD (voice activity detection), SIP signaling. Suddenly your elegant AI agent is buried under thousands of lines of audio plumbing that have nothing to do with the problem you set out to solve.

This post is about how to escape that trap.


The Real Problem: Audio Infrastructure Is a Full-Time Job

Let me show you what typical DIY voice-AI stacks look like under the hood:

Phone Call
  → SIP INVITE (handle SIP stack)
  → RTP stream (decode G.711 / G.729 / Opus)
  → Jitter buffer management
  → VAD (detect speech vs silence)
  → Chunked audio → STT API
  → AI inference (finally, the fun part)
  → TTS API → audio bytes
  → Encode audio back to RTP
  → Send RTP packets with correct timestamps
  → Handle DTMF events in parallel
  → Deal with packet loss, reordering, clock drift

Enter fullscreen mode Exit fullscreen mode

Every one of those steps is an opportunity to introduce bugs, latency spikes, or dropped audio. And none of it is your core product.

Worse, scaling it is a nightmare. RTP is stateful and UDP-based. You cannot just throw it behind a load balancer and call it a day.


The Alternative: Media Offloading

The idea is simple: let AI handle text, let infrastructure handle audio.

Your AI agent should only ever see:

  • Transcribed text ("I want to check my account balance")
  • Structured events (call started, DTMF pressed, call ended)

And it should only ever produce:

  • Text responses that get synthesized into speech
  • High-level commands ("transfer to billing", "play hold music", "hang up")

This is what VoIPBin calls Media Offloading. VoIPBin sits between the phone network and your AI, handling 100% of the audio layer. Your code speaks clean HTTP and JSON.


What This Looks Like in Practice

Here is a complete AI voice agent in Python. Notice what is not in this code:

from flask import Flask, request, jsonify
import openai

app = Flask(__name__)
client = openai.OpenAI()

conversation_history = {}

@app.route("/voice-agent", methods=["POST"])
def voice_agent():
    event = request.json
    call_id = event.get("call_id")
    event_type = event.get("type")

    # Call started — greet the caller
    if event_type == "call.started":
        conversation_history[call_id] = [
            {"role": "system", "content": "You are a helpful support agent. Be concise."}
        ]
        return jsonify({
            "actions": [
                {"type": "talk", "text": "Hello! How can I help you today?"}
            ]
        })

    # Caller spoke — run AI inference on the transcript
    if event_type == "speech.recognized":
        transcript = event.get("transcript", "")
        history = conversation_history.get(call_id, [])
        history.append({"role": "user", "content": transcript})

        response = client.chat.completions.create(
            model="gpt-4o",
            messages=history
        )
        reply = response.choices[0].message.content
        history.append({"role": "assistant", "content": reply})
        conversation_history[call_id] = history

        return jsonify({
            "actions": [
                {"type": "talk", "text": reply}
            ]
        })

    # Call ended — clean up
    if event_type == "call.ended":
        conversation_history.pop(call_id, None)
        return jsonify({"actions": []})

    return jsonify({"actions": []})

if __name__ == "__main__":
    app.run(port=5000)

Enter fullscreen mode Exit fullscreen mode

That is the entire voice agent. No RTP. No SIP. No audio codecs. No jitter buffer. Just HTTP in, HTTP out.

VoIPBin takes the raw phone call, transcribes speech in real time, sends your webhook the transcript, receives your text response, and synthesizes it into speech — all before the caller notices any delay.


Getting Started

First, sign up and get your API token:

curl -s -X POST https://api.voipbin.net/v1.0/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "username": "your-username",
    "password": "your-password",
    "email": "you@example.com"
  }'
# Returns: { "token": "..." }  ← your access token, no OTP needed

Enter fullscreen mode Exit fullscreen mode

Then create a flow that points to your webhook:

curl -s -X POST https://api.voipbin.net/v1.0/flows \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "AI Voice Agent",
    "actions": [
      {
        "type": "webhook",
        "url": "https://your-server.com/voice-agent"
      }
    ]
  }'

Enter fullscreen mode Exit fullscreen mode

Assign a phone number to the flow, and every incoming call now drives your webhook. That is it. Your Flask app above is a fully functional phone AI agent.


The Golang SDK Version

If you prefer Go, the SDK makes it equally clean:

package main

import (
    "encoding/json"
    "net/http"
    "log"
)

type Event struct {
    CallID     string `json:"call_id"`
    Type       string `json:"type"`
    Transcript string `json:"transcript"`
}

type Action struct {
    Type string `json:"type"`
    Text string `json:"text,omitempty"`
}

type Response struct {
    Actions []Action `json:"actions"`
}

func voiceHandler(w http.ResponseWriter, r *http.Request) {
    var event Event
    json.NewDecoder(r.Body).Decode(&event)

    var actions []Action

    switch event.Type {
    case "call.started":
        actions = []Action{{Type: "talk", Text: "Hello! How can I help you?"}}
    case "speech.recognized":
        // Call your AI model here
        reply := callAI(event.Transcript)
        actions = []Action{{Type: "talk", Text: reply}}
    }

    w.Header().Set("Content-Type", "application/json")
    json.NewEncoder(w).Encode(Response{Actions: actions})
}

func main() {
    http.HandleFunc("/voice-agent", voiceHandler)
    log.Fatal(http.ListenAndServe(":8080", nil))
}

Enter fullscreen mode Exit fullscreen mode

Install the SDK:

go get github.com/voipbin/voipbin-go

Enter fullscreen mode Exit fullscreen mode


What You Get

When you offload audio to infrastructure instead of handling it yourself:

Simpler codebase. Your AI logic stays focused on AI logic. No audio thread pools, no RTP socket management, no codec libraries to vendor.

Better latency. VoIPBin runs purpose-built media servers geographically close to carriers. Your webhook only adds the inference time — not the full audio round-trip overhead of a DIY stack.

Free horizontal scaling. Your webhook is stateless HTTP. Scale it like any API. VoIPBin handles the stateful media sessions.

Automatic codec handling. Callers dial in from SIP phones, mobile networks, WebRTC clients — each with different codecs. VoIPBin normalizes everything before your code ever sees it.

STT/TTS without wiring. Built-in speech recognition and synthesis. Swap languages or voices through config, not code.


The Mental Model Shift

The key insight is this: audio infrastructure is not your product, it is a dependency.

You would not write your own TCP stack to build an API. You would not implement your own TLS to serve HTTPS. The same logic applies to RTP and SIP.

Let the infrastructure layer handle packets, timing, and codec negotiation. Keep your application layer focused on the thing that actually creates value — the AI behavior.

Your AI voice agent should look like a webhook handler. If it looks like a media server, something has gone wrong.


Try It

  • Website: voipbin.net
  • MCP Server: uvx voipbin-mcp (works with Claude Code, Cursor)
  • Golang SDK: go get github.com/voipbin/voipbin-go
  • API Base: https://api.voipbin.net/v1.0

If you are building AI voice agents and want to talk through the architecture, drop a comment below. Happy to go deeper on any part of this.