SIP Fundamentals
SIP INVITE
INVITE is the SIP method that initiates a call (or a media session). It carries the SDP that describes the offered codecs and media addresses, and it triggers the full request/response sequence that culminates in 200 OK + ACK or a final error.
Anatomy of an INVITE
INVITE sip:[email protected] SIP/2.0 Via: SIP/2.0/UDP 192.0.2.1:5060;branch=z9hG4bK-abc From: <sip:[email protected]>;tag=12345 To: <sip:[email protected]> Call-ID: [email protected] CSeq: 1 INVITE Contact: <sip:[email protected]:5060> Max-Forwards: 70 Content-Type: application/sdp Content-Length: 240 v=0 o=- 12345 1 IN IP4 192.0.2.1 s=- c=IN IP4 192.0.2.1 t=0 0 m=audio 16384 RTP/AVP 0 8 9 101 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:9 G722/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16
Lifecycle
INVITE→100 Trying→180 Ringing→200 OK→ACK: standard call setup.- Mid-call:
re-INVITEcan change media (hold, codec change, transfer). - Termination:
BYEfrom either party.
Common failures
401 Unauthorized/407 Proxy Authentication Required: re-send withAuthorizationheader.403 Forbidden: bad credentials or unauthorized destination.503 Service Unavailable: upstream carrier rejected.486 Busy Here: callee is on another call.
Related terms
SIP OPTIONS
SIP REGISTER
SIP Response Codes (1xx-6xx)
SDP (Session Description Protocol)
Common SIP Headers (Explained)
Ready to get a number?
Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.