News
SIP (Session Initiation Protocol) is the signaling language of modern VoIP communications. Every call setup, modification, and teardown flows through a series of SIP messages, each carrying structured headers that tell the network who is calling, where to send the response, which path the message traveled, and what capabilities are available. Understanding these headers is essential for anyone deploying, troubleshooting, or optimizing a VoIP system.
When a call fails with "404 Not Found" or "480 Temporarily Unavailable," the answer is almost always hidden in the SIP headers. When calls experience one-way audio, the culprit is frequently a mismatch between the Contact header and the actual media path. When registration fails repeatedly, the WWW-Authenticate and Authorization headers hold the key. Mastering SIP headers transforms debugging from guesswork into systematic diagnosis.
This article provides a comprehensive guide to every critical SIP header, explaining its purpose, format, common values, and role in the call flow. Whether you are configuring a PBX, debugging trunk connectivity, or building a SIP application, this reference will help you read SIP traces with confidence.
A SIP message consists of three parts:
Example INVITE request:
INVITE sip:bob@example.com SIP/2.0\r\nVia: SIP/2.0/UDP alice.example.com:5060;branch=z9hG4bK776asdhds\r\nFrom: Alice <sip:alice@example.com>;tag=1928301774\r\nTo: Bob <sip:bob@example.com>\r\nCall-ID: a84b4c76e66710@pc33.example.com\r\nCSeq: 1 INVITE\r\nContact: <sip:alice@alice.example.com>\r\nContent-Type: application/sdp\r\nContent-Length: 230\r\n\r\nv=0\r\no=alice 2890844526 2890844526 IN IP4 alice.example.com\r\ns=-\r\nc=IN IP4 192.168.1.100\r\nm=audio 49170 RTP/AVP 0 8 9 18\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000
Each header serves a specific purpose in routing, authentication, session management, or capability negotiation.
Purpose: Records the path a SIP message has taken through the network, ensuring responses follow the reverse path back to the originator.
Format: Via: SIP/2.0/<transport> <sent-by>;branch=<branch-param>
Key Points:
Common Issues: Missing or malformed Via headers cause routing loops. Duplicate branch parameters indicate retransmissions. Incorrect sent-by addresses cause responses to be sent to wrong destinations.
Purpose: Identifies the originator of the request — who initiated the call.
Format: From: <display-name> <sip:uri>;tag=<tag-param>
Key Points:
Common Issues: Missing tag parameter in initial requests causes dialog establishment failures. Mismatched From tags across related messages break dialog association.
Purpose: Identifies the intended recipient of the request — who is being called.
Format: To: <display-name> <sip:uri>[;tag=<tag-param>]
Key Points:
Common Issues: Premature To tags in requests confuse proxies. Missing To tags in responses prevent proper dialog matching.
Purpose: Provides the direct URI where subsequent requests within the same dialog should be sent — bypassing proxies after initial routing.
Format: Contact: <sip:uri>[;expires=<seconds>][;q=<quality>]
Key Points:
Common Issues: Private IP addresses in Contact headers behind NAT cause one-way audio. Expired registrations result in 404 errors. Multiple contacts without q-values create ambiguous routing.
Purpose: Globally unique identifier for a call or registration sequence.
Format: Call-ID: <local-id>@<host>
Key Points:
Purpose: Orders requests within a dialog and matches requests to their responses.
Format: CSeq: <sequence-number> <method>
Key Points:
Common Issues: Non-monotonic CSeq sequences cause server rejections. Mismatched methods in CSeq vs. actual request method cause parsing errors.
Purpose: Prevents infinite routing loops by limiting the number of hops a request can traverse.
Format: Max-Forwards: <integer>
Key Points:
Purpose: Sent by servers/proxies in 401/407 responses to challenge the client for credentials.
Format: WWW-Authenticate: Digest realm="<realm>", nonce="<nonce>", algorithm=MD5, qop="auth"
Key Points:
Purpose: Carries the client's credential response to a WWW-Authenticate challenge.
Format: Authorization: Digest username="<user>", realm="<realm>", nonce="<nonce>", uri="<request-uri>", response="<hash>"
Key Points:
Purpose: Declares the MIME type of the message body.
Format: Content-Type: application/sdp
Key Points:
Purpose: Specifies the exact byte length of the message body.
Format: Content-Length: <byte-count>
Key Points:
Purpose: Advertises which SIP methods the endpoint supports.
Format: Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, UPDATE, REFER
Key Points:
Purpose: Negotiate SIP extensions and optional features.
Key Points:
Check these headers in order:
Common header-related causes:
Header checklist for failed INVITEs:
New Rock Technologies builds intelligent SIP header handling directly into its IP PBX and gateway platforms, reducing the operational burden of manual header management. The company's systems automatically generate correct Via, Call-ID, CSeq, and Contact headers with proper NAT-aware addressing, eliminating the most common sources of one-way audio and registration failures. Built-in SIP normalization engines transparently correct malformed headers from non-compliant endpoints, ensuring interoperability across diverse vendor equipment without manual intervention.
New Rock's diagnostic tools provide real-time SIP trace visualization with color-coded header highlighting, making it easy to identify problematic headers during troubleshooting. The web interface displays decoded header contents alongside raw SIP messages, helping administrators understand complex interactions without memorizing RFC specifications. For organizations managing multiple trunks and domains, New Rock's centralized policy engine enforces consistent header manipulation rules — including topology hiding, privacy screening, and custom header injection — across the entire deployment from a single configuration point.
Beyond automation, New Rock provides comprehensive documentation and training resources specifically focused on SIP protocol fundamentals, enabling IT teams to build internal expertise rather than depending entirely on vendor support. Their technical support team includes SIP protocol specialists who can interpret complex trace captures and recommend precise configuration adjustments. This combination of intelligent automation, transparent diagnostics, and expert support ensures that even organizations without dedicated VoIP engineers can maintain reliable, standards-compliant SIP communications.
SIP headers are the DNA of VoIP communications — every aspect of call routing, authentication, session management, and capability negotiation is encoded in these structured fields. Understanding them transforms VoIP from a black box into a transparent, debuggable system. Whether you are troubleshooting a stubborn one-way audio issue, designing a multi-site deployment, or building a custom SIP application, header literacy is the foundation of competence. Platforms like those from New Rock Technologies abstract away much of the complexity while providing the visibility needed when things go wrong — giving you the best of both worlds: simplicity for routine operations and depth for advanced troubleshooting. Master these headers, and you master VoIP itself.
Tel:021-61202700 / 52217917
Address:5/F Block B, Building 1, No.188 Pingfu Road, Xuhui District, Shanghai 200231, China
Copyright © New Rock Technologies, Inc. All Rights Reserved. 沪ICP备15008515号-1