VoIP Troubleshooting Guide
Asterisk SIP Debugging Guide
9 min read · Updated April 2026
Asterisk's SIP debugging output is dense, verbose, and essential. When registrations fail, calls drop, or audio doesn't work, the answers are in the logs — if you know how to read them. This guide covers everything from enabling debug output to interpreting the traces and finding the root cause.
1. Enabling SIP debug in Asterisk
For chan_sip (legacy)
; In Asterisk CLI
asterisk -r # connect to running instance
core set verbose 5 # verbose logging level
core set debug 5 # debug logging level
sip set debug on # enable SIP message logging
sip set debug peer <name> # debug specific peer only
sip set debug ip <ip> # debug traffic from specific IP
For PJSIP (modern)
; In Asterisk CLI
pjsip set logger on # enable PJSIP logging
pjsip set logger off # disable when done
logger add channel console PJSIP # add PJSIP to console output
Logging to file
; In /etc/asterisk/logger.conf
[logfiles]
console => notice,warning,error,verbose
/var/log/asterisk/full => notice,warning,error,verbose,debug
/var/log/asterisk/sip_trace => notice,warning,error,verbose,debug,pjsip,dtmf
After editing logger.conf, reload with logger reload in the CLI. Enable rotation with logrotate to prevent log files growing unbounded in production.
2. Essential CLI commands
Registration status
sip show peers # show all chan_sip peers and registration status
sip show peer <name> # detailed info for one peer
pjsip show contacts # show PJSIP registered contacts
pjsip show endpoint <name> # detailed PJSIP endpoint info
Active calls
core show channels # show all active channels
core show channel <name> # detailed channel info
sip show channels # show SIP-specific channel details
Trunk status
sip show registry # show outbound registration status
sip show settings # show global SIP settings
pjsip show registrations # PJSIP outbound registration status
RTP statistics
rtp set debug on # enable RTP packet logging
rtp set debug ip <ip> # RTP debug for specific IP
core show channel <name> | grep RTP # show RTP stats for channel
3. Reading the debug output
Registration flow
A successful registration in the log looks like:
<--- Received SIP request (541 bytes) --->
REGISTER sip:pbx.example.com SIP/2.0
<--- Transmitting SIP response (532 bytes) --->
SIP/2.0 401 Unauthorized
WWW-Authenticate: Digest realm="asterisk"...
<--- Received SIP request (712 bytes) --->
REGISTER sip:pbx.example.com SIP/2.0
Authorization: Digest username="1001"...
<--- Transmitting SIP response (289 bytes) --->
SIP/2.0 200 OK
Contact: <sip:
[email protected]:5060>;expires=120
Call setup flow
Look for the INVITE, the 100 Trying, 180 Ringing, and 200 OK sequence. Missing any of these indicates where the failure occurred. A 200 OK without a subsequent ACK means the ACK was lost — common NAT issue.
Key error patterns in logs
WARNING: username mismatch → wrong username in peer config
WARNING: Peer auth: Wrong password → incorrect secret
WARNING: Can't match to call → dialog matching failure
ERROR: No route to host → network unreachable
WARNING: Got SIP response 403 → forbidden (check IP/credentials)
WARNING: Got SIP response 404 → user not found on remote server
4. Common failure patterns
Pattern 01
Registration loops (401 repeating)
If you see REGISTER → 401 → REGISTER → 401 repeating indefinitely, the credentials are wrong. Check the secret in sip.conf or pjsip.conf against the PBX user configuration. Also check that the realm in the 401 WWW-Authenticate matches what the peer expects.
Pattern 02
One-way audio (RTP port mismatch)
In the debug output, compare the RTP port Asterisk is sending to vs the port in the remote SDP. If Asterisk is sending to a private RFC 1918 address, NAT is the issue. Enable nat=yes (chan_sip) or set external_media_address in PJSIP transport.
Pattern 03
Calls drop after 30 seconds
Look for "No ACK received" in the log at the 30-second mark. This indicates Timer H expiry. Check if the ACK is being sent by the remote party — if it appears in the debug but the call still drops, a firewall is blocking the ACK. Enable qualify=yes for peers to detect connectivity issues early.
Pattern 04
No audio after transfer
Blind and attended transfers generate re-INVITEs that update the SDP media addresses. Look for the re-INVITE in the debug after the transfer and check that the new Contact and SDP addresses are correct and reachable.
5. chan_sip vs PJSIP
Asterisk ships with two SIP channel drivers. chan_sip is the legacy driver (deprecated but still widely used). PJSIP is the modern replacement with better standards compliance, IPv6 support, and WebRTC capability.
Key differences for debugging:
- chan_sip uses
sip.conf — PJSIP uses pjsip.conf (or pjsip_wizard.conf)
- chan_sip debug:
sip set debug on — PJSIP debug: pjsip set logger on
- PJSIP log format includes component names (res_pjsip, res_pjsip_registrar) making it easier to filter
- PJSIP supports multiple transports per endpoint — chan_sip uses global transport settings
If you're running Asterisk 18+ and still using chan_sip, migration to PJSIP is strongly recommended — chan_sip has known issues with NAT traversal and TLS that are not being fixed.
6. Analyzing Asterisk traces with SIPSymposium
Copy your Asterisk SIP debug output directly into SIPSymposium. The analyzer parses Asterisk's native debug format, extracts the SIP dialog, and provides structured findings — registration analysis, codec negotiation, RTP addressing, and timer diagnostics — without you having to manually trace through thousands of log lines.
Frequently asked questions
How do I enable SIP debug in Asterisk?
For chan_sip: connect with asterisk -r then run sip set debug on. For PJSIP: run pjsip set logger on. Set verbose level with core set verbose 5. Logs appear in /var/log/asterisk/full. To debug a specific peer use sip set debug peer peername or sip set debug ip 192.168.1.100 to debug traffic from a specific IP address.
How do I troubleshoot Asterisk registration failures?
In Asterisk SIP debug output look for the REGISTER → 401 → REGISTER → 200 OK sequence. If you see REGISTER → 401 repeating without a 200 OK, credentials are wrong — check the secret in sip.conf against the PBX user. Use sip show peers (chan_sip) or pjsip show contacts (PJSIP) to see registration status. Check the realm in the 401 WWW-Authenticate matches your peer configuration.
What is the difference between chan_sip and PJSIP in Asterisk?
chan_sip is the legacy SIP driver using sip.conf — deprecated since Asterisk 19. PJSIP (res_pjsip) is the modern replacement using pjsip.conf with separate transport, auth, AOR, and endpoint objects. PJSIP offers native TLS, WebRTC support, IPv6, and multiple simultaneous registrations per endpoint. For new deployments use PJSIP. For debugging: sip set debug on vs pjsip set logger on.
Stuck on an Asterisk SIP issue?
Paste your Asterisk SIP debug output directly into SIPSymposium. The analyzer understands Asterisk's log format and gives you structured findings in seconds.