By Sagar Shankaran, Founder of CallSphere
Drachtio is connect-style middleware for SIP, with a C++ Sofia core and a Node.js framework on top. In 2026 it is the fastest path from carrier trunk to OpenAI Realtime if you live in JavaScript and rtpengine.
Key takeaways
The Node.js telephony developer in 2026 has two real options: write your own glue around the Sofia SIP stack, or use Drachtio. Drachtio runs Sofia inside a separate C++ daemon and gives you a connect-flavored middleware layer to wire signaling logic, dialogs, and B2BUA bridges in maybe 200 lines of TypeScript.
Drachtio was created by Dave Horton (formerly at Twilio) and is now maintained as drachtio-server (C++) and drachtio-srf (Node.js). The C++ side parses SIP, manages transports, transactions, and dialogs. The Node side talks to drachtio-server over a TCP control connection and exposes Express-style middleware for INVITE, REGISTER, OPTIONS, MESSAGE, and so on.
The killer feature for AI voice is createB2BUA. You receive an INVITE, decide what to do, and Drachtio creates a paired UAS+UAC dialog with media steered through rtpengine. Hangup propagates automatically. The same pattern handles SIP-to-WebRTC gateway use cases where one leg is a carrier trunk and the other leg is your in-browser AI agent.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
Recent activity on the drachtio-server repo shows commits in April 2026, which means it is alive and current. The associated Docker images on Hub are updated within the same window.
graph LR
A[SIP Carrier] --> B[drachtio-server C++]
B <-->|TCP control| C[Node.js drachtio-srf]
C -->|SDP rewrite| D[rtpengine]
D -->|RTP| E[Media Sink]
E -->|WebSocket| F[OpenAI Realtime]
C -->|signaling| G[Tenant logic / DB]
// Minimal drachtio-srf B2BUA to a WebRTC AI agent
const Srf = require('drachtio-srf');
const srf = new Srf();
srf.connect({host: '127.0.0.1', port: 9022, secret: 'cymru'});
srf.invite(async (req, res) => {
try {
const { uas, uac } = await srf.createB2BUA(req, res,
'sip:ai-agent@bridge.callsphere.local',
{ localSdp: req.body, proxyRequestHeaders: ['from','to'] }
);
[uas, uac].forEach(d => d.on('destroy', () => {
uas.destroy(); uac.destroy();
}));
} catch (err) {
console.error('B2BUA failed', err);
}
});
CallSphere does not run Drachtio in production. Every inbound and outbound call across our six verticals (Healthcare AI on FastAPI :8084 to OpenAI Realtime, Real Estate AI, Sales Calling AI with 5 concurrent outbound, Salon AI, IT Helpdesk AI, After-Hours AI with Twilio simul call+SMS and 120-second timeout) terminates on Twilio Programmable Voice. We use TwiML
npm install drachtio-srf rtpengine-client.Is Drachtio production-grade? Yes. It powers commercial CPaaS and contact-center products and has been in active development for over a decade.
Drachtio or pure Sofia bindings? Drachtio's middleware model is faster to ship. Pure Sofia gives you finer control if you need it, at 5-10x the lines of code.
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
Can Drachtio host the media? No. Drachtio is signaling. Pair it with rtpengine, FreeSWITCH, or your AI media bridge.
How does Drachtio compare to Asterisk PJSIP? Drachtio is signaling-only, Node-friendly, and stateless if you let it be. Asterisk is a full PBX. Different tools for different problems.
Does Drachtio support SIP REFER? Yes, both inbound and outbound. Useful for transferring calls into a Twilio SIP domain or back to a human queue.
Start a 14-day trial to skip the bridge entirely, see pricing, or book a demo to compare a Drachtio reference build against our managed Twilio stack.
Written by
Sagar Shankaran· Founder, CallSphere
Sagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
A founder's guide to the female voice generator landscape: AI female voices, Japanese voices, robot voices, and how CallSphere ships 57+ voices live.
MOS 4.3+ is the band where AI voice feels human. Drop below 3.6 and conversations break. Here is how to measure, improve, and alert on MOS in production AI voice using G.711, Opus, and the underlying packet loss / jitter / latency math.
Where every millisecond goes between caller and AI: PSTN, carrier, STT, LLM, TTS, and back. The component-level targets that ship in 2026 and how to hit them.
Bun's WebSocket implementation handles 1.2M concurrent connections vs Node's 680K on identical hardware. Where the gap is real, where it isn't, and the production tradeoffs.
What an SBC actually does, why AI voice deployments still need them in 2026, and how Oracle, Ribbon, AudioCodes, and Cisco fit into modern stacks.
Texas SB 1188 requires US-resident EHRs from January 1, 2026; Nevada's consumer-health-data law constrains health data; Colorado AI Act takes effect June 30, 2026. AI voice agents must architect for state-by-state data localization.
© 2026 CallSphere LLC. All rights reserved.