Asterisk Troubleshooting: SIP Debugging Intro (Latest Versions)
Updated guide for modern Asterisk (PJSIP era): sip debugging intro with real configs, common mistakes, and troubleshooting steps.
SIP debugging is one of the most important skills for anyone working with Asterisk (modern PJSIP-based systems).
Many real telecom failures are not caused by dialplan logic, but by SIP signaling errors, authentication failures, codec negotiation issues, or NAT problems.
This article introduces a clear, practical approach to debugging SIP step-by-step, so problems can be diagnosed quickly instead of guessed.
What SIP Debugging Actually Means
SIP debugging means reading and understanding:
- SIP messages exchanged during registration or calls
- Authentication challenges (401 / 403)
- Codec negotiation inside SDP
- Call routing and response codes
Once you can read SIP logs, most Asterisk problems become predictable.
First Rule of SIP Troubleshooting
Always determine:
- Did the SIP request reach Asterisk?
- Did Asterisk match it to an endpoint?
- Did the call reach the dialplan?
- Did RTP audio start flowing?
These four checkpoints isolate nearly every issue.
Essential Debug Commands in Modern Asterisk (PJSIP)
asterisk -rvvv
pjsip set logger on
pjsip show endpoints
pjsip show registrations
pjsip show contacts
These commands reveal:
- Incoming/outgoing SIP messages
- Registration status
- Endpoint matching
- Contact IP/port information
Understanding SIP Response Codes Quickly
- 100 Trying → request received
- 180 Ringing → destination ringing
- 200 OK → call answered
- 401 Unauthorized → auth challenge
- 403 Forbidden → auth rejected
- 404 Not Found → endpoint/dialplan missing
- 486 Busy Here → extension busy
- 488 Not Acceptable Here → codec mismatch
- 603 Decline → call rejected
Memorizing common SIP codes speeds up troubleshooting dramatically.
Debugging Registration Problems
If phones or trunks cannot register:
- Check credentials in
authsection - Confirm correct server IP/port
- Verify firewall is open
Useful command:
pjsip show registrations
Look for: Registered / Rejected / Timeout.
Debugging Inbound Call Failures
If provider calls never reach dialplan:
- Enable SIP logger and confirm INVITE arrives
- Check identify IP match in PJSIP
- Verify endpoint context routing
- Confirm firewall allows SIP port
Missing identify rule is one of the most common causes.
Debugging Outbound Call Failures
- Watch INVITE sent to provider
- Check response code (403, 404, 488, etc.)
- Verify caller ID format
- Confirm trunk authentication
When SIP Works but Audio Fails
This means signaling is correct but RTP is broken.
- NAT misconfiguration
- Firewall blocking RTP port range
- Wrong external_media_address
SIP debugging alone is not enough — RTP analysis may be required.
Reading SIP Logs Without Panic
SIP logs look complex, but focus only on:
- INVITE → did it arrive?
- Response code → what failed?
- SDP → which codec/IP/port chosen?
- BYE → who ended the call?
Ignore extra headers until needed.
Common Beginner Debugging Mistakes
- Changing dialplan without checking SIP logs
- Ignoring firewall/NAT issues
- Confusing codec problems with SIP failures
- Using old
sip set debuginstead of PJSIP logger
Simple SIP Troubleshooting Flow (Real-World Method)
- Enable SIP logger
- Check registration status
- Confirm INVITE arrives
- Check response code
- Verify RTP audio
Following this order prevents random guessing.
Key Takeaway
SIP debugging is about reading call signaling step-by-step, not blindly changing configuration.
By mastering:
- PJSIP logger output
- SIP response codes
- Endpoint/identify matching
- RTP vs SIP separation
you gain the ability to diagnose nearly any Asterisk call failure quickly and confidently.
Want to see API-driven CRM + Telecom workflows in action? Try the WhatsApp bot or explore the demos.
Comments (0)
Be the first to comment.