How to Add AI Voice Agents to Asterisk and FreePBX
How to put an AI voice agent on Asterisk, FreePBX or Issabel with one dialplan bridge, with transfers and hangups over AMI and your recordings left where they are.
By Walter Brennan

Asterisk is the quiet workhorse behind an enormous share of the world's call centers, whether directly or through FreePBX and Issabel. If you already run it, you do not need a new phone system to run an Asterisk AI voice agent. You need a way to get call audio to the agent and back, and a way for the agent to transfer or hang up. Asterisk gives you both, cleanly, without changing how the rest of your system works.
This guide covers the standard integration on Asterisk and FreePBX, the AudioSocket alternative, when to choose each, and how transfers, recording and dispositions fit in.
First principle: an Asterisk AI voice agent is a destination
As with any good AI integration, the agent is not a platform you migrate to. It is a destination your dialplan can reach. A call comes in or goes out as it always has, and at the point where you would connect a person, you connect the AI instead. Everything upstream (your trunks, inbound routes, queues and CDRs) stays where it is.
That framing keeps the integration small and reversible. You are adding an extension, not rebuilding your PBX.
Option 1: The dialplan bridge (simplest)
The most portable approach streams RTP audio directly, in the G.711 codec Asterisk already uses, with a single dialplan pattern. Each campaign on the platform has a three-digit dial code, and one pattern serves them all. The portal generates the exact entry with your organization's token filled in; a simplified version looks like this:
exten => _85XXX,1,Answer()
same => n,Set(PORT=${CURL(https://app.bridgeside.ai/api/asterisk/rtp?token=SECRET&agent=${EXTEN:2})})
same => n,Dial(UnicastRTP/app.bridgeside.ai:${PORT}/c(ulaw))
same => n,Hangup()
The CURL step asks the platform for a media port dedicated to this call and tells it which agent to use. The Dial bridges audio both ways. Because there is no transcoding (u-law in, u-law out), latency stays low and voice quality stays clean.
On FreePBX, put the entry in extensions_custom.conf and create a Custom Destination such as from-internal,85001,1, so you never have to fight the GUI. Point an inbound route or a queue's failover at the custom destination and calls flow to the agent.
Choose the dialplan bridge when you want the least moving parts, you are on Asterisk 15 or newer (it needs chan_rtp), and you want the same pattern to work across VICIdial, plain Asterisk and FreePBX.
Option 2: AudioSocket (on request)
Asterisk 16.6 and newer also include AudioSocket, which carries call audio over a plain TCP stream instead of RTP. Some teams prefer it where UnicastRTP is awkward on their network. AudioSocket carries audio only, so transfer and hangup still ride over AMI (covered below), the same as with the dialplan bridge.
The dialplan bridge is the standard setup and the one the portal generates. If your network makes a direct RTP dial difficult, talk to us about AudioSocket before you start.
Choose AudioSocket when you are on Asterisk 16.6 or newer and a direct RTP dial is impractical on your network.
Transfers and hangups over AMI
Whichever media path you pick, the agent controls the call over the Asterisk Manager Interface, which your system already runs for other tooling.
- Warm transfer to a human. When the agent qualifies a lead, it issues an AMI
Redirectto move the live channel to an agent extension or a queue. The lead's channel is already up, so the human joins a call in progress. The campaign webhook'scall.transferredevent carries the conversation so far if you want to show it to the closer. - Hangup. When the conversation is done, the agent hangs up the channel over AMI, and your normal post-call handling runs.
Because these are ordinary channel operations, nothing about your queues, CDR or recording needs to change to support them.
Recording stays where it is
You do not need a second recording system. The AI is the far end of a standard bridge or a monitored channel, so MixMonitor or your FreePBX call-recording settings capture the full conversation exactly as they would for a human call. Your QA team reviews AI calls in the same place, with the same tools.
Bridgeside AI does not store call audio. If you want searchable text, the platform keeps a per-call transcript for the retention period you choose (1 to 90 days), so you can search across thousands of calls for a phrase or a compliance disclosure.
Dispositions and CRM
For outbound campaigns, the outcome of each call should land somewhere useful. On VICIdial the platform writes dispositions back through the non-agent API (see the VICIdial integration guide). Plain Asterisk and FreePBX have no lead database, so each campaign sends signed webhooks instead (call.started, call.transferred, call.appointment and call.ended), which you can feed into your CRM. A "disposition" here is just the structured summary of the call: outcome, a short summary, the answers captured to your questions, and whether the lead asked to be removed.
That last point is not optional. If a lead says "do not call me again," that must become a suppression in whatever list system you use, immediately. Wire the agent's DNC signal to your suppression process before you scale.
FreePBX-specific notes
FreePBX adds a friendly layer on top of Asterisk, and a few habits make the integration painless:
- Put the dialplan pattern in
extensions_custom.confso upgrades and GUI reloads do not clobber it. - Use a Custom Destination to expose the agent context to inbound routes, queues and IVR steps.
- If you use FreePBX's recording, leave it on; it captures the AI call without extra work.
- Keep AMI credentials in FreePBX's manager settings scoped to what the platform needs (the hangup event,
HangupandRedirect), and allow only the platform's address.
Concurrency and capacity
Both integration styles scale per call. Each conversation gets its own media port or socket, so simultaneous capacity is bounded by your bandwidth, your trunk capacity and the channels on your plan, not by a shared bottleneck in the integration itself. Size your RTP port range and your outbound bandwidth for peak concurrent AI calls and you are set.
A short rollout checklist
- Use the dialplan bridge unless your network rules out UnicastRTP.
- Add the pattern to
extensions_custom.confand reload. - Expose it via a Custom Destination (FreePBX) or route directly (plain Asterisk).
- Enable scoped AMI access from the platform.
- Confirm recording captures a test call end to end.
- Wire dispositions and, critically, DNC suppression.
- Pilot one campaign or one inbound route, then expand.
The whole point is that Asterisk and FreePBX are already good at everything except being an AI. Add the one thing they are missing, at one point in the call path, and leave the rest of your battle-tested setup alone.
The Asterisk integration page summarizes the setup, and if you run FreeSWITCH instead, see our FreeSWITCH guide. Want to try it on your own Asterisk or FreePBX box? Get in touch and we will help you stand up a pilot.