How SIP Calls Work
Animated visual diagrams explaining SIP signaling, call setup, registration, failure scenarios, and message structure. The definitive visual guide for VoIP and telecom engineers.
Signaling Protocol
SIP handles call setup, modification, and teardown. It does not carry voice data — that is handled by RTP on separate ports.
Text-Based Messages
SIP messages are human-readable text (similar to HTTP), making them easy to debug with packet capture tools like Wireshark.
Request / Response Model
Like HTTP, SIP uses methods (INVITE, BYE) and numeric response codes (200 OK, 404 Not Found) in a client-server pattern.
Defined in RFC 3261
The core SIP specification. Extended by dozens of additional RFCs for features like presence, messaging, and call transfer.
SIP Ports Reference
Key network ports used in SIP/VoIP communication for signaling and media transport.
Basic SIP Call Flow
A successful SIP call from INVITE to BYE, showing every signaling message between the caller, proxy server, and callee.
INVITE & 100 Trying — Caller sends INVITE to proxy. Proxy immediately replies 100 Trying (stops retransmissions), then forwards INVITE to callee.
180 Ringing — Callee's phone rings and sends 180 back through the proxy. Caller hears ringback tone.
200 OK — Callee answers. 200 OK contains SDP with callee's media capabilities and RTP port.
ACK — Caller acknowledges the 200 OK, completing the three-way handshake. The dialog is now established.
RTP Media — Voice/video data flows directly between endpoints (or through a media relay) using RTP on negotiated ports.
BYE & 200 OK — Either party sends BYE to end the call. The other side confirms with 200 OK and releases resources.
SIP Registration Flow
How a SIP phone authenticates with the registrar using digest authentication (challenge-response).
401 Unauthorized and includes a nonce (random challenge) in the WWW-Authenticate header. The phone then hashes its password with this nonce and the realm, sending the credentials in the Authorization header. This prevents passwords from being sent in cleartext. Registration typically expires after 3600 seconds and must be refreshed periodically.
Failed Call Scenarios
Common SIP call failure flows showing how different error conditions are signaled.
sngrep or Wireshark to capture the actual SIP messages for debugging.
SIP Message Structure
Anatomy of a real SIP INVITE message with SDP body, showing every field and its purpose.
/* --- Request Line --- */
INVITE sip:bob@example.com SIP/2.0
/* --- Headers --- */
Via: SIP/2.0/UDP caller.example.com:5060;branch=z9hG4bK776
Max-Forwards: 70
From: Alice <sip:alice@example.com>;tag=1928301774
To: Bob <sip:bob@example.com>
Call-ID: a84b4c76e66710@caller.example.com
CSeq: 314159 INVITE
Contact: <sip:alice@192.168.1.100:5060>
Content-Type: application/sdp
Content-Length: 142
/* --- SDP Body (Session Description Protocol) --- */
v=0
o=alice 53655765 2353687637 IN IP4 192.168.1.100
s=Session SDP
c=IN IP4 192.168.1.100
t=0 0
m=audio 49170 RTP/AVP 0 8 97
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:97 opus/48000/2Request Line — Method (INVITE), Request-URI (who to call), and SIP version
Via — Records the transport path; branch is a unique transaction ID
From / To — Logical sender and recipient with display names and SIP URIs
Call-ID — Globally unique identifier for this dialog (call session)
CSeq — Command sequence number, ensures proper ordering of requests
Contact — Direct URI for subsequent requests (bypasses proxy)
SDP Body — Describes media capabilities: codecs (G.711u, G.711a, Opus), IP, and RTP port
m=audio line — Offers port 49170 for audio using RTP with payload types 0, 8, 97
SIP/VoIP vs Traditional Phone Call
How packet-switched VoIP differs from circuit-switched PSTN telephony.
Traditional (PSTN)
Circuit-switched — a dedicated physical path is held open for the entire call duration
Exchange
Line
Exchange
SIP / VoIP
Packet-switched — voice is digitized into packets that share the network with other data
Server
Server
| Aspect | Traditional PSTN | SIP / VoIP |
|---|---|---|
| Switching | Circuit-switched (dedicated path) | Packet-switched (shared network) |
| Bandwidth | 64 kbps fixed per channel (G.711) | Variable — 6-90 kbps depending on codec |
| Protocol | SS7 / ISDN signaling | SIP / H.323 signaling + RTP media |
| Infrastructure | Copper/fiber to exchange, dedicated switches | Any IP network — LAN, WAN, Internet |
| Cost | Per-minute, distance-based pricing | Flat rate or per-minute, distance irrelevant |
| Features | Limited (call waiting, forwarding) | Extensive (presence, IM, video, conferencing, APIs) |
| Reliability | Very high (99.999%), powered from exchange | Depends on network; needs backup power (UPS) |
SIP Methods Quick Reference
All standard SIP request methods defined in RFCs 3261, 3262, 3265, 3428, 3515, and 6086.