VICIdial is still the most widely deployed open-source dialer, and its carrier screen is where most new trunks go wrong. A missing context, a dial prefix that does not match the dialplan, or a caller-ID setting overridden at campaign level can each make a perfectly good route look broken. This guide walks through a clean setup against a generic SIP carrier, using placeholder hosts you can replace with the values in your portal.
Key takeaways
- Prefer IP authentication when your VICIdial servers have static public IPs.
- Send caller ID in both From and P-Asserted-Identity with sendrpid=pai, in E.164 format.
- Make sure the campaign dial prefix matches the dialplan pattern that strips it.
- Every CallerID used at campaign, list, area-code or in-group level must be approved in your portal.
- Verify peer status, CLI display, two-way audio, DTMF and CDR matching before ramping a campaign.
On this page
Before you start
- Admin access to VICIdial (Admin → Carriers) and SSH access to the dialer servers.
- Your trunk details from the portal: SIP host, port, authentication method, username and password or the IP addresses to whitelist.
- The CLIs you are approved to present, in E.164 format.
- The public IP addresses of every VICIdial server that will send calls.
Setup steps
Choose authentication
Use IP authentication if your dialer servers have static public IPs; add them under Endpoints in the portal. Otherwise use username and password registration. IP authentication is simpler and avoids registration timeouts.
Create the carrier
In VICIdial go to Admin → Carriers → Add a New Carrier. Set Carrier ID to CLIROUTES, Protocol to SIP, Server IP to the dialer server, and Active to Y once testing is complete.
Enter the account entry
Paste the account entry below into the Account Entry field. It defines how Asterisk talks to the trunk.
Enter the registration string
If you use registration, add the registration string. Leave it blank for IP authentication.
Enter the dialplan entry
Add the dialplan entry that strips your dial prefix and sends calls in E.164 to the carrier.
Set caller ID
Set the campaign CallerID to an approved CLI in E.164 format, and decide whether list-level or in-group CallerID overrides apply.
Set the campaign dial prefix
In Campaigns → Detail, set Dial Prefix to 9 so calls match the dialplan entry.
Reload and test
Submit the carrier, then run the verification checks below before activating the campaign.
Account entry (chan_sip)
Most VICIdial builds still use chan_sip for carriers. The entry below is a safe starting point.
[cliroutes]
type=peer
host=sip.example-carrier.net
port=5060
username=YOUR_SIP_USERNAME
secret=YOUR_SIP_PASSWORD
fromuser=YOUR_SIP_USERNAME
fromdomain=sip.example-carrier.net
insecure=port,invite
context=trunkinbound
disallow=all
allow=ulaw
allow=alaw
dtmfmode=rfc2833
qualify=yes
nat=force_rport,comedia
sendrpid=pai
trustrpid=yessendrpid=pai sends your caller ID in a P-Asserted-Identity header as well as From, which is how most carriers expect identity between trusted peers. For IP authentication remove username, secret and fromuser.
register => YOUR_SIP_USERNAME:[email protected]:5060Dialplan entry
VICIdial adds the campaign dial prefix in front of the number. The entry below matches prefix 9, strips it, and sends the rest with a leading +. Adjust the pattern if your lists store numbers without country code.
exten => _9X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9X.,n,ExecIf($["${CALLERID(num):0:1}" != "+"]?Set(CALLERID(num)=+${CALLERID(num)}))
exten => _9X.,n,Dial(SIP/cliroutes/+${EXTEN:1},,tTo)
exten => _9X.,n,Hangup()Using PJSIP instead
Newer VICIdial installs on Asterisk 18+ can use PJSIP carriers. The equivalent configuration is below; change the Dial line to PJSIP/+${EXTEN:1}@cliroutes. Our Asterisk PJSIP integration guide covers this in more detail.
[cliroutes]
type=endpoint
context=trunkinbound
disallow=all
allow=ulaw,alaw
dtmf_mode=rfc4733
aors=cliroutes
outbound_auth=cliroutes-auth
from_domain=sip.example-carrier.net
send_pai=yes
trust_id_outbound=yes
rtp_symmetric=yes
force_rport=yes
[cliroutes]
type=aor
contact=sip:sip.example-carrier.net:5060
qualify_frequency=60
[cliroutes-auth]
type=auth
auth_type=userpass
username=YOUR_SIP_USERNAME
password=YOUR_SIP_PASSWORDVerification checks before going live
- In the Asterisk CLI, run
sip show peer cliroutes(orpjsip show endpoint cliroutes) and confirm status is OK with a sensible latency. - Place a manual call from an agent screen to your own mobile. Confirm the CLI displays correctly and audio flows both ways.
- Run
sip set debug peer cliroutesand check the INVITE: Request-URI in E.164, From and PAI carrying your approved CLI. - Test DTMF on an IVR you control to confirm RFC 2833 events arrive.
- Check the call appears in your CLIRoutes portal CDRs with the same CLI and duration.
- Start the campaign at a low dial level, watch ASR, PDD and SIP responses for 30 minutes, then ramp.
Routing inbound DIDs into VICIdial
If you also receive calls on DID numbers, the context=trunkinbound in the account entry sends them into VICIdial's inbound handling. Create the DID under Inbound → Add a New DID, using the number in the format the carrier sends it (usually E.164 without the +, for example 442071234567), and route it to an in-group, a call menu or an extension.
asterisk -rx "sip set debug peer cliroutes"
# place a test call to your DID, then look for:
# INVITE sip:[email protected]:5060 SIP/2.0
# The user part (442071234567) is what VICIdial must match.If the carrier sends a + and VICIdial does not match it, either create the DID with the + or strip it in a custom dialplan entry before the call reaches trunkinbound.
Caller ID strategy in VICIdial
VICIdial lets you set caller ID at several levels, and the most specific one wins. Plan this deliberately so agents always present an approved number.
| Level | Setting | Typical use |
|---|---|---|
| Campaign | Campaign CallerID | Default for every call in the campaign |
| List | Campaign CID Override | Different number per client or region |
| Area code | CID Groups (AC-CID) | Local presence with numbers you hold in each area |
| In-group | Outbound CallerID for transfers | Calls transferred out of an in-group |
Every number used in any of these places must be approved in your portal. Calls presenting numbers that are not approved are rejected with 403, which is the most common cause of "some calls fail" reports after a new list is loaded with its own CID override.
Clusters and failover
In a VICIdial cluster, add the carrier on every dialer server (the Server IP field is per carrier entry) and whitelist each server's public IP. For resilience, configure a second endpoint in the portal and a second carrier entry pointing at it, then use a dialplan with Dial() to the primary and a fallback to the secondary only on CHANUNAVAIL or CONGESTION, never on busy or no-answer.
exten => _9X.,n,Dial(SIP/cliroutes/+${EXTEN:1},,tTo)
exten => _9X.,n,GotoIf($["${DIALSTATUS}" = "CHANUNAVAIL"]?alt)
exten => _9X.,n,GotoIf($["${DIALSTATUS}" = "CONGESTION"]?alt:end)
exten => _9X.,n(alt),Dial(SIP/cliroutes-b/+${EXTEN:1},,tTo)
exten => _9X.,n(end),Hangup()Securing the dialer
Dialer servers are a common target for toll fraud because a compromised server can place expensive international calls quickly. Protect yours before going live:
- Allow SIP (5060/5061) only from your carrier's signalling IPs and your own phones or WebRTC gateway; block it from everywhere else.
- Use strong, unique passwords for every phone and agent account, and disable unused phone extensions.
- Run fail2ban against Asterisk security logs to block repeated registration attempts.
- In the CLIRoutes portal, enable only the destinations you call and set a daily spend alert on the wallet.
- Keep VICIdial, Asterisk and the operating system patched.
IP authentication to the carrier combined with destination restrictions limits the damage even if an agent credential leaks, because calls can only leave from your servers and only to the countries you have enabled.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| All calls 403 Forbidden | Server IP not whitelisted or wrong credentials | Add every dialer IP in the portal; re-check username/password |
| Calls fail with 404 or 484 | Number not in E.164 or prefix not stripped | Check dialplan pattern and list format |
| Wrong caller ID shown | Campaign or list CallerID override | Check campaign, list and in-group CallerID settings |
| One-way audio | NAT or firewall blocking RTP | Set nat=force_rport,comedia and open the RTP range |
| 503 at shift start | CPS burst above limit | Pace dialing or request a higher CPS |
For a full list of response codes and what they mean on dialer traffic, see SIP Response Codes for Dialer Operators. For capacity planning, see SIP Channels & CPS Sizing.
About the author
Tomás Herrera, Senior Voice Engineer
Tomás configures and debugs SIP for dialer platforms every day. Before CLIRoutes he ran the telephony stack for a multi-site contact centre handling several million outbound calls a month.
Published · Last reviewed