6. - SIP Messages
SIP messages are the communication units used by SIP endpoints to establish, modify, and terminate multimedia sessions. SIP messages are exchanged between SIP user agents, proxy servers, and redirect servers, and are used to initiate and control communication sessions between two or more parties. The messages consist of a request or response line, message headers, and a message body, and are used to exchange information about the session, including media types, codecs, addresses, and authentication credentials. SIP messages can be sent over UDP, TCP, or TLS transport protocols.
Here are some examples of a SIP message
SIP Invite Message
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bK123456789
From: Alice <sip:[email protected]>;tag=987654321
To: Bob <sip:[email protected]>
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: <sip:[email protected]>
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 100
v=0
o=- 123456789 123456789 IN IP4 192.168.1.100
s=Session
c=IN IP4 192.168.1.100
t=0 0
m=audio 5004 RTP/AVP 0
a=rtpmap:0 PCMU/8000
SIP OK Message
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bK123456789;received=192.168.1.100
From: Alice <sip:[email protected]>;tag=987654321
To: Bob <sip:[email protected]>;tag=123456789
Call-ID: [email protected]
CSeq: 1 INVITE
Contact: <sip:[email protected]>
Content-Type: application/sdp
Content-Length: 100
v=0
o=- 123456789 123456789 IN IP4 192.168.1.101
s=Session
c=IN IP4 192.168.1.101
t=0 0
m=audio 5004 RTP/AVP 0
a=rtpmap:0 PCMU/8000
SIP Notify Message
NOTIFY sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.101:5060;branch=z9hG4bK987654321
From: Bob <sip:[email protected]>;tag=123456789
To: Alice <sip:[email protected]>;tag=987654321
Call-ID: [email protected]
CSeq: 1 NOTIFY
Event: message-summary
Subscription-State: terminated;reason=noresource
Content-Length: 0
SIP Prack Message
PRACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.1.100:5060;branch=z9hG4bK123456789
From: Alice <sip:[email protected]>;tag=987654321
To: Bob <sip:[email protected]>;tag=123456789
Call-ID: [email protected]
CSeq: 1 PRACK
Max-Forwards: 70
Content-Length: 0
No Comments