Request Message Format of SIP · Via: It contains the local address of user1 i.e. pc33.server1.com where it is expecting the responses to come. · To: It contains a ...
Home|Tutorials|Resources|Books|Feedback|Aboutus
VoIP
SIP
Introduction
ABriefHistoryofSIP
Whatitdoes&whatitdoesn't
ComponentsinSIP
SIPCommands
Atypicalexample
SIPrequest
SIPresponse
TypesofResponses
RelationamongCall,Dialog,Transaction,Message
SIPRegistration
Conclusion
RTP
SDP
RequestMessageFormatofSIP
Backalready!Well,let'scontinue.
InthepreviousSIPsessionexamplewehaveseenthatrequestsaresentbyclientstoservers.Wewillnowdiscusswhatthatrequestactuallycontains.ThefollowingistheformatofINVITErequestassentbyuser1.
INVITEsip:[email protected]/2.0
Via:SIP/2.0/UDPpc33.server1.com;branch=z9hG4bK776asdhdsMax-Forwards:70
To:user2
From:user1;tag=1928301774
Call-ID:[email protected]
CSeq:314159INVITE
Contact:
Content-Type:application/sdp
Content-Length:142
----User1MessageBodyNotShown----
Thefirstlineofthetext-encodedmessageiscalledRequest-Line.Itidentifiesthatthemessageisarequest.
Request-LineMethodSPRequest-URISPSIP-VersionCRLF
[SP=single-space&CRLF=CarriageReturn+LineFeed(i.e.thecharacterinsertedwhenyoupressthe"Enter"or"Return"keyofyourcomputer)]
HeremethodisINVITE,request-uriis"[email protected]"andSIPversionis2.
Thefollowinglinesareasetofheaderfields.
Via:Itcontainsthelocaladdressofuser1i.e.pc33.server1.comwhereitisexpectingtheresponsestocome.
Max-Forward:Itisusedtolimitthenumberofhopsthatthisrequestmaytakebeforereachingtherecipient.Itisdecreasedbyoneateachhop.Itisnecessarytopreventtherequestfromtravelingforeverincaseitistrappedinaloop.
To:Itcontainsadisplayname"user2"andaSIPorSIPSURI
From:Italsocontainsadisplayname"user1"andaSIPorSIPSURI.Italsocontainsatagwhichisapseudo-randomsequenceinsertedbytheSIPapplication.Itworksasanidentifierofthecallerinthedialog.
Call-ID:Itisagloballyuniqueidentifierofthecallgeneratedasthecombinationofapseudo-randomstringandthesoftphone'sIPaddress.
TheCall-IDisuniqueforacall.Acallmaycontainseveraldialogs.EachdialogisuniquelyidentifiedbyacombinationofFrom,ToandCall-ID.Ifyouareinconfusionclickhere.
CSeq:Itcontainsanintegerandamethodname.Whenatransactionstarts,thefirstmessageisgivenarandomCSeq.Afterthatitisincrementedbyonewitheachnewmessage.Itisusedtodetectnon-deliveryofamessageorout-of-orderdeliveryofmessages.
Contact:ItcontainsaSIPorSIPSURIthatisadirectroutetouser1.Itcontainsausernameandafullyqualifieddomainname(FQDN).ItmayalsohaveanIPaddress.
Viafieldisusedtosendtheresponsetotherequest.Contactfieldisusedtosendfuturerequests.Thatiswhythe200OKresponsefromuser2goestouser1throughproxies.Butwhenuser2generatesaBYErequest(anewrequestandnotaresponsetoINVITE),itgoesdirectlytouser1bypassingtheproxies.
Content-Type:Itcontainsadescriptionofthemessagebody(notshown).
Content-Length:Itisanoctet(byte)countofthemessagebody.
Theheadermaycontainotherheaderfieldsalso.Howeverthosefieldsareoptional.Pleasenotethatthebodyofthemessageisnotshownhere.ThebodyisusedtoconveyinformationaboutthemediasessionwritteninSessionDescriptionProtocol(SDP).YoumaycontinueyourjourneythroughSIPwithoutworryingaboutSDPrightnow.Howeveritdoesn'thurttotakeapeep.
YourSIPrequestiswaitingtogetaSIPresponsemessage.
Ifyouhaveanysuggestion,correction,queryjustmailtokoushik.banerjeeATgmail.com©2005-2018K.BanerjeeLastupdated:March1st,2018