Basic SIP Call Flow
A standard VoIP call between two SIP user agents follows this sequence:
| Step | From | To | Message | Description |
|---|---|---|---|---|
| 1 | UAC | UAS | INVITE sip:user@example.com | Request to start a call |
| 2 | UAS | UAC | 100 Trying | Request received, processing |
| 3 | UAS | UAC | 180 Ringing | Called party is ringing |
| 4 | UAS | UAC | 200 OK | Call answered |
| 5 | UAC | UAS | ACK | Confirms 200 OK received, media begins |
| 6 | Both | Both | RTP Media (audio/video) | Actual voice/video traffic |
| 7 | UAC | UAS | BYE | Hang up request |
| 8 | UAS | UAC | 200 OK | Hangup confirmed, call ended |
SIP Registration Flow
Before making calls, SIP user agents register with a registrar server:
| Step | From | To | Message | Description |
|---|---|---|---|---|
| 1 | UA | Registrar | REGISTER sip:example.com | Request to register contact |
| 2 | Registrar | UA | 401 Unauthorized | Challenge with nonce |
| 3 | UA | Registrar | REGISTER (with auth) | Retry with credentials |
| 4 | Registrar | UA | 200 OK | Registration successful |
Common Failure Responses
When a call fails, the SIP server returns one of these responses:
| Code | Name | What It Means |
|---|---|---|
| 404 | Not Found | Called number does not exist |
| 408 | Request Timeout | No response from called party in time |
| 480 | Temporarily Unavailable | User offline or busy with DND |
| 486 | Busy Here | Called party is on another call |
| 487 | Request Terminated | Caller hung up before pickup (CANCEL) |
| 503 | Service Unavailable | Server/trunk overloaded or down |
See the full list at SIP Response Codes →
SIP Port Reference
Standard ports used by SIP and related protocols:
| Port | Protocol | Description |
|---|---|---|
| 5060 | UDP/TCP | SIP signaling (unencrypted) |
| 5061 | TLS | SIP signaling (TLS encrypted) |
| 5062-5082 | Various | Alternative SIP ports |
| 10000-20000 | RTP/UDP | Media (voice/video) - typical range |
| 3478 | STUN | NAT traversal |
| 5349 | STUN/TLS | Encrypted STUN |
Key SIP Concepts
- UAC (User Agent Client): The SIP endpoint that initiates the request (caller)
- UAS (User Agent Server): The SIP endpoint that receives and responds (callee)
- Registrar: Server that tracks user location and contact info
- Proxy: Routes SIP messages without altering them
- SDP (Session Description Protocol): Carried in INVITE/200 OK to negotiate codec, ports, media capabilities
- RTP (Real-time Transport Protocol): Actually carries the voice/video data once the session is set up