By Sagar Shankaran, Founder of CallSphere
How Asterisk 22 connects to AI voice agents in 2026 using ARI for call control, AudioSocket for audio streaming, and ExternalMedia for low-latency RTP bridges.
Key takeaways
If your business already runs Asterisk and you want an AI receptionist without ripping out the PBX, the 2026 stack is ARI for call control plus AudioSocket or ExternalMedia for the audio path to your model.
flowchart TD
Out[Outbound campaign] --> Twilio[Twilio Voice API]
Twilio --> STIR[STIR/SHAKEN attestation]
STIR --> Carrier[Originating carrier]
Carrier --> Term[Terminating carrier]
Term --> Recipient[Recipient phone]
Recipient --> Webhook[/voice webhook/]
Webhook --> Agent[AI sales agent]Asterisk 22 is the long-term-support release stewarded by Sangoma and the open-source community. It is in production at thousands of FreePBX, hosted PBX, and call-center deployments. For years the AI angle on Asterisk was limited to text-to-speech IVR and rudimentary speech recognition. In 2025 and 2026 that picture changed: serious AI voice agents now run alongside Asterisk by streaming raw audio out to model providers and accepting text-or-audio responses back.
Three integration paths matter in 2026:
Asterisk receives a SIP INVITE on its chan_pjsip endpoint. The dialplan decides what to do with the channel. For an AI agent flow, the dialplan dispatches the call to a Stasis application whose name maps to your ARI app. ARI then takes over: it can answer the channel, attach it to a bridge, and add an ExternalMedia channel that opens an RTP stream toward your AI service. Audio flows out as 16-bit PCM at 8 or 16 kHz. Your service streams audio to OpenAI Realtime, Deepgram, or your own model and pipes responses back into the ExternalMedia channel.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
AudioSocket is similar but uses TCP rather than RTP, with a simple framing protocol. It is often easier to debug and works well behind NAT, at the cost of slightly higher latency than RTP.
CallSphere itself is Twilio-first across all six verticals, but Asterisk integration matters because many CallSphere prospects already run an Asterisk PBX and want their AI receptionist to live behind it. The supported pattern is: Asterisk handles internal extensions and existing IVR; calls that should reach the AI are dialed out via SIP to a CallSphere-provided URI; CallSphere terminates on Twilio Elastic SIP Trunking and bridges to OpenAI Realtime.
For customers who insist on a pure on-premises stack, CallSphere ships a reference Stasis app that uses ARI plus ExternalMedia to bridge an Asterisk channel to a CallSphere agent over a private SIP trunk. The platform's 37 agents, 90+ tools, 115+ database tables, HIPAA and SOC 2 controls, and pricing of $149, $499, and $1499 for 1, 3, and 10 numbers all work the same regardless of whether the call originates on Asterisk or directly on Twilio.
ari.conf with a strong password and bind to localhost or a private network.exten => _X.,1,Stasis(ai-agent,$\{EXTEN\}).StasisStart events and answers the channel.; extensions.conf — route inbound calls to the AI agent Stasis app
[from-trunk]
exten => _X.,1,NoOp(Inbound to AI agent)
same => n,Answer()
same => n,Stasis(ai-agent,inbound,$\{CALLERID(num)\})
same => n,Hangup()
; ari.conf — REST control plane
[general]
enabled = yes
pretty = yes
[callsphere]
type = user
read_only = no
password = REPLACE_WITH_STRONG_SECRET
Should I use AudioSocket or ExternalMedia? ExternalMedia for lower latency, AudioSocket for easier NAT traversal and a simpler protocol.
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.
Does Asterisk 22 add anything specific for AI workloads? The 22 LTS line tightened PJSIP, hardened ARI, and improved media handling. The bigger shift is the ecosystem: open-source AI agent projects now target Asterisk 18+ as the floor.
Can Asterisk handle 100 concurrent AI calls? Yes, on modest hardware, as long as the audio path is offloaded to ExternalMedia. The bottleneck is usually your AI provider's quota, not Asterisk.
What if my carrier does not speak SIP cleanly? Use a Session Border Controller in front of Asterisk to normalize SIP and handle STIR/SHAKEN.
Is FreePBX fine for this or do I need raw Asterisk? FreePBX works for prototypes; production AI deployments usually want raw Asterisk to keep dialplan logic explicit and version-controlled.
If you want a managed alternative without running your own PBX, start a 14-day trial, book a demo, or read about healthcare AI deployments.
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.
An honest 2026 guide to VoIP desk phones. Hardware vs softphone, top picks, when an internet phone is worth it, and where AI voice agents fit.
The best business phone app in 2026 is the one with an AI agent attached. Compare options, costs, and what an AI phone app actually does for a small business.
A founder's guide to business phone systems in 2026. Cloud vs on-prem, AI voice agents, small business pricing, and what actually works for under 100 seats.
The 2024 NPRM proposes mandatory penetration tests every 12 months and vulnerability scans every 6 months. Here is how an AI voice agent should be tested in 2026.
AWS HealthScribe became the open scribe layer EHR vendors built on top of in 2026. Here's the API surface, the per-encounter pricing, the BAA terms.
Why Claude salon AI is reshaping voice and chat automation, with concrete patterns for appointment AI in production deployments. A field-tested view from production teams shippi...
© 2026 CallSphere LLC. All rights reserved.