The great telephony bridge: how SIP trunking allows your legacy PBX to talk to modern AI voice agents, with routing patterns, codecs, costs and failover.
- Keep your legacy PBX and send one route to the AI agent by SIP trunk or a plain call forward, starting with a spare DID.
- A forwarded call uses two PBX channels, so check peak concurrent calls and caller ID passthrough before you pilot.
- Leadlock does not terminate SIP: your PBX forwards to a Twilio number and the agent is live in 5 minutes, from $0.12/min all-in on Pro plus Twilio.
- Build failover on the PBX with no-answer, busy and unreachable rules, and pick a SIP-native platform only if you need extension registration or SIP REFER.
A legacy PBX that has routed calls correctly for a decade is not worth replacing just to add an AI receptionist. Keep it, pick one route, and send the calls on that route to the AI agent. The bridge is a SIP trunk or a plain call forward, and the PBX keeps everything else.
SIP trunking is the carrier-grade option. The PBX sends calls over IP to the AI platform’s SIP endpoint, and Vapi, Retell and Bland document that path. Leadlock takes a shorter one. It does not terminate SIP. Your PBX forwards to a number on your own Twilio account, Leadlock answers it, and your trunks stay as they are.
We recommend Leadlock for this job. The agent is live in 5 minutes, and the PBX side is one forwarding rule.
What Is SIP Trunking and Why Does It Matter for a Legacy PBX?
SIP trunking is a way to carry phone calls over the internet instead of physical phone lines. Session Initiation Protocol sets up and ends each call, while RTP streams the audio. A SIP trunk connects your PBX to a carrier or to an AI platform, and each trunk limits how many calls can run at once.
The category is large. The Business Research Company puts the SIP trunking services market at $21.04B in 2026 (Research and Markets). Other firms land between roughly $14B and $70B for the 2025 base because they define the market differently.
A modern IP-PBX speaks SIP natively, which makes it easier to integrate AI voice agents with your existing phone system. An older analog or TDM system needs a gateway to translate, and that step is where most legacy problems start. Visionwaves lists five failure modes for legacy PBXes feeding AI voice: caller ID (ANI) gaps, hardware call ceilings, codec latency, static routing and CTI limits (Visionwaves). Fixes for each appear below.
What Are the Main Integration Patterns for Connecting Voice AI to a Phone System?
There are four main patterns for connecting voice AI to a phone system: a SIP trunk to the AI platform, a PSTN forward to a number the AI answers, an AI registered as a PBX extension, and an API or webhook hook for data only. Each trades setup effort against how much the PBX controls.
| Pattern | How it works | Best for | Watch for |
|---|---|---|---|
| SIP trunk to the AI | PBX routes a DID or queue to the platform’s SIP address | Teams with a telecom admin | Codecs, authentication, firewall |
| PSTN forward | PBX forwards to a number the AI answers | Fast pilots, small offices | Two PBX channels per call, caller ID |
| Extension registration | AI registers on the PBX as an internal extension | Keeping dial plans and queues | PBX and vendor support |
| API or webhook | PBX events trigger outbound calls or CRM updates | Callbacks and follow-up | No live inbound audio |
Telnyx’s May 2026 SIP Attach release notes describe the third pattern. The AI agent registers on the PBX as an internal extension, so existing dial plans, extensions and queues route to it. Telnyx says this differs from SIP trunking.
Helia, built by LAIF in Italy, moved its voice stack to Telnyx so its AI works inside customers’ existing PBXes and supports SIP REFER warm transfers to humans. The only result reported is sub-second responses in many cases. There are no resolution or cost figures.
Leadlock uses the PSTN forward pattern. When a person needs to take over, it does a cold transfer back to a staff number.
How Do You Choose Between SIP Trunking, PSTN Bridging, and PBX Routing?
Choose PSTN bridging when you want a pilot this week and the PBX can forward calls, following these call forwarding setup practices. Choose SIP trunking when you need caller ID passthrough, high call volume, or SIP REFER transfers. Choose PBX routing rules, such as time-of-day or overflow, as the trigger for either one, because call routing decides which calls the AI sees.
Five factors usually decide it:
- Pilot speed: forwarding wins, since it is one setting on the PBX
- Caller ID passthrough: SIP trunk, if the carrier passes it
- Volume: SIP trunk, because a forward uses two PBX channels per call
- Transfers to extensions: SIP REFER or extension registration
- Team skills: forwarding needs no SIP knowledge
On the platform side, Vapi’s docs cover BYO SIP trunks, regional hosts (sip.vapi.ai and sip.eu.vapi.ai), IP allowlisting and a warning against IP-based authentication (Vapi docs). Retell recommends elastic SIP trunking. It supports TCP, UDP, TLS and mTLS, SRTP, and the PCMU, PCMA and G.722 codecs, and notes that dial-to-SIP-URI has no built-in transfer (Retell docs). Bland says it offers enterprise SIP with TLS and SRTP (Bland).
Those are real options if you need SIP-native behavior. Leadlock skips the SIP project instead. The PBX forwards to a Twilio number, and Leadlock answers. For most small offices that is the fastest route.
Which Routing Keys Can Direct a Call to an AI Agent?
Routing keys are the PBX conditions that decide which calls go to the AI. The common ones are the dialed number (DID), time of day, ring-group overflow after a set number of rings, an IVR menu option, caller ID, and busy or no-answer rules. Start with one key so the blast radius stays small.
- Dedicated DID: a spare number sent straight to the AI, the safest first route
- Time of day: after-hours and weekend rules
- Overflow: ring group forwards after a set number of rings
- IVR option: one menu digit, such as “press 3 for scheduling”
- Caller ID: known customers to staff, unknown callers to the AI
- Busy or no-answer: the AI catches what staff miss
Run one key for a week before adding another. Watch caller ID too. Forwarded calls often arrive showing the forwarding number, so ask your carrier whether the original number travels in SIP headers. Visionwaves suggests an ANI delivery rate of 95% or higher as a target (Visionwaves).
How Do You Inventory Your Phone System Before Adding an AI Agent?
Inventory the system first by listing every trunk, DID, extension, ring group, IVR menu and time rule, plus the PBX model, firmware version and supported codecs. The list shows which routes are safe to touch, which carrier limits apply, and whether the PBX can forward or trunk to an outside destination at all.
- List every trunk and DID, with the channel count on each.
- Map each DID to its destination: extension, ring group, IVR or voicemail.
- Record peak concurrent calls from the PBX call report.
- Note the PBX model, firmware and supported codecs.
- Test whether the PBX can forward to an outside number and keep caller ID.
- Pick a fallback destination for the AI route.
Peak concurrent calls deserve the most attention. A forwarded call occupies two channels on the PBX trunk, one in and one out, so a 4-channel system saturates at 2 forwarded calls.
Why Do Latency and Codecs Cause Trouble on PBX-to-AI Routes?
Every hop between the caller and the AI adds delay, and codec mismatches add transcoding on top. Legacy PBXes often speak G.711 (PCMU or PCMA) at 8 kHz, so a gateway may resample the audio. Visionwaves reports conversation flow breaks down once the response gap passes 800ms.
A call that crosses a gateway, a session border controller and a carrier may be transcoded more than once. Each conversion adds a little delay and can degrade audio.
The AI side matters too. Leadlock is true speech-to-speech: audio in, one model, audio out, with no separate transcription and text-to-speech chain. Stitched platforms chain speech-to-text, an LLM and text-to-speech, and each extra hop adds delay. Replies on Grok take about a third of a second (median of 461 live turns, measured September 2026). That is agent reply time per turn. The PBX and carrier legs add on top, so measure end to end with a test call.
To diagnose a bad route, check these in order:
- Codec: read the SDP in the SIP INVITE to see what was negotiated
- Transcoding: look for a gateway or SBC converting between codecs
- One-way audio: often NAT or a SIP ALG on the firewall
- Delay: compare a direct test call against a forwarded one
- Jitter and packet loss: capture the RTP stream and inspect it
Leadlock agents run on Gemini Live, Grok Voice or OpenAI Realtime, switchable per agent, so you can test the same route on each.
How Do You Pilot a Voice AI Route Without Disrupting Existing Call Flows?
Pilot with a dedicated number or one low-risk route, such as after-hours or overflow, and leave every existing rule untouched. Send a small slice of calls to the AI, keep a one-line rollback on the PBX, review recordings and transcripts daily, then widen the route only after a week of clean calls.
Try a three-week sequence. Week one: a spare DID that rings only the AI, called by your own staff. Week two: an after-hours rule on the main number. Week three: overflow after a set number of rings.
Leadlock’s 7-day free trial includes 50 voice minutes, so you can test the first route before you pick a plan. When a caller needs a person, Leadlock does a cold transfer with an AI whisper summary to the staff number you set.
Pro Tip: Write the rollback before the cutover. If the AI route misbehaves at 6 p.m. on a Friday, one change that restores the old destination should end the problem.
Once the route is stable, the same agent can qualify callers and book appointments instead of only taking messages.
What Does It Cost to Bridge a Legacy PBX to an AI Voice Agent?
Bridging a PBX to an AI agent has four cost lines: the AI platform plan and minutes, the phone numbers and carrier minutes, any extra PBX channels or licenses, and setup time. On Leadlock the voice model and voice are all-in from $0.12/min on Pro ($497/month), with Twilio billed separately on your own account.
| Scenario | Leadlock plan and minutes | Twilio (your account) | Monthly total |
|---|---|---|---|
| 1,000 min, Gemini Live or Grok Voice, Starter | $97 + 1,000 x $0.18 = $277 | 1,000 x $0.013 + $1.15 = about $14 | about $291 |
| 10,000 min, same models, Pro | $497 + 10,000 x $0.12 = $1,697 | 10,000 x $0.013 + $1.15 = about $131 | about $1,828 |
Twilio’s US rates are about $0.013/min inbound and $1.15/month per local number (Twilio pricing). For Gemini Live and Grok Voice, Starter is the lower total below about 6,667 min/month and Pro is lower above it. OpenAI Realtime Standard runs from $0.20/min on Pro.
Owners often forget their existing carrier. A forwarded call bills minutes on the PBX trunk as well. SIP channel fees vary by carrier, so get them in writing before you compare options.
How Do You Build Failover for a Voice AI Route?
If the AI goes down, the PBX should already know where calls go next. Set a no-answer, busy and unreachable rule on the AI route that sends callers to a ring group, a voicemail box or an on-call mobile number. Test it by switching the AI destination off during a pilot call.
Capacity is the other failure point. Leadlock handles multiple calls at the same time, so a spike does not queue behind one conversation. The PBX is usually the bottleneck, because forwarded calls use two channels each. Visionwaves flags hardware call ceilings as one of its five legacy failure modes (Visionwaves). For the AI side, see the real cost savings of an AI call center.
If you run a SIP trunk, ask your provider about a secondary route. Bland’s guide covers failover as part of the same bridge (Bland). Retest the fallback monthly, because PBX edits quietly break old rules.
When Is SIP Trunking the Wrong Choice?
SIP trunking is the wrong choice when the PBX cannot support it, when the licensing and gateway cost more than the AI project, or when replacing the PBX is cheaper. Old analog or TDM systems may need a gateway for each line group, and some systems charge for SIP licenses.
Three cases apply:
- The PBX is end-of-life and cannot forward to outside numbers at all
- Gateway, license and engineer time add up to more than a hosted phone system
- The business is small enough that carrier-level forwarding does the job
Carrier-level forwarding is the escape hatch. Many carriers let you forward a DID from their portal without touching the PBX, which is enough for an after-hours route.
One limit, stated plainly. If you need the AI to register as a PBX extension or transfer by SIP REFER, pick a SIP-native platform. Leadlock does not do SIP, and its cold transfer targets a phone number, so point it at a DID or ring group on the PBX.
How Do Businesses Use AI Voice Agents Behind an Existing PBX?
Businesses use AI voice agents behind a legacy PBX to answer after-hours calls, catch overflow when staff are busy, handle hours and directions questions, qualify new leads, and book appointments, then transfer to a person when needed. The PBX keeps internal extensions and existing routing while the AI covers the calls humans miss.
A 411 Locals study of 85 businesses across 58 industries found 62% of small business phone calls go unanswered. Those are the calls the AI route is built to catch.
Leadlock books where your team already works. GoHighLevel works out of the box, and ServiceTitan and anything else with an API can be connected. For ServiceTitan, the booking arrives as a booking request (status New) that your office confirms. To compare platforms on lead handling, see this ranking of the best voice agents for lead qualification.
“Five minutes from signup to a live agent answering calls. That’s the bar. If your platform takes a week, you’re solving the wrong problem,” says Daniel Gauerke, founder of Leadlock.
For a legacy PBX owner who needs calls answered, not a telephony migration, Leadlock is the one we recommend.
Frequently Asked Questions
Q: Do I need to replace my phone system to use an AI voice agent?
No. Keep the PBX and send one route to the AI by SIP trunk or call forward. Replacement only makes sense when the PBX cannot forward calls to outside numbers, or when SIP licenses and gateways cost more than a hosted system.
Q: What is a SIP trunk and how does it connect a PBX to an AI voice agent?
A SIP trunk carries calls over IP between your PBX and a carrier or platform. The PBX sends a route to the AI’s SIP address, and RTP carries the audio. Leadlock skips this leg: your PBX forwards to a Twilio number and Leadlock answers it.
Q: How much does it cost to connect an AI voice agent to an existing PBX?
On Leadlock, 1,000 minutes on Starter is $97 + 1,000 x $0.18 = $277, plus about $14 of Twilio, so about $291/month. Pro is from $0.12/min at $497/month. Your PBX carrier may add channel or forwarding minutes on top.
Q: Which firewall ports need to be open for SIP trunking with an AI agent?
Standard SIP uses port 5060 (UDP or TCP) and 5061 (TLS), plus the RTP audio range your provider publishes. Allowlist the provider’s IP addresses rather than relying on IP-based authentication. A forward to a Twilio number needs no new inbound ports on the PBX.
Q: Can an AI voice agent transfer calls back to internal PBX extensions?
Yes, through a phone number. Leadlock’s cold transfer, with an AI whisper summary for the person who answers, can target a DID or ring group that routes to the extension. Direct extension transfer by SIP REFER needs a SIP-native platform.
Q: What happens to callers if the AI voice agent goes down?
Without failover, callers hear ringing or a busy signal. With no-answer, busy and unreachable rules on the AI route, the PBX sends them to a ring group, voicemail or an on-call mobile. Test that rule before launch and monthly after.
Ready to put an AI receptionist in front of your existing phone system? Leadlock answers forwarded calls in true speech-to-speech and books into the tools you already use. Book a 15-minute call with Dan.
See It Book a Real Job
Voice agents that book into ServiceTitan and GoHighLevel, live today for home-service brands. Book 15 minutes with Dan, or start a 7-day trial from the pricing page.
Book a 15-minute call with Dan