This is the configuration guide we wish existed when we started running VICIdial. Most carrier setup docs give you a SIP proxy address and a username and tell you to figure out the rest. If you have configured Asterisk trunks before, that is enough. If you have not — or if you have but your AMD is not detecting correctly, your DTMF is breaking IVR menus, or you are getting one-way audio behind NAT — you need more than credentials.
This guide walks through VICIdial SIP trunk configuration step by step, with the specific settings that work on SIPNEX infrastructure. SIPNEX is an FCC-licensed carrier, and our support team runs VICIdial themselves. These are not theoretical recommendations — they are the settings we use on our own dialer servers.
Prerequisites
Before configuring the trunk, confirm you have:
- VICIdial installed and functional (web interface accessible, Asterisk running)
- SIPNEX account provisioned (you have received your SIP proxy address, authentication method, and credentials)
- At least one DID provisioned on your SIPNEX account
- Your VICIdial server’s public IP address (for IP-based authentication) or your digest auth credentials
- Firewall rules allowing SIP (UDP 5060) and RTP (UDP 10000-20000) traffic to/from SIPNEX SIP proxy IPs
Authentication method
SIPNEX supports two authentication methods:
IP-based authentication (recommended for fixed-location servers). We whitelist your server’s public IP address. No username or password needed — traffic from your IP is automatically authenticated. This is the most secure and simplest method. If your server has a static public IP, use this method.
Digest authentication (for dynamic IPs or hosted environments). We provide a username and password. Your Asterisk registers to our proxy using these credentials. Use this when your server’s IP may change (cloud VMs with dynamic IPs, servers behind ISPs without static IP service).
sip.conf trunk configuration
For IP-based authentication, add this peer to your /etc/asterisk/sip.conf:
[sipnex]
type=peer
host=YOUR_SIPNEX_PROXY_IP
port=5060
disallow=all
allow=ulaw
allow=alaw
dtmfmode=rfc2833
insecure=invite
canreinvite=no
nat=force_rport,comedia
qualify=yes
qualifyfreq=60
context=trunkinbound
For digest authentication, modify the peer:
[sipnex]
type=peer
host=YOUR_SIPNEX_PROXY_IP
port=5060
username=YOUR_USERNAME
secret=YOUR_PASSWORD
fromuser=YOUR_USERNAME
disallow=all
allow=ulaw
allow=alaw
dtmfmode=rfc2833
insecure=invite,port
canreinvite=no
nat=force_rport,comedia
qualify=yes
qualifyfreq=60
context=trunkinbound
register => YOUR_USERNAME:YOUR_PASSWORD@YOUR_SIPNEX_PROXY_IP/sipnex
Key settings explained
Codec: ulaw first. allow=ulaw as the primary codec gives you G.711u — uncompressed 64 kbps audio at the highest quality. This is the VICIdial standard and the codec that AMD performs best with. Adding allow=alaw as a fallback provides G.711a compatibility for international termination. Do not add G.729 unless bandwidth is severely constrained — G.729 compression introduces subtle artifacts that can interfere with AMD accuracy.
DTMF: rfc2833. dtmfmode=rfc2833 sends DTMF tones as out-of-band events (RFC 2833/RFC 4733) rather than in-band audio or SIP INFO. This is the standard for SIP trunking and provides the most reliable DTMF delivery. If your IVR menus are not responding to caller input, DTMF mode mismatch between your system and the carrier is the most likely cause. SIPNEX expects RFC 2833.
NAT: force_rport,comedia. If your VICIdial server is behind a NAT router or firewall (which most are), these settings are essential. force_rport tells Asterisk to use the source port from the incoming packet rather than the port declared in the SIP headers. comedia tells Asterisk to send RTP media to the address and port from which it receives media, rather than the address in the SDP. Without these settings, you get one-way audio — you can hear the other party but they cannot hear you, or vice versa.
canreinvite=no. This forces all RTP media to flow through your Asterisk server rather than being sent directly between endpoints. For call recording and AMD to work, media must pass through Asterisk. Setting this to yes would allow media to bypass Asterisk, breaking recording and AMD.
qualify=yes with qualifyfreq=60. Sends SIP OPTIONS pings to the carrier every 60 seconds to verify the trunk is alive. If the carrier does not respond, Asterisk marks the trunk as unreachable. This enables your system to detect carrier outages and trigger failover if configured.
VICIdial admin panel configuration
After configuring sip.conf, add the trunk in the VICIdial admin panel:
-
Go to Admin → Carriers and click Add A New Carrier
-
Set the carrier fields:
- Carrier ID: SIPNEX (or any label)
- Carrier Name: SIPNEX
- Registration String: (leave blank for IP auth, or your register string for digest)
- Template ID: (leave blank)
- Account Entry: The
[sipnex]peer block from sip.conf - Globals String: (leave blank unless you have custom globals)
- Dialplan Entry: Your outbound dial context for SIPNEX
-
Set the dialplan in the Dialplan Entry to route outbound calls through the SIPNEX trunk. A basic outbound dialplan for US domestic:
exten => _1NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _1NXXNXXXXXX,2,Dial(SIP/${EXTEN}@sipnex,,tTo)
exten => _1NXXNXXXXXX,3,Hangup()
This routes all 11-digit US numbers (1 + 10 digits) through the sipnex peer. Adjust the pattern for E.164 format if your carrier expects the + prefix: SIP/+${EXTEN}@sipnex.
Inbound DID routing
Configure inbound routing so calls to your SIPNEX DIDs reach the correct VICIdial destination:
In /etc/asterisk/extensions.conf, under the [trunkinbound] context (matching the context=trunkinbound in the peer definition):
[trunkinbound]
exten => _X.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _X.,2,AGI(agi://127.0.0.1:4577/call_inbound)
Then in the VICIdial admin panel, configure Inbound DIDs (Admin → Inbound DIDs) to map each DID to the appropriate in-group (queue).
Outbound caller ID configuration
For local presence dialing, configure CID groups in VICIdial:
- Go to Admin → Caller ID Groups and create a new CID group
- Add your SIPNEX DIDs organized by area code
- In your campaign settings, set the CID Group to the group you created
- Set CID Type to match the area code of the called number
VICIdial will automatically select an outbound CID from the group that matches the area code of the number being dialed. All DIDs in the group must be verified on your SIPNEX account for A-level STIR/SHAKEN attestation.
Troubleshooting common issues
One-way audio. Almost always a NAT issue. Verify nat=force_rport,comedia is set. Verify your firewall allows UDP traffic on ports 10000-20000 (RTP range) from SIPNEX proxy IPs. Check that canreinvite=no is set.
No audio in either direction. RTP ports are blocked by your firewall. Open UDP 10000-20000 to/from SIPNEX IPs.
DTMF not working (IVR menus unresponsive). Verify dtmfmode=rfc2833. If the remote end uses a different DTMF mode, the tones are not being decoded. RFC 2833 is the SIPNEX standard.
AMD not detecting accurately. Verify allow=ulaw is the primary codec. G.729 compression can cause AMD false positives (live answers classified as machines) because the compressed audio changes the waveform characteristics that AMD algorithms analyze. Use G.711u for best AMD performance.
Registration failures (digest auth). Check username, password, and proxy address. Verify your firewall allows outbound UDP 5060 to SIPNEX proxy IPs. Check register => line syntax — a misplaced character breaks registration silently.
403 Forbidden on outbound calls. Your outbound CID is not authorized. The number in the From header does not match any DID on your SIPNEX account. Verify the CID is a SIPNEX-provisioned number and that it is in E.164 format if required.
Calls drop after 30 seconds. Often a SIP session timer issue. Check if session-timers is set in sip.conf and whether the carrier and your system agree on the timer values. On SIPNEX, this is rarely an issue with default settings.
Frequently asked questions
What codec should I use with VICIdial on SIPNEX?
G.711u (ulaw) as the primary codec. This provides the highest audio quality and the best AMD (Answering Machine Detection) accuracy. AMD algorithms are tuned for uncompressed audio waveforms — G.729 compression changes the waveform characteristics and increases false positive rates. Add G.711a (alaw) as a fallback for compatibility. Only use G.729 if your bandwidth is severely constrained (satellite links, very low-bandwidth connections). Each G.711 call uses approximately 85 kbps — plan your bandwidth accordingly using our sizing guide.
Do I need a static IP for SIPNEX SIP trunking?
A static IP is recommended because it enables IP-based authentication — the most secure and simplest method. With IP auth, no username/password is needed; we whitelist your IP and all traffic from it is automatically authenticated. If your server has a dynamic IP (common with some cloud providers), use digest authentication instead (username/password registration). Digest auth works but is slightly less secure (credentials could theoretically be intercepted if you are not using TLS) and requires your Asterisk to maintain an active registration with our proxy.
How do I set up failover on SIPNEX?
Failover can be configured at two levels. Carrier-level: SIPNEX can configure primary and secondary endpoints for your inbound DIDs — if your primary server stops responding to OPTIONS pings, inbound calls route to your backup destination. PBX-level: configure multiple trunks in Asterisk with priority routing — if the primary trunk returns errors, calls route to the secondary trunk. For comprehensive failover, use both: carrier-level failover for inbound calls and PBX-level failover for outbound call routing.
SIPNEX provides the SIP trunks and the VICIdial expertise to get your dialer running correctly. If you get stuck during configuration, our support team has configured the same settings on their own systems. Get trunk credentials or see our rates.
Keep Reading
SIPNEX
FCC-licensed carrier with its own STIR/SHAKEN SP certificate. Operator-owned. SIP trunks built for operators who dial at volume.