VICIdial runs on Asterisk, so connecting it to a SIP trunk is ordinary Asterisk work behind VICIdial’s admin screens. There are only a handful of settings, and getting each one slightly wrong is what produces the failed calls, the silent calls and the wrong caller ID.
Where the trunk lives
In VICIdial the trunk is a carrier, under Admin → Carriers. One carrier entry holds what would otherwise be split across Asterisk’s SIP configuration and its dialplan, and VICIdial writes it into Asterisk on each server for you. Use one carrier entry per provider route.
The examples below use the classic chan_sip format that most VICIdial installs still run. Substitute your provider’s details for the placeholders.
The registration string
Fill this in only if your provider authenticates by registration. If they authenticate by your server’s IP address, leave it empty — a registration you do not need is one more thing that can fail at three in the morning.
register => youruser:yourpassword@sip.yourprovider.example:5060
The account entry
This is the peer definition — how Asterisk reaches the provider:
[yourtrunk]
type=peer
host=sip.yourprovider.example
port=5060
disallow=all
allow=alaw
allow=ulaw
dtmfmode=rfc2833
insecure=port,invite
qualify=yes
nat=force_rport,comedia
context=trunkinbound
- Put
alawfirst for UK traffic. G.711 A-law is the UK and European standard; u-law is North American. Getting the order wrong forces transcoding somewhere along the path — more on codecs here. dtmfmode=rfc2833carries keypresses properly through IVRs and is what most providers expect.context=trunkinboundis VICIdial’s standard context for inbound calls, so calls to your DIDs land where VICIdial expects them.- If your provider authenticates by username and password, add
defaultuser=andsecret=with the values they give you.
The globals string
YOURTRUNK = SIP/yourtrunk
A variable the dialplan refers to. It means switching a campaign to a different route later is one edit rather than a search through the dialplan.
The dialplan entry
exten => _944X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _944X.,n,Dial(${YOURTRUNK}/${EXTEN:1},,tTo)
exten => _944X.,n,Hangup()
- The campaign dials with a prefix of
9, followed by the number in international format starting44. The pattern_944X.matches those calls. ${EXTEN:1}strips the leading 9, so the provider receives44…. Check which format your provider wants —44…,0044…,+44…or national0…— and adjust.- Keep the AGI line. It is how VICIdial logs the call. Remove it and calls stop appearing properly in VICIdial’s reports, which you will only notice when you need them.
- For the US, the same idea with a pattern such as
_91NXXNXXXXXXsends1…to the provider.
Campaign settings that depend on the trunk
- Dial prefix must match the dialplan pattern —
9in this example. A mismatch means every call fails to find a route. - Campaign CallerID is your presentation number. It must be a valid number you hold, and your provider must pass it through unchanged — see which number to show.
- Dial timeout. Give phones time to ring. Cut calls off after a few seconds and you abandon people who were reaching for the phone, and it reads as a poor answer rate.
- Auto-dial level and drop rate are compliance settings as much as productivity ones — the UK rules are here.
Testing before you go live
- In the Asterisk console,
sip show peersshould show the trunk asOK. If you register,sip show registryshould show it as registered. - Manually dial a test number from an agent screen and check audio in both directions.
- Watch the call in
asterisk -rvvv. If it fails, the SIP response tells you why — here is what the common ones mean. - Check the caller ID that actually arrives on a mobile.
- Confirm the call appears in VICIdial’s call reports, which proves the AGI line is working.
The usual failures
- 403 or 401 on every call — your IP is not authorised with the provider, or the credentials are wrong.
- 404 or 484 — the number format is wrong: the prefix was not stripped, or the provider expects a different format.
- One-way audio — almost always NAT. Check the
natsetting, your RTP port range on the firewall, and Asterisk’s external address settings. - Calls that drop at about 30 seconds — usually a SIP acknowledgement not making it back through NAT, so the far end gives up on the call.
- The wrong caller ID — the campaign CallerID is not set, or something between you and the provider is overwriting it.
On PJSIPNewer builds can run carriers on PJSIP rather than chan_sip. The ideas are the same — authentication, codecs, DTMF, NAT and the dialplan — but the account entry uses PJSIP’s separate endpoint, AOR and auth sections instead of a single peer.
Standard SIP trunks that drop straight into VICIdial and any Asterisk-based dialler.
See SIP trunking


