🔌 How to Set Up SIP Trunk for AI Call Center (Beginner's Guide)
Complete beginner's guide to SIP trunks for AI call centers. Choose the right provider, configure Asterisk, handle NAT issues, and connect to AI voice agents.
By the end of this guide, you'll understand SIP trunks, choose the right provider for your market, configure Asterisk to receive calls, and connect to an AI voice agent. No prior telephony experience needed.
What Is a SIP Trunk?
A SIP trunk is essentially a phone line that runs over the internet instead of copper wire. It connects your PBX (Asterisk) to the public phone network, letting you make and receive calls programmatically.
SIP stands for Session Initiation Protocol — it's how internet phones talk to each other.
Think of it like email vs traditional mail:
- Traditional phone line = physical mail (slow, expensive, one-at-a-time)
- SIP trunk = email (fast, cheap, parallel)
Why You Need a SIP Trunk for AI Call Centers
To answer calls with AI, you need:
- A phone number (DID — Direct Inward Dialing)
- A way for the phone network to reach your AI server
SIP trunks provide both. Your DID rings → SIP trunk forwards to your Asterisk → Asterisk routes to AI.
Choosing a SIP Trunk Provider
For Nepal
| Provider | Strengths | Pricing |
|---|---|---|
| Buel (sip.buel.app) | Used by TalkC.ai, Yango Nepal. Good support. | Custom (contact buel.app) |
| NTC | Government-owned, wide reach | NPR 1-3/min |
| Ncell | Major operator, good QoS | NPR 1.50-3/min |
For India
| Provider | Strengths | Pricing |
|---|---|---|
| Twilio India | Reliable, well-documented | INR 1-2/min |
| Knowlarity | Indian provider, local support | INR 0.50-1.50/min |
| Exotel | Indian provider, good API | INR 0.75-2/min |
| Tata Tele | Established, enterprise-grade | Custom |
For Global / Other Markets
- Twilio — Most popular, well-documented, expensive
- Vonage — Good for enterprise
- Plivo — Developer-friendly, competitive pricing
- SignalWire — Built by FreeSWITCH creators, technical
What to Ask Your SIP Trunk Provider
- What's the price per DID per month?
- What's the inbound/outbound per-minute rate?
- Do you support PJSIP and SIP over UDP/TCP?
- What codecs do you support? (PCMU, PCMA, G.722)
- How many concurrent channels can I run?
- Is there a setup fee?
- Can I bring my existing number (port in)?
- Do you support DTMF tones?
- Where are your servers located? (affects latency)
- What's the SLA/uptime guarantee?
Getting Your SIP Credentials
Once you sign up, you'll receive:
- SIP host: e.g., sip.buel.app, sip.twilio.com
- Username: e.g., 1011_td, your_account_sid
- Password: the auth token
- DID: e.g., 9700004414 (your phone number)
- Port: usually 5060
Configuring Asterisk PJSIP
Edit /etc/asterisk/pjsip.conf (or use included files):
; ==================== Transport ==================== [transport-udp] type=transport protocol=udp bind=0.0.0.0:5060 ; ==================== Registration ==================== [buel-trunk] type=registration transport=transport-udp outbound_auth=buel-trunk-auth server_uri=sip:sip.buel.app client_uri=sip:1011_td@sip.buel.app retry_interval=60 ; ==================== Auth ==================== [buel-trunk-auth] type=auth auth_type=userpass username=1011_td password=YOUR_PASSWORD ; ==================== AOR ==================== [buel-trunk-aor] type=aor contact=sip:sip.buel.app ; ==================== Endpoint ==================== [buel-trunk-endpoint] type=endpoint transport=transport-udp context=from-trunk disallow=all allow=ulaw allow=alaw outbound_auth=buel-trunk-auth aors=buel-trunk-aor from_user=1011_td direct_media=no rtp_symmetric=yes ; ==================== Identify ==================== [buel-trunk-identify] type=identify endpoint=buel-trunk-endpoint match=YOUR_PROVIDER_IP
Configuring Dialplan
Edit /etc/asterisk/extensions.conf:
[from-trunk]
exten => _X.,1,NoOp(Incoming call from ${CALLERID(num)})
exten => _X.,n,Answer()
exten => _X.,n,Set(CALL_UUID=${SHELL(uuidgen | tr -d '
')})
exten => _X.,n,MixMonitor(/var/spool/asterisk/recording/${CALL_UUID}.wav,r)
exten => _X.,n,AudioSocket(${CALL_UUID},127.0.0.1:9092)
exten => _X.,n,Hangup()
Reload Asterisk
sudo asterisk -rx 'pjsip reload' sudo asterisk -rx 'dialplan reload' ; Verify registration sudo asterisk -rx 'pjsip show registrations'
Should see: Registered status.
Common Issues and Fixes
1. Registration Fails
- Wrong credentials
- Firewall blocking port 5060 — open UDP 5060 + RTP 10000-20000
- Provider IP whitelist — give them your server's static IP
2. One-Way Audio
- NAT issue — set
external_media_addressin transport config - RTP ports blocked — open UDP 10000-20000
3. Choppy Audio
- Network jitter — switch to TCP transport if available
- CPU overload — upgrade server
- Codec mismatch — ensure both sides support same codec
4. Calls Drop After 30 Seconds
- NAT keep-alive — set
qualify_frequency=30in AOR config - SIP timer issues — enable
session_timersproperly
Connecting to AI Voice Agent
Once Asterisk is receiving calls, connect to your AI:
- Build a voice-bridge service listening on 127.0.0.1:9092
- Use AudioSocket protocol (raw PCM stream)
- Forward audio to Gemini Live or your AI of choice
- Stream AI response back
Or use TalkC.ai which handles all this and just needs your SIP credentials.
Production Checklist
- Static IP for your server
- Firewall rules: SIP 5060/UDP, RTP 10000-20000/UDP
- Fail2ban to block SIP brute-force attacks
- SSL for any admin panels
- Backup: regular asterisk.conf, pjsip.conf backups
- Monitoring: alert on registration loss, high CPU, audio underruns
- Call recording: comply with local laws (consent required in some regions)
Frequently Asked Questions
How much does a SIP trunk cost in Nepal?
Typically $5-50/month per DID + per-minute charges (NPR 1-3/min). Providers like Buel offer competitive rates for AI/automation use cases.
Can I use Twilio in Nepal?
Yes, but Twilio is more expensive than local providers and adds latency. Better to use a local provider like Buel, NTC, or Ncell for Nepal-based businesses.
How many concurrent calls can one SIP trunk handle?
Depends on your provider's plan. Typical SIP trunks allow 5-50 concurrent channels. For high-volume operations, you can have multiple trunks load-balanced.
Do I need a static IP for SIP?
Strongly recommended. Most providers require IP whitelisting for authentication. Dynamic IPs cause connection issues and security risks.
Can I receive AND make calls with the same trunk?
Yes, most SIP trunks are bidirectional. You can answer incoming calls and initiate outbound calls (e.g., for campaigns) through the same trunk.
Ready to see TalkC.ai in action?
Get a personalized demo of TalkC.ai's voice AI platform. See how we handle 22,000+ calls/month for Yango Nepal, OCR Nepal, and government offices — same-day setup, 70+ languages.
Book a Demo →