Tutorial · Voice

3CX × AI Voice Agents: replace your IVR with natural conversation.

Step-by-step guide to connecting an AI receptionist to your 3CX phone system via SIP trunk.

webbyou 12 min read·2026·Voice

No more keypad menus. In this article we walk through the full configuration — 3CX users, queues, SIP trunk, AI agent with transfer rules — so callers talk to an AI that actually routes them to the right department.

We all know them — Interactive Voice Response menus. When you call your bank or ISP, you navigate at least one (often four nested) menus. Listening carefully for options, picking the closest match, and starting over when you misclick.

Modern AI Voice Agents support natural language and can integrate into your phone system via SIP — perfect for 3CX. We start by building the AI agent, then configure 3CX to route calls correctly.

Meet the players: 3CX and your AI Voice Agent

3CX Phone System

3CX is a leading open-standard IP PBX with a full unified-communications suite — calls, video, live chat, all from one platform. For this project you need the self-hosted or private-cloud version, as custom SIP providers are unsupported on 3CX's own cloud.

AI Voice Agent (ElevenLabs / Retell)

AI Voice Agents hold natural conversations, understand context, and act on user input. Instead of rigid menus they respond dynamically. ElevenLabs Conversational AI and Retell.ai are the two market leaders that ship with SIP integration out of the box.

What you need

  • 3CX Pro or Enterprise (self-hosted or private-cloud — NOT 3CX's own cloud)
  • AI Voice Agent account (ElevenLabs Conversational AI or Retell.ai)
  • An E.164-format phone number (fictional/test numbers work for demos)
  • Access to your 3CX Admin Console
  • 30-60 minutes uninterrupted time

For private-cloud hosting, 3CX runs comfortably on a small VPS at Vultr, Hetzner or DigitalOcean — from €5/month.

How-to

Full configuration in 4 steps

Follow these in order. Don't skip — some depend on earlier ones.

Stap 01

3CX: create users, queues and SIP trunk

Start in the 3CX Admin panel. We create the people who answer phones, the queues the AI routes to, and the SIP trunk that connects 3CX to the AI.

  • Go to Users → create one per person (e.g. James Sullivan for Sales, Mike Wazowski for Support, Randal Boggs for Accounts)
  • Go to Call Handling → '+ Add Queue' → one queue per department
  • Note the Virtual extension number per queue — you need it in step 2
  • Add users to each queue under the 'Users' tab
  • Voice & Chat → '+ Add Trunk' → 'Generic SIP Trunk (IP Based)'
  • Trunk name: 'AI Voice Trunk', Registrar/Server: sip.rtc.elevenlabs.io
  • Options tab: Transport mode = TCP, Include diversion header support = Yes
  • Outbound rule: prefix matching your demo number, length = full number length, Prepend = +
INFO

ElevenLabs only accepts E.164-formatted traffic. For tests use fictional numbers reserved for demos. The + in the prepend is mandatory — without it the call never connects.

Stap 02

Build the AI agent with transfer rules

Log into your ElevenLabs or Retell account → Conversational AI → Agents → New Agent. Start with a Business Agent template, customize the System Prompt for your business, then enable the Transfer tool and link each department to a 3CX queue.

  • In agent config scroll to 'Tools' → enable 'End Call' and 'Transfer to number'
  • Click the gear next to 'Transfer to number' → Add Rule
  • Transfer type: SIP REFER
  • Number type: SIP URI
  • SIP URI: sip:<queue_extension>@<3cx_server_address>
  • Condition: 'If the caller wants to speak to the Sales department'
  • Repeat for every department
  • Optionally add a rule for 'if caller is aggressive' or 'asks to speak to a human'
# Personality
Je bent Celia, een professionele en efficiënte receptioniste voor {{business_name}}. Je bent vriendelijk, helder en behulpzaam, en zorgt dat alle bellers bij de juiste afdeling uitkomen.

# Environment
Je beantwoordt telefoongesprekken voor {{business_name}}. Bellers zijn extern en willen mogelijk Sales, Boekhouding, of Support bereiken.

# Tone
Je antwoorden zijn warm, hoffelijk en vriendelijk — maar kort. Vermijd jargon. Spreek in een normaal tempo en articuleer duidelijk.

# Goal
Je primaire doel is binnenkomende gesprekken efficient naar de juiste afdeling te leiden.

1. Begroeting: "Goedendag, met {{business_name}}, met wie wilt u worden doorverbonden?"
2. Information Gathering: Identificeer welke afdeling de beller nodig heeft (Sales, Boekhouding, Support). Bij twijfel: stel verhelderende vragen.
3. Confirmation: "Dus u wilt naar {{department}}? Een moment, ik verbind u door."
   Verbind direct door via de Transfer to Number tool.

# Guardrails
Geef geen informatie over financien, interne policies, of medewerkers buiten publieke directory info.
Bij agressieve bellers: beleefd afbreken.

# Tools
- End Call
- Transfer to Number (SIP REFER)

Sample System Prompt — adapt '{{business_name}}' and department names.

TIP

Pick a quality voice (e.g. ElevenLabs Multilingual v2 with a regional accent). Callers can hear the difference between Multilingual v2 and cheaper TTS immediately.

Stap 03

Connect ElevenLabs to 3CX

Time to wire the two sides together. On the AI platform side we configure incoming SIP; in 3CX we ensure the outbound rule matches.

  • In ElevenLabs: Telephony → Phone Numbers → 'Import Number' → 'From SIP Trunk'
  • Label: 'AI Switchboard <company>'
  • Phone number: the same number you set in the 3CX outbound rule
  • Origination URI: sip:sip.rtc.elevenlabs.io:5060;transport=tcp
  • Media Encryption: Allowed
  • Outbound Configuration → Address: <your 3CX FQDN>, Transport: Auto, Media Encryption: Allowed
  • Save → bind your AI agent to the SIP trunk via 'Set Agent'
LET OP

Match the + and number EXACTLY between the 3CX outbound rule and the ElevenLabs phone number. A one-character difference and your call never lands.

Stap 04

Test and go live

From a 3CX extension dial the number you configured for the AI. You should hear the AI ask where to route your call. Test every department.

  • Dial the AI number from an internal extension — verify the greeting
  • Ask for each department — verify the transfer hits the right queue
  • Test edge cases: aggressive caller, unclear request, out-of-scope question
  • Tune the System Prompt based on what you hear — iterate 3-5 times
  • Happy? Route your external inbound number in 3CX to this AI number
  • Monitor first-week call logs in both 3CX and ElevenLabs/Retell
INFO

Don't route ALL inbound calls to the AI at once — start with after-hours or lunch to limit risk. Scale up as confidence grows.

Troubleshooting

Stuck? Common issues and fixes

Issues I hit during the first rollout — and how to fix them.

The call never connects or rings out

Fix: Check you added the '+' in the prepend section of your outbound rule, and that the numbers match exactly between 3CX outbound rules and the ElevenLabs Phone Numbers config.

The agent says the call transfer failed

Fix: Make sure 'Include diversion header support' is enabled on your ElevenLabs SIP trunk. Also check the queue extension numbers in your Human Transfer Rules match those in 3CX.

Agent reads an extension number but won't transfer

Fix: Ensure 'Transfer to Number' is enabled in the agent's Tools section. In your System Prompt, explicitly tell the agent it can transfer directly without reading numbers aloud.

Audio cuts out or sounds robotic

Fix: Try Media Encryption set to 'Allowed' (not 'Required') on both sides. Verify your 3CX server has enough bandwidth for the codec (G.711 minimum).

AI can't understand the caller

Fix: Increase boosted_keywords in the agent config with industry-specific terms. Keep voice_temperature low (0.3-0.5) for more consistent answers.

Too complex? We install it for you.

We offer telephony consulting for businesses replacing their IVR with AI — from 3CX setup to SIP trunking to AI agent training. Book an intake and we deliver within 2 business days.