Introduction To SIP
Introduction To SIP
SIP - Definition
sessions by exchanging requests and responses The User agents consists of two components: User Agent Client UAC (originates requests) User Agent Server UAS (replay for requests)
Request
UAC
Response Request
UAS
UAS
Response
UAC
INVITE (SDP)
100 Trying
180 Ringing 200 OK (SDP) ACK
RTP / RTCP
BYE 200 OK Basic Call
SIP Requests
Method
Description
Used to establish media sessions between user agents Used to acknowledge final responses to INVITE requests Used to terminate an established media session
REGISTER
Method
Description
Used for mid-call signaling (DTMF, hook-flash, etc.) Used for call transfer Used by a user agent to establish a subscription for the purpose of receiving notifications
Used by a user agent to convey information about the occurrence of a particular event (such as MWI)
Used to acknowledge receipt of reliably transported provisional responses (1xx) Used to modify the state of a session
SIP Responses
Informational
Redirection
Server has returned possible locations. The client should retry request at another server. 300 Multiple Choices 301 Moved Permanently 302 Moved Temporarily 380 Alternative Service
Success
The request has failed due to an error by the client. The client may retry the request if reformulated according to response. 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method not Allowed 407 Proxy Authentication Required 415 Unsupported Media 486 Busy Here
The request has failed due to an error by the server. The request may be retried at another server. 500 Server Internal Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable
Global Failure
The request has failed. The request should not be tried again at this or other servers. 600 Busy Everywhere 603 Decline 604 Doesnt Exist Anywhere 606 Not Acceptable
SIP Addressing
as Uniform Resource Identifier (SIP URI) Typically, routing is performed according to the Request-URI and not according to the To header Convention: user@host User can be: user name or Tel number Host can be: domain name or IP address
Header
Description
Call-ID
CSeq
Contains a decimal number that increases for each request Contains the name and the address of the originator of the request. Also contains a tag, used to identify a particular call Contains the name and the address of the called party. The To header field isnt used for routing - the Request-URI is used for this purpose.
From
To
Content-Type
on a media type and format Contains information on the media to be replaced such as RTP payload types, IP address and ports Carried in SIP message body
v=0 o=AudiocodesGW 1725394110 1725393989 IN IP4 10.33.6.100 s=Phone-Call c=IN IP4 10.33.6.100 t=0 0 m=audio 6000 RTP/AVP 8 96 a=rtpmap:8 PCMA/8000 a=rtpmap:96 telephone-event/8000 a=fmtp:96 0-15 a=ptime:20 a=sendrecv
INVITE
INVITE sip:[email protected];user=phone SIP/2.0 Via: SIP/2.0/UDP 10.33.6.100;branch=z9hG4bKac1725404454 Max-Forwards: 70 From: Mike <sip:[email protected]>;tag=1c1725402038 To: <sip:[email protected];user=phone> Call-ID: [email protected] CSeq: 1 INVITE Contact: <sip:[email protected]> Supported: em,100rel,timer,replaces,path,resource-priority User-Agent: Audiocodes-Sip-Gateway-MP-118 FXS/v.5.00A.043.001 Content-Type: application/sdp Content-Length: 260 v=0 o=AudiocodesGW 1725394110 1725393989 IN IP4 10.33.6.100 s=Phone-Call c=IN IP4 10.33.6.100 t=0 0 m=audio 6000 RTP/AVP 8 96 a=rtpmap:8 PCMA/8000 a=rtpmap:96 telephone-event/8000 a=fmtp:96 0-15 a=ptime:20 a=sendrecv
200 OK
SIP/2.0 200 OK Via: SIP/2.0/UDP 10.33.6.100;branch=z9hG4bKac1725404454 From: <sip:[email protected]>;tag=1c1725402038 To: <sip:[email protected];user=phone>;tag=1c1534094691 Call-ID: [email protected] CSeq: 1 INVITE Contact: <sip:[email protected]> Supported: em,timer,replaces,path,resource-priority Server: Audiocodes-Sip-Gateway-MP-118 FXS_FXO/v.5.00A.043.001 Content-Type: application/sdp Content-Length: 260
v=0 o=AudiocodesGW 1534112064 1534111943 IN IP4 10.33.6.101 s=Phone-Call c=IN IP4 10.33.6.101 t=0 0 m=audio 6000 RTP/AVP 8 96 a=rtpmap:8 PCMA/8000 a=rtpmap:96 telephone-event/8000 a=fmtp:96 0-15 a=ptime:20 a=sendrecv
PRACK
100rel
PRACK
Early Media
Early Media
responding to the request Typically has access to a database or a location service to aid it in processing the request (determining the next hop) Can perform functions such as: Authentication Authorization Network access control Routing
Proxy Server
requests provide the server with an address at which the user can be reached
The registration server creates a temporary binding between the
Address of Record (AOR) URI in the To and the device URI in the Contact header
If required (as a response to 401\407 message) the gateway sends
SIP Registration
INVITE (SDP) 100 Trying INVITE (SDP) 100 Trying 180 Ringing 180 Ringing 200 OK (SDP)
200 OK (SDP)
ACK
ACK
RTP / RTCP
BYE 200 OK BYE 200 OK Call via Proxy