rfc2543.txt 331 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564
  1. Network Working Group M. Handley
  2. Request for Comments: 2543 ACIRI
  3. Category: Standards Track H. Schulzrinne
  4. Columbia U.
  5. E. Schooler
  6. Cal Tech
  7. J. Rosenberg
  8. Bell Labs
  9. March 1999
  10. SIP: Session Initiation Protocol
  11. Status of this Memo
  12. This document specifies an Internet standards track protocol for the
  13. Internet community, and requests discussion and suggestions for
  14. improvements. Please refer to the current edition of the "Internet
  15. Official Protocol Standards" (STD 1) for the standardization state
  16. and status of this protocol. Distribution of this memo is unlimited.
  17. Copyright Notice
  18. Copyright (C) The Internet Society (1999). All Rights Reserved.
  19. IESG Note
  20. The IESG intends to charter, in the near future, one or more working
  21. groups to produce standards for "name lookup", where such names would
  22. include electronic mail addresses and telephone numbers, and the
  23. result of such a lookup would be a list of attributes and
  24. characteristics of the user or terminal associated with the name.
  25. Groups which are in need of a "name lookup" protocol should follow
  26. the development of these new working groups rather than using SIP for
  27. this function. In addition it is anticipated that SIP will migrate
  28. towards using such protocols, and SIP implementors are advised to
  29. monitor these efforts.
  30. Abstract
  31. The Session Initiation Protocol (SIP) is an application-layer control
  32. (signaling) protocol for creating, modifying and terminating sessions
  33. with one or more participants. These sessions include Internet
  34. multimedia conferences, Internet telephone calls and multimedia
  35. distribution. Members in a session can communicate via multicast or
  36. via a mesh of unicast relations, or a combination of these.
  37. Handley, et al. Standards Track [Page 1]
  38. RFC 2543 SIP: Session Initiation Protocol March 1999
  39. SIP invitations used to create sessions carry session descriptions
  40. which allow participants to agree on a set of compatible media types.
  41. SIP supports user mobility by proxying and redirecting requests to
  42. the user's current location. Users can register their current
  43. location. SIP is not tied to any particular conference control
  44. protocol. SIP is designed to be independent of the lower-layer
  45. transport protocol and can be extended with additional capabilities.
  46. Table of Contents
  47. 1 Introduction ........................................ 7
  48. 1.1 Overview of SIP Functionality ....................... 7
  49. 1.2 Terminology ......................................... 8
  50. 1.3 Definitions ......................................... 9
  51. 1.4 Overview of SIP Operation ........................... 12
  52. 1.4.1 SIP Addressing ...................................... 12
  53. 1.4.2 Locating a SIP Server ............................... 13
  54. 1.4.3 SIP Transaction ..................................... 14
  55. 1.4.4 SIP Invitation ...................................... 15
  56. 1.4.5 Locating a User ..................................... 17
  57. 1.4.6 Changing an Existing Session ........................ 18
  58. 1.4.7 Registration Services ............................... 18
  59. 1.5 Protocol Properties ................................. 18
  60. 1.5.1 Minimal State ....................................... 18
  61. 1.5.2 Lower-Layer-Protocol Neutral ........................ 18
  62. 1.5.3 Text-Based .......................................... 20
  63. 2 SIP Uniform Resource Locators ....................... 20
  64. 3 SIP Message Overview ................................ 24
  65. 4 Request ............................................. 26
  66. 4.1 Request-Line ........................................ 26
  67. 4.2 Methods ............................................. 27
  68. 4.2.1 INVITE .............................................. 28
  69. 4.2.2 ACK ................................................. 29
  70. 4.2.3 OPTIONS ............................................. 29
  71. 4.2.4 BYE ................................................. 30
  72. 4.2.5 CANCEL .............................................. 30
  73. 4.2.6 REGISTER ............................................ 31
  74. 4.3 Request-URI ......................................... 34
  75. 4.3.1 SIP Version ......................................... 35
  76. 4.4 Option Tags ......................................... 35
  77. 4.4.1 Registering New Option Tags with IANA ............... 35
  78. 5 Response ............................................ 36
  79. 5.1 Status-Line ......................................... 36
  80. 5.1.1 Status Codes and Reason Phrases ..................... 37
  81. 6 Header Field Definitions ............................ 39
  82. 6.1 General Header Fields ............................... 41
  83. 6.2 Entity Header Fields ................................ 42
  84. 6.3 Request Header Fields ............................... 43
  85. Handley, et al. Standards Track [Page 2]
  86. RFC 2543 SIP: Session Initiation Protocol March 1999
  87. 6.4 Response Header Fields .............................. 43
  88. 6.5 End-to-end and Hop-by-hop Headers ................... 43
  89. 6.6 Header Field Format ................................. 43
  90. 6.7 Accept .............................................. 44
  91. 6.8 Accept-Encoding ..................................... 44
  92. 6.9 Accept-Language ..................................... 45
  93. 6.10 Allow ............................................... 45
  94. 6.11 Authorization ....................................... 45
  95. 6.12 Call-ID ............................................. 46
  96. 6.13 Contact ............................................. 47
  97. 6.14 Content-Encoding .................................... 50
  98. 6.15 Content-Length ...................................... 51
  99. 6.16 Content-Type ........................................ 51
  100. 6.17 CSeq ................................................ 52
  101. 6.18 Date ................................................ 53
  102. 6.19 Encryption .......................................... 54
  103. 6.20 Expires ............................................. 55
  104. 6.21 From ................................................ 56
  105. 6.22 Hide ................................................ 57
  106. 6.23 Max-Forwards ........................................ 59
  107. 6.24 Organization ........................................ 59
  108. 6.25 Priority ............................................ 60
  109. 6.26 Proxy-Authenticate .................................. 60
  110. 6.27 Proxy-Authorization ................................. 61
  111. 6.28 Proxy-Require ....................................... 61
  112. 6.29 Record-Route ........................................ 62
  113. 6.30 Require ............................................. 63
  114. 6.31 Response-Key ........................................ 63
  115. 6.32 Retry-After ......................................... 64
  116. 6.33 Route ............................................... 65
  117. 6.34 Server .............................................. 65
  118. 6.35 Subject ............................................. 65
  119. 6.36 Timestamp ........................................... 66
  120. 6.37 To .................................................. 66
  121. 6.38 Unsupported ......................................... 68
  122. 6.39 User-Agent .......................................... 68
  123. 6.40 Via ................................................. 68
  124. 6.40.1 Requests ............................................ 68
  125. 6.40.2 Receiver-tagged Via Header Fields ................... 69
  126. 6.40.3 Responses ........................................... 70
  127. 6.40.4 User Agent and Redirect Servers ..................... 70
  128. 6.40.5 Syntax .............................................. 71
  129. 6.41 Warning ............................................. 72
  130. 6.42 WWW-Authenticate .................................... 74
  131. 7 Status Code Definitions ............................. 75
  132. 7.1 Informational 1xx ................................... 75
  133. 7.1.1 100 Trying .......................................... 75
  134. 7.1.2 180 Ringing ......................................... 75
  135. Handley, et al. Standards Track [Page 3]
  136. RFC 2543 SIP: Session Initiation Protocol March 1999
  137. 7.1.3 181 Call Is Being Forwarded ......................... 75
  138. 7.1.4 182 Queued .......................................... 76
  139. 7.2 Successful 2xx ...................................... 76
  140. 7.2.1 200 OK .............................................. 76
  141. 7.3 Redirection 3xx ..................................... 76
  142. 7.3.1 300 Multiple Choices ................................ 77
  143. 7.3.2 301 Moved Permanently ............................... 77
  144. 7.3.3 302 Moved Temporarily ............................... 77
  145. 7.3.4 305 Use Proxy ....................................... 77
  146. 7.3.5 380 Alternative Service ............................. 78
  147. 7.4 Request Failure 4xx ................................. 78
  148. 7.4.1 400 Bad Request ..................................... 78
  149. 7.4.2 401 Unauthorized .................................... 78
  150. 7.4.3 402 Payment Required ................................ 78
  151. 7.4.4 403 Forbidden ....................................... 78
  152. 7.4.5 404 Not Found ....................................... 78
  153. 7.4.6 405 Method Not Allowed .............................. 78
  154. 7.4.7 406 Not Acceptable .................................. 79
  155. 7.4.8 407 Proxy Authentication Required ................... 79
  156. 7.4.9 408 Request Timeout ................................. 79
  157. 7.4.10 409 Conflict ........................................ 79
  158. 7.4.11 410 Gone ............................................ 79
  159. 7.4.12 411 Length Required ................................. 79
  160. 7.4.13 413 Request Entity Too Large ........................ 80
  161. 7.4.14 414 Request-URI Too Long ............................ 80
  162. 7.4.15 415 Unsupported Media Type .......................... 80
  163. 7.4.16 420 Bad Extension ................................... 80
  164. 7.4.17 480 Temporarily Unavailable ......................... 80
  165. 7.4.18 481 Call Leg/Transaction Does Not Exist ............. 81
  166. 7.4.19 482 Loop Detected ................................... 81
  167. 7.4.20 483 Too Many Hops ................................... 81
  168. 7.4.21 484 Address Incomplete .............................. 81
  169. 7.4.22 485 Ambiguous ....................................... 81
  170. 7.4.23 486 Busy Here ....................................... 82
  171. 7.5 Server Failure 5xx .................................. 82
  172. 7.5.1 500 Server Internal Error ........................... 82
  173. 7.5.2 501 Not Implemented ................................. 82
  174. 7.5.3 502 Bad Gateway ..................................... 82
  175. 7.5.4 503 Service Unavailable ............................. 83
  176. 7.5.5 504 Gateway Time-out ................................ 83
  177. 7.5.6 505 Version Not Supported ........................... 83
  178. 7.6 Global Failures 6xx ................................. 83
  179. 7.6.1 600 Busy Everywhere ................................. 83
  180. 7.6.2 603 Decline ......................................... 84
  181. 7.6.3 604 Does Not Exist Anywhere ......................... 84
  182. 7.6.4 606 Not Acceptable .................................. 84
  183. 8 SIP Message Body .................................... 84
  184. 8.1 Body Inclusion ...................................... 84
  185. Handley, et al. Standards Track [Page 4]
  186. RFC 2543 SIP: Session Initiation Protocol March 1999
  187. 8.2 Message Body Type ................................... 85
  188. 8.3 Message Body Length ................................. 85
  189. 9 Compact Form ........................................ 85
  190. 10 Behavior of SIP Clients and Servers ................. 86
  191. 10.1 General Remarks ..................................... 86
  192. 10.1.1 Requests ............................................ 86
  193. 10.1.2 Responses ........................................... 87
  194. 10.2 Source Addresses, Destination Addresses and
  195. Connections ......................................... 88
  196. 10.2.1 Unicast UDP ......................................... 88
  197. 10.2.2 Multicast UDP ....................................... 88
  198. 10.3 TCP ................................................. 89
  199. 10.4 Reliability for BYE, CANCEL, OPTIONS, REGISTER
  200. Requests ............................................ 90
  201. 10.4.1 UDP ................................................. 90
  202. 10.4.2 TCP ................................................. 91
  203. 10.5 Reliability for INVITE Requests ..................... 91
  204. 10.5.1 UDP ................................................. 92
  205. 10.5.2 TCP ................................................. 95
  206. 10.6 Reliability for ACK Requests ........................ 95
  207. 10.7 ICMP Handling ....................................... 95
  208. 11 Behavior of SIP User Agents ......................... 95
  209. 11.1 Caller Issues Initial INVITE Request ................ 96
  210. 11.2 Callee Issues Response .............................. 96
  211. 11.3 Caller Receives Response to Initial Request ......... 96
  212. 11.4 Caller or Callee Generate Subsequent Requests ....... 97
  213. 11.5 Receiving Subsequent Requests ....................... 97
  214. 12 Behavior of SIP Proxy and Redirect Servers .......... 97
  215. 12.1 Redirect Server ..................................... 97
  216. 12.2 User Agent Server ................................... 98
  217. 12.3 Proxy Server ........................................ 98
  218. 12.3.1 Proxying Requests ................................... 98
  219. 12.3.2 Proxying Responses .................................. 99
  220. 12.3.3 Stateless Proxy: Proxying Responses ................. 99
  221. 12.3.4 Stateful Proxy: Receiving Requests .................. 99
  222. 12.3.5 Stateful Proxy: Receiving ACKs ...................... 99
  223. 12.3.6 Stateful Proxy: Receiving Responses ................. 100
  224. 12.3.7 Stateless, Non-Forking Proxy ........................ 100
  225. 12.4 Forking Proxy ....................................... 100
  226. 13 Security Considerations ............................. 104
  227. 13.1 Confidentiality and Privacy: Encryption ............. 104
  228. 13.1.1 End-to-End Encryption ............................... 104
  229. 13.1.2 Privacy of SIP Responses ............................ 107
  230. 13.1.3 Encryption by Proxies ............................... 108
  231. 13.1.4 Hop-by-Hop Encryption ............................... 108
  232. 13.1.5 Via field encryption ................................ 108
  233. 13.2 Message Integrity and Access Control:
  234. Authentication ...................................... 109
  235. Handley, et al. Standards Track [Page 5]
  236. RFC 2543 SIP: Session Initiation Protocol March 1999
  237. 13.2.1 Trusting responses .................................. 112
  238. 13.3 Callee Privacy ...................................... 113
  239. 13.4 Known Security Problems ............................. 113
  240. 14 SIP Authentication using HTTP Basic and Digest
  241. Schemes ............................................. 113
  242. 14.1 Framework ........................................... 113
  243. 14.2 Basic Authentication ................................ 114
  244. 14.3 Digest Authentication ............................... 114
  245. 14.4 Proxy-Authentication ................................ 115
  246. 15 SIP Security Using PGP .............................. 115
  247. 15.1 PGP Authentication Scheme ........................... 115
  248. 15.1.1 The WWW-Authenticate Response Header ................ 116
  249. 15.1.2 The Authorization Request Header .................... 117
  250. 15.2 PGP Encryption Scheme ............................... 118
  251. 15.3 Response-Key Header Field for PGP ................... 119
  252. 16 Examples ............................................ 119
  253. 16.1 Registration ........................................ 119
  254. 16.2 Invitation to a Multicast Conference ................ 121
  255. 16.2.1 Request ............................................. 121
  256. 16.2.2 Response ............................................ 122
  257. 16.3 Two-party Call ...................................... 123
  258. 16.4 Terminating a Call .................................. 125
  259. 16.5 Forking Proxy ....................................... 126
  260. 16.6 Redirects ........................................... 130
  261. 16.7 Negotiation ......................................... 131
  262. 16.8 OPTIONS Request ..................................... 132
  263. A Minimal Implementation .............................. 134
  264. A.1 Client .............................................. 134
  265. A.2 Server .............................................. 135
  266. A.3 Header Processing ................................... 135
  267. B Usage of the Session Description Protocol (SDP)...... 136
  268. B.1 Configuring Media Streams ........................... 136
  269. B.2 Setting SDP Values for Unicast ...................... 138
  270. B.3 Multicast Operation ................................. 139
  271. B.4 Delayed Media Streams ............................... 139
  272. B.5 Putting Media Streams on Hold ....................... 139
  273. B.6 Subject and SDP "s=" Line ........................... 140
  274. B.7 The SDP "o=" Line ................................... 140
  275. C Summary of Augmented BNF ............................ 141
  276. C.1 Basic Rules ......................................... 143
  277. D Using SRV DNS Records ............................... 146
  278. E IANA Considerations ................................. 148
  279. F Acknowledgments ..................................... 149
  280. G Authors' Addresses .................................. 149
  281. H Bibliography ........................................ 150
  282. I Full Copyright Statement ............................ 153
  283. Handley, et al. Standards Track [Page 6]
  284. RFC 2543 SIP: Session Initiation Protocol March 1999
  285. 1 Introduction
  286. 1.1 Overview of SIP Functionality
  287. The Session Initiation Protocol (SIP) is an application-layer control
  288. protocol that can establish, modify and terminate multimedia sessions
  289. or calls. These multimedia sessions include multimedia conferences,
  290. distance learning, Internet telephony and similar applications. SIP
  291. can invite both persons and "robots", such as a media storage
  292. service. SIP can invite parties to both unicast and multicast
  293. sessions; the initiator does not necessarily have to be a member of
  294. the session to which it is inviting. Media and participants can be
  295. added to an existing session.
  296. SIP can be used to initiate sessions as well as invite members to
  297. sessions that have been advertised and established by other means.
  298. Sessions can be advertised using multicast protocols such as SAP,
  299. electronic mail, news groups, web pages or directories (LDAP), among
  300. others.
  301. SIP transparently supports name mapping and redirection services,
  302. allowing the implementation of ISDN and Intelligent Network telephony
  303. subscriber services. These facilities also enable personal mobility.
  304. In the parlance of telecommunications intelligent network services,
  305. this is defined as: "Personal mobility is the ability of end users to
  306. originate and receive calls and access subscribed telecommunication
  307. services on any terminal in any location, and the ability of the
  308. network to identify end users as they move. Personal mobility is
  309. based on the use of a unique personal identity (i.e., personal
  310. number)." [1]. Personal mobility complements terminal mobility, i.e.,
  311. the ability to maintain communications when moving a single end
  312. system from one subnet to another.
  313. SIP supports five facets of establishing and terminating multimedia
  314. communications:
  315. User location: determination of the end system to be used for
  316. communication;
  317. User capabilities: determination of the media and media parameters to
  318. be used;
  319. User availability: determination of the willingness of the called
  320. party to engage in communications;
  321. Call setup: "ringing", establishment of call parameters at both
  322. called and calling party;
  323. Handley, et al. Standards Track [Page 7]
  324. RFC 2543 SIP: Session Initiation Protocol March 1999
  325. Call handling: including transfer and termination of calls.
  326. SIP can also initiate multi-party calls using a multipoint control
  327. unit (MCU) or fully-meshed interconnection instead of multicast.
  328. Internet telephony gateways that connect Public Switched Telephone
  329. Network (PSTN) parties can also use SIP to set up calls between them.
  330. SIP is designed as part of the overall IETF multimedia data and
  331. control architecture currently incorporating protocols such as RSVP
  332. (RFC 2205 [2]) for reserving network resources, the real-time
  333. transport protocol (RTP) (RFC 1889 [3]) for transporting real-time
  334. data and providing QOS feedback, the real-time streaming protocol
  335. (RTSP) (RFC 2326 [4]) for controlling delivery of streaming media,
  336. the session announcement protocol (SAP) [5] for advertising
  337. multimedia sessions via multicast and the session description
  338. protocol (SDP) (RFC 2327 [6]) for describing multimedia sessions.
  339. However, the functionality and operation of SIP does not depend on
  340. any of these protocols.
  341. SIP can also be used in conjunction with other call setup and
  342. signaling protocols. In that mode, an end system uses SIP exchanges
  343. to determine the appropriate end system address and protocol from a
  344. given address that is protocol-independent. For example, SIP could be
  345. used to determine that the party can be reached via H.323 [7], obtain
  346. the H.245 [8] gateway and user address and then use H.225.0 [9] to
  347. establish the call.
  348. In another example, SIP might be used to determine that the callee is
  349. reachable via the PSTN and indicate the phone number to be called,
  350. possibly suggesting an Internet-to-PSTN gateway to be used.
  351. SIP does not offer conference control services such as floor control
  352. or voting and does not prescribe how a conference is to be managed,
  353. but SIP can be used to introduce conference control protocols. SIP
  354. does not allocate multicast addresses.
  355. SIP can invite users to sessions with and without resource
  356. reservation. SIP does not reserve resources, but can convey to the
  357. invited system the information necessary to do this.
  358. 1.2 Terminology
  359. In this document, the key words "MUST", "MUST NOT", "REQUIRED",
  360. "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
  361. and "OPTIONAL" are to be interpreted as described in RFC 2119 [10]
  362. and indicate requirement levels for compliant SIP implementations.
  363. Handley, et al. Standards Track [Page 8]
  364. RFC 2543 SIP: Session Initiation Protocol March 1999
  365. 1.3 Definitions
  366. This specification uses a number of terms to refer to the roles
  367. played by participants in SIP communications. The definitions of
  368. client, server and proxy are similar to those used by the Hypertext
  369. Transport Protocol (HTTP) (RFC 2068 [11]). The terms and generic
  370. syntax of URI and URL are defined in RFC 2396 [12]. The following
  371. terms have special significance for SIP.
  372. Call: A call consists of all participants in a conference invited by
  373. a common source. A SIP call is identified by a globally unique
  374. call-id (Section 6.12). Thus, if a user is, for example, invited
  375. to the same multicast session by several people, each of these
  376. invitations will be a unique call. A point-to-point Internet
  377. telephony conversation maps into a single SIP call. In a
  378. multiparty conference unit (MCU) based call-in conference, each
  379. participant uses a separate call to invite himself to the MCU.
  380. Call leg: A call leg is identified by the combination of Call-ID, To
  381. and From.
  382. Client: An application program that sends SIP requests. Clients may
  383. or may not interact directly with a human user. User agents and
  384. proxies contain clients (and servers).
  385. Conference: A multimedia session (see below), identified by a common
  386. session description. A conference can have zero or more members
  387. and includes the cases of a multicast conference, a full-mesh
  388. conference and a two-party "telephone call", as well as
  389. combinations of these. Any number of calls can be used to
  390. create a conference.
  391. Downstream: Requests sent in the direction from the caller to the
  392. callee (i.e., user agent client to user agent server).
  393. Final response: A response that terminates a SIP transaction, as
  394. opposed to a provisional response that does not. All 2xx, 3xx,
  395. 4xx, 5xx and 6xx responses are final.
  396. Initiator, calling party, caller: The party initiating a conference
  397. invitation. Note that the calling party does not have to be the
  398. same as the one creating the conference.
  399. Invitation: A request sent to a user (or service) requesting
  400. participation in a session. A successful SIP invitation consists
  401. of two transactions: an INVITE request followed by an ACK
  402. request.
  403. Handley, et al. Standards Track [Page 9]
  404. RFC 2543 SIP: Session Initiation Protocol March 1999
  405. Invitee, invited user, called party, callee: The person or service
  406. that the calling party is trying to invite to a conference.
  407. Isomorphic request or response: Two requests or responses are defined
  408. to be isomorphic for the purposes of this document if they have
  409. the same values for the Call-ID, To, From and CSeq header
  410. fields. In addition, isomorphic requests have to have the same
  411. Request-URI.
  412. Location server: See location service.
  413. Location service: A location service is used by a SIP redirect or
  414. proxy server to obtain information about a callee's possible
  415. location(s). Location services are offered by location servers.
  416. Location servers MAY be co-located with a SIP server, but the
  417. manner in which a SIP server requests location services is
  418. beyond the scope of this document.
  419. Parallel search: In a parallel search, a proxy issues several
  420. requests to possible user locations upon receiving an incoming
  421. request. Rather than issuing one request and then waiting for
  422. the final response before issuing the next request as in a
  423. sequential search , a parallel search issues requests without
  424. waiting for the result of previous requests.
  425. Provisional response: A response used by the server to indicate
  426. progress, but that does not terminate a SIP transaction. 1xx
  427. responses are provisional, other responses are considered final.
  428. Proxy, proxy server: An intermediary program that acts as both a
  429. server and a client for the purpose of making requests on behalf
  430. of other clients. Requests are serviced internally or by passing
  431. them on, possibly after translation, to other servers. A proxy
  432. interprets, and, if necessary, rewrites a request message before
  433. forwarding it.
  434. Redirect server: A redirect server is a server that accepts a SIP
  435. request, maps the address into zero or more new addresses and
  436. returns these addresses to the client. Unlike a proxy server ,
  437. it does not initiate its own SIP request. Unlike a user agent
  438. server , it does not accept calls.
  439. Registrar: A registrar is a server that accepts REGISTER requests. A
  440. registrar is typically co-located with a proxy or redirect
  441. server and MAY offer location services.
  442. Handley, et al. Standards Track [Page 10]
  443. RFC 2543 SIP: Session Initiation Protocol March 1999
  444. Ringback: Ringback is the signaling tone produced by the calling
  445. client's application indicating that a called party is being
  446. alerted (ringing).
  447. Server: A server is an application program that accepts requests in
  448. order to service requests and sends back responses to those
  449. requests. Servers are either proxy, redirect or user agent
  450. servers or registrars.
  451. Session: From the SDP specification: "A multimedia session is a set
  452. of multimedia senders and receivers and the data streams flowing
  453. from senders to receivers. A multimedia conference is an example
  454. of a multimedia session." (RFC 2327 [6]) (A session as defined
  455. for SDP can comprise one or more RTP sessions.) As defined, a
  456. callee can be invited several times, by different calls, to the
  457. same session. If SDP is used, a session is defined by the
  458. concatenation of the user name , session id , network type ,
  459. address type and address elements in the origin field.
  460. (SIP) transaction: A SIP transaction occurs between a client and a
  461. server and comprises all messages from the first request sent
  462. from the client to the server up to a final (non-1xx) response
  463. sent from the server to the client. A transaction is identified
  464. by the CSeq sequence number (Section 6.17) within a single call
  465. leg. The ACK request has the same CSeq number as the
  466. corresponding INVITE request, but comprises a transaction of its
  467. own.
  468. Upstream: Responses sent in the direction from the user agent server
  469. to the user agent client.
  470. URL-encoded: A character string encoded according to RFC 1738,
  471. Section 2.2 [13].
  472. User agent client (UAC), calling user agent: A user agent client is a
  473. client application that initiates the SIP request.
  474. User agent server (UAS), called user agent: A user agent server is a
  475. server application that contacts the user when a SIP request is
  476. received and that returns a response on behalf of the user. The
  477. response accepts, rejects or redirects the request.
  478. User agent (UA): An application which contains both a user agent
  479. client and user agent server.
  480. An application program MAY be capable of acting both as a client and
  481. a server. For example, a typical multimedia conference control
  482. application would act as a user agent client to initiate calls or to
  483. Handley, et al. Standards Track [Page 11]
  484. RFC 2543 SIP: Session Initiation Protocol March 1999
  485. invite others to conferences and as a user agent server to accept
  486. invitations. The properties of the different SIP server types are
  487. summarized in Table 1.
  488. property redirect proxy user agent registrar
  489. server server server
  490. __________________________________________________________________
  491. also acts as a SIP client no yes no no
  492. returns 1xx status yes yes yes yes
  493. returns 2xx status no yes yes yes
  494. returns 3xx status yes yes yes yes
  495. returns 4xx status yes yes yes yes
  496. returns 5xx status yes yes yes yes
  497. returns 6xx status no yes yes yes
  498. inserts Via header no yes no no
  499. accepts ACK yes yes yes no
  500. Table 1: Properties of the different SIP server types
  501. 1.4 Overview of SIP Operation
  502. This section explains the basic protocol functionality and operation.
  503. Callers and callees are identified by SIP addresses, described in
  504. Section 1.4.1. When making a SIP call, a caller first locates the
  505. appropriate server (Section 1.4.2) and then sends a SIP request
  506. (Section 1.4.3). The most common SIP operation is the invitation
  507. (Section 1.4.4). Instead of directly reaching the intended callee, a
  508. SIP request may be redirected or may trigger a chain of new SIP
  509. requests by proxies (Section 1.4.5). Users can register their
  510. location(s) with SIP servers (Section 4.2.6).
  511. 1.4.1 SIP Addressing
  512. The "objects" addressed by SIP are users at hosts, identified by a
  513. SIP URL. The SIP URL takes a form similar to a mailto or telnet URL,
  514. i.e., user@host. The user part is a user name or a telephone number.
  515. The host part is either a domain name or a numeric network address.
  516. See section 2 for a detailed discussion of SIP URL's.
  517. A user's SIP address can be obtained out-of-band, can be learned via
  518. existing media agents, can be included in some mailers' message
  519. headers, or can be recorded during previous invitation interactions.
  520. In many cases, a user's SIP URL can be guessed from their email
  521. address.
  522. Handley, et al. Standards Track [Page 12]
  523. RFC 2543 SIP: Session Initiation Protocol March 1999
  524. A SIP URL address can designate an individual (possibly located at
  525. one of several end systems), the first available person from a group
  526. of individuals or a whole group. The form of the address, for
  527. example, sip:sales@example.com , is not sufficient, in general, to
  528. determine the intent of the caller.
  529. If a user or service chooses to be reachable at an address that is
  530. guessable from the person's name and organizational affiliation, the
  531. traditional method of ensuring privacy by having an unlisted "phone"
  532. number is compromised. However, unlike traditional telephony, SIP
  533. offers authentication and access control mechanisms and can avail
  534. itself of lower-layer security mechanisms, so that client software
  535. can reject unauthorized or undesired call attempts.
  536. 1.4.2 Locating a SIP Server
  537. When a client wishes to send a request, the client either sends it to
  538. a locally configured SIP proxy server (as in HTTP), independent of
  539. the Request-URI, or sends it to the IP address and port corresponding
  540. to the Request-URI.
  541. For the latter case, the client must determine the protocol, port and
  542. IP address of a server to which to send the request. A client SHOULD
  543. follow the steps below to obtain this information, but MAY follow the
  544. alternative, optional procedure defined in Appendix D. At each step,
  545. unless stated otherwise, the client SHOULD try to contact a server at
  546. the port number listed in the Request-URI. If no port number is
  547. present in the Request-URI, the client uses port 5060. If the
  548. Request-URI specifies a protocol (TCP or UDP), the client contacts
  549. the server using that protocol. If no protocol is specified, the
  550. client tries UDP (if UDP is supported). If the attempt fails, or if
  551. the client doesn't support UDP but supports TCP, it then tries TCP.
  552. A client SHOULD be able to interpret explicit network notifications
  553. (such as ICMP messages) which indicate that a server is not
  554. reachable, rather than relying solely on timeouts. (For socket-based
  555. programs: For TCP, connect() returns ECONNREFUSED if the client could
  556. not connect to a server at that address. For UDP, the socket needs to
  557. be bound to the destination address using connect() rather than
  558. sendto() or similar so that a second write() fails with ECONNREFUSED
  559. if there is no server listening) If the client finds the server is
  560. not reachable at a particular address, it SHOULD behave as if it had
  561. received a 400-class error response to that request.
  562. The client tries to find one or more addresses for the SIP server by
  563. querying DNS. The procedure is as follows:
  564. Handley, et al. Standards Track [Page 13]
  565. RFC 2543 SIP: Session Initiation Protocol March 1999
  566. 1. If the host portion of the Request-URI is an IP address,
  567. the client contacts the server at the given address.
  568. Otherwise, the client proceeds to the next step.
  569. 2. The client queries the DNS server for address records for
  570. the host portion of the Request-URI. If the DNS server
  571. returns no address records, the client stops, as it has
  572. been unable to locate a server. By address record, we mean
  573. A RR's, AAAA RR's, or other similar address records, chosen
  574. according to the client's network protocol capabilities.
  575. There are no mandatory rules on how to select a host name
  576. for a SIP server. Users are encouraged to name their SIP
  577. servers using the sip.domainname (i.e., sip.example.com)
  578. convention, as specified in RFC 2219 [16]. Users may only
  579. know an email address instead of a full SIP URL for a
  580. callee, however. In that case, implementations may be able
  581. to increase the likelihood of reaching a SIP server for
  582. that domain by constructing a SIP URL from that email
  583. address by prefixing the host name with "sip.". In the
  584. future, this mechanism is likely to become unnecessary as
  585. better DNS techniques, such as the one in Appendix D,
  586. become widely available.
  587. A client MAY cache a successful DNS query result. A successful query
  588. is one which contained records in the answer, and a server was
  589. contacted at one of the addresses from the answer. When the client
  590. wishes to send a request to the same host, it MUST start the search
  591. as if it had just received this answer from the name server. The
  592. client MUST follow the procedures in RFC1035 [15] regarding DNS cache
  593. invalidation when the DNS time-to-live expires.
  594. 1.4.3 SIP Transaction
  595. Once the host part has been resolved to a SIP server, the client
  596. sends one or more SIP requests to that server and receives one or
  597. more responses from the server. A request (and its retransmissions)
  598. together with the responses triggered by that request make up a SIP
  599. transaction. All responses to a request contain the same values in
  600. the Call-ID, CSeq, To, and From fields (with the possible addition of
  601. a tag in the To field (section 6.37)). This allows responses to be
  602. matched with requests. The ACK request following an INVITE is not
  603. part of the transaction since it may traverse a different set of
  604. hosts.
  605. Handley, et al. Standards Track [Page 14]
  606. RFC 2543 SIP: Session Initiation Protocol March 1999
  607. If TCP is used, request and responses within a single SIP transaction
  608. are carried over the same TCP connection (see Section 10). Several
  609. SIP requests from the same client to the same server MAY use the same
  610. TCP connection or MAY use a new connection for each request.
  611. If the client sent the request via unicast UDP, the response is sent
  612. to the address contained in the next Via header field (Section 6.40)
  613. of the response. If the request is sent via multicast UDP, the
  614. response is directed to the same multicast address and destination
  615. port. For UDP, reliability is achieved using retransmission (Section
  616. 10).
  617. The SIP message format and operation is independent of the transport
  618. protocol.
  619. 1.4.4 SIP Invitation
  620. A successful SIP invitation consists of two requests, INVITE followed
  621. by ACK. The INVITE (Section 4.2.1) request asks the callee to join a
  622. particular conference or establish a two-party conversation. After
  623. the callee has agreed to participate in the call, the caller confirms
  624. that it has received that response by sending an ACK (Section 4.2.2)
  625. request. If the caller no longer wants to participate in the call, it
  626. sends a BYE request instead of an ACK.
  627. The INVITE request typically contains a session description, for
  628. example written in SDP (RFC 2327 [6]) format, that provides the
  629. called party with enough information to join the session. For
  630. multicast sessions, the session description enumerates the media
  631. types and formats that are allowed to be distributed to that session.
  632. For a unicast session, the session description enumerates the media
  633. types and formats that the caller is willing to use and where it
  634. wishes the media data to be sent. In either case, if the callee
  635. wishes to accept the call, it responds to the invitation by returning
  636. a similar description listing the media it wishes to use. For a
  637. multicast session, the callee SHOULD only return a session
  638. description if it is unable to receive the media indicated in the
  639. caller's description or wants to receive data via unicast.
  640. The protocol exchanges for the INVITE method are shown in Fig. 1 for
  641. a proxy server and in Fig. 2 for a redirect server. (Note that the
  642. messages shown in the figures have been abbreviated slightly.) In
  643. Fig. 1, the proxy server accepts the INVITE request (step 1),
  644. contacts the location service with all or parts of the address (step
  645. 2) and obtains a more precise location (step 3). The proxy server
  646. then issues a SIP INVITE request to the address(es) returned by the
  647. location service (step 4). The user agent server alerts the user
  648. (step 5) and returns a success indication to the proxy server (step
  649. Handley, et al. Standards Track [Page 15]
  650. RFC 2543 SIP: Session Initiation Protocol March 1999
  651. 6). The proxy server then returns the success result to the original
  652. caller (step 7). The receipt of this message is confirmed by the
  653. caller using an ACK request, which is forwarded to the callee (steps
  654. 8 and 9). Note that an ACK can also be sent directly to the callee,
  655. bypassing the proxy. All requests and responses have the same Call-
  656. ID.
  657. +....... cs.columbia.edu .......+
  658. : :
  659. : (~~~~~~~~~~) :
  660. : ( location ) :
  661. : ( service ) :
  662. : (~~~~~~~~~~) :
  663. : ^ | :
  664. : | hgs@lab :
  665. : 2| 3| :
  666. : | | :
  667. : henning | :
  668. +.. cs.tu-berlin.de ..+ 1: INVITE : | | :
  669. : : henning@cs.col: | \/ 4: INVITE 5: ring :
  670. : cz@cs.tu-berlin.de ========================>(~~~~~~)=========>(~~~~~~) :
  671. : <........................( )<.........( ) :
  672. : : 7: 200 OK : ( )6: 200 OK ( ) :
  673. : : : ( work ) ( lab ) :
  674. : : 8: ACK : ( )9: ACK ( ) :
  675. : ========================>(~~~~~~)=========>(~~~~~~) :
  676. +.....................+ +...............................+
  677. ====> SIP request
  678. ....> SIP response
  679. ^
  680. | non-SIP protocols
  681. |
  682. Figure 1: Example of SIP proxy server
  683. The redirect server shown in Fig. 2 accepts the INVITE request (step
  684. 1), contacts the location service as before (steps 2 and 3) and,
  685. instead of contacting the newly found address itself, returns the
  686. address to the caller (step 4), which is then acknowledged via an ACK
  687. Handley, et al. Standards Track [Page 16]
  688. RFC 2543 SIP: Session Initiation Protocol March 1999
  689. request (step 5). The caller issues a new request, with the same
  690. call-ID but a higher CSeq, to the address returned by the first
  691. server (step 6). In the example, the call succeeds (step 7). The
  692. caller and callee complete the handshake with an ACK (step 8).
  693. The next section discusses what happens if the location service
  694. returns more than one possible alternative.
  695. 1.4.5 Locating a User
  696. A callee may move between a number of different end systems over
  697. time. These locations can be dynamically registered with the SIP
  698. server (Sections 1.4.7, 4.2.6). A location server MAY also use one or
  699. more other protocols, such as finger (RFC 1288 [17]), rwhois (RFC
  700. 2167 [18]), LDAP (RFC 1777 [19]), multicast-based protocols [20] or
  701. operating-system dependent mechanisms to actively determine the end
  702. system where a user might be reachable. A location server MAY return
  703. several locations because the user is logged in at several hosts
  704. simultaneously or because the location server has (temporarily)
  705. inaccurate information. The SIP server combines the results to yield
  706. a list of a zero or more locations.
  707. The action taken on receiving a list of locations varies with the
  708. type of SIP server. A SIP redirect server returns the list to the
  709. client as Contact headers (Section 6.13). A SIP proxy server can
  710. sequentially or in parallel try the addresses until the call is
  711. successful (2xx response) or the callee has declined the call (6xx
  712. response). With sequential attempts, a proxy server can implement an
  713. "anycast" service.
  714. If a proxy server forwards a SIP request, it MUST add itself to the
  715. beginning of the list of forwarders noted in the Via (Section 6.40)
  716. headers. The Via trace ensures that replies can take the same path
  717. back, ensuring correct operation through compliant firewalls and
  718. avoiding request loops. On the response path, each host MUST remove
  719. its Via, so that routing internal information is hidden from the
  720. callee and outside networks. A proxy server MUST check that it does
  721. not generate a request to a host listed in the Via sent-by, via-
  722. received or via-maddr parameters (Section 6.40). (Note: If a host has
  723. several names or network addresses, this does not always work. Thus,
  724. each host also checks if it is part of the Via list.)
  725. A SIP invitation may traverse more than one SIP proxy server. If one
  726. of these "forks" the request, i.e., issues more than one request in
  727. response to receiving the invitation request, it is possible that a
  728. client is reached, independently, by more than one copy of the
  729. Handley, et al. Standards Track [Page 17]
  730. RFC 2543 SIP: Session Initiation Protocol March 1999
  731. invitation request. Each of these copies bears the same Call-ID. The
  732. user agent MUST return the same status response returned in the first
  733. response. Duplicate requests are not an error.
  734. 1.4.6 Changing an Existing Session
  735. In some circumstances, it is desirable to change the parameters of an
  736. existing session. This is done by re-issuing the INVITE, using the
  737. same Call-ID, but a new or different body or header fields to convey
  738. the new information. This re INVITE MUST have a higher CSeq than any
  739. previous request from the client to the server.
  740. For example, two parties may have been conversing and then want to
  741. add a third party, switching to multicast for efficiency. One of the
  742. participants invites the third party with the new multicast address
  743. and simultaneously sends an INVITE to the second party, with the new
  744. multicast session description, but with the old call identifier.
  745. 1.4.7 Registration Services
  746. The REGISTER request allows a client to let a proxy or redirect
  747. server know at which address(es) it can be reached. A client MAY also
  748. use it to install call handling features at the server.
  749. 1.5 Protocol Properties
  750. 1.5.1 Minimal State
  751. A single conference session or call involves one or more SIP
  752. request-response transactions. Proxy servers do not have to keep
  753. state for a particular call, however, they MAY maintain state for a
  754. single SIP transaction, as discussed in Section 12. For efficiency, a
  755. server MAY cache the results of location service requests.
  756. 1.5.2 Lower-Layer-Protocol Neutral
  757. SIP makes minimal assumptions about the underlying transport and
  758. network-layer protocols. The lower-layer can provide either a packet
  759. or a byte stream service, with reliable or unreliable service.
  760. In an Internet context, SIP is able to utilize both UDP and TCP as
  761. transport protocols, among others. UDP allows the application to more
  762. carefully control the timing of messages and their retransmission, to
  763. perform parallel searches without requiring TCP connection state for
  764. each outstanding request, and to use multicast. Routers can more
  765. readily snoop SIP UDP packets. TCP allows easier passage through
  766. existing firewalls.
  767. Handley, et al. Standards Track [Page 18]
  768. RFC 2543 SIP: Session Initiation Protocol March 1999
  769. +....... cs.columbia.edu .......+
  770. : :
  771. : (~~~~~~~~~~) :
  772. : ( location ) :
  773. : ( service ) :
  774. : (~~~~~~~~~~) :
  775. : ^ | :
  776. : | hgs@lab :
  777. : 2| 3| :
  778. : | | :
  779. : henning| :
  780. +.. cs.tu-berlin.de ..+ 1: INVITE : | | :
  781. : : henning@cs.col: | \/ :
  782. : cz@cs.tu-berlin.de =======================>(~~~~~~) :
  783. : | ^ | <.......................( ) :
  784. : | . | : 4: 302 Moved : ( ) :
  785. : | . | : hgs@lab : ( work ) :
  786. : | . | : : ( ) :
  787. : | . | : 5: ACK : ( ) :
  788. : | . | =======================>(~~~~~~) :
  789. : | . | : : :
  790. +.......|...|.........+ : :
  791. | . | : :
  792. | . | : :
  793. | . | : :
  794. | . | : :
  795. | . | 6: INVITE hgs@lab.cs.columbia.edu (~~~~~~) :
  796. | . ==================================================> ( ) :
  797. | ..................................................... ( ) :
  798. | 7: 200 OK : ( lab ) :
  799. | : ( ) :
  800. | 8: ACK : ( ) :
  801. ======================================================> (~~~~~~) :
  802. +...............................+
  803. ====> SIP request
  804. ....> SIP response
  805. ^
  806. | non-SIP protocols
  807. |
  808. Figure 2: Example of SIP redirect server
  809. Handley, et al. Standards Track [Page 19]
  810. RFC 2543 SIP: Session Initiation Protocol March 1999
  811. When TCP is used, SIP can use one or more connections to attempt to
  812. contact a user or to modify parameters of an existing conference.
  813. Different SIP requests for the same SIP call MAY use different TCP
  814. connections or a single persistent connection, as appropriate.
  815. For concreteness, this document will only refer to Internet
  816. protocols. However, SIP MAY also be used directly with protocols
  817. such as ATM AAL5, IPX, frame relay or X.25. The necessary naming
  818. conventions are beyond the scope of this document. User agents SHOULD
  819. implement both UDP and TCP transport. Proxy, registrar, and redirect
  820. servers MUST implement both UDP and TCP transport.
  821. 1.5.3 Text-Based
  822. SIP is text-based, using ISO 10646 in UTF-8 encoding throughout. This
  823. allows easy implementation in languages such as Java, Tcl and Perl,
  824. allows easy debugging, and most importantly, makes SIP flexible and
  825. extensible. As SIP is used for initiating multimedia conferences
  826. rather than delivering media data, it is believed that the additional
  827. overhead of using a text-based protocol is not significant.
  828. 2 SIP Uniform Resource Locators
  829. SIP URLs are used within SIP messages to indicate the originator
  830. (From), current destination (Request-URI) and final recipient (To) of
  831. a SIP request, and to specify redirection addresses (Contact). A SIP
  832. URL can also be embedded in web pages or other hyperlinks to indicate
  833. that a particular user or service can be called via SIP. When used as
  834. a hyperlink, the SIP URL indicates the use of the INVITE method.
  835. The SIP URL scheme is defined to allow setting SIP request-header
  836. fields and the SIP message-body.
  837. This corresponds to the use of mailto: URLs. It makes it
  838. possible, for example, to specify the subject, urgency or
  839. media types of calls initiated through a web page or as
  840. part of an email message.
  841. A SIP URL follows the guidelines of RFC 2396 [12] and has the syntax
  842. shown in Fig. 3. The syntax is described using Augmented Backus-Naur
  843. Form (See Section C). Note that reserved characters have to be
  844. escaped and that the "set of characters reserved within any given URI
  845. component is defined by that component. In general, a character is
  846. reserved if the semantics of the URI changes if the character is
  847. replaced with its escaped US-ASCII encoding" [12].
  848. Handley, et al. Standards Track [Page 20]
  849. RFC 2543 SIP: Session Initiation Protocol March 1999
  850. SIP-URL = "sip:" [ userinfo "@" ] hostport
  851. url-parameters [ headers ]
  852. userinfo = user [ ":" password ]
  853. user = *( unreserved | escaped
  854. | "&" | "=" | "+" | "$" | "," )
  855. password = *( unreserved | escaped
  856. | "&" | "=" | "+" | "$" | "," )
  857. hostport = host [ ":" port ]
  858. host = hostname | IPv4address
  859. hostname = *( domainlabel "." ) toplabel [ "." ]
  860. domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
  861. toplabel = alpha | alpha *( alphanum | "-" ) alphanum
  862. IPv4address = 1*digit "." 1*digit "." 1*digit "." 1*digit
  863. port = *digit
  864. url-parameters = *( ";" url-parameter )
  865. url-parameter = transport-param | user-param | method-param
  866. | ttl-param | maddr-param | other-param
  867. transport-param = "transport=" ( "udp" | "tcp" )
  868. ttl-param = "ttl=" ttl
  869. ttl = 1*3DIGIT ; 0 to 255
  870. maddr-param = "maddr=" host
  871. user-param = "user=" ( "phone" | "ip" )
  872. method-param = "method=" Method
  873. tag-param = "tag=" UUID
  874. UUID = 1*( hex | "-" )
  875. other-param = ( token | ( token "=" ( token | quoted-string )))
  876. headers = "?" header *( "&" header )
  877. header = hname "=" hvalue
  878. hname = 1*uric
  879. hvalue = *uric
  880. uric = reserved | unreserved | escaped
  881. reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
  882. "$" | ","
  883. digits = 1*DIGIT
  884. Figure 3: SIP URL syntax
  885. The URI character classes referenced above are described in Appendix
  886. C.
  887. The components of the SIP URI have the following meanings.
  888. Handley, et al. Standards Track [Page 21]
  889. RFC 2543 SIP: Session Initiation Protocol March 1999
  890. telephone-subscriber = global-phone-number | local-phone-number
  891. global-phone-number = "+" 1*phonedigit [isdn-subaddress]
  892. [post-dial]
  893. local-phone-number = 1*(phonedigit | dtmf-digit |
  894. pause-character) [isdn-subaddress]
  895. [post-dial]
  896. isdn-subaddress = ";isub=" 1*phonedigit
  897. post-dial = ";postd=" 1*(phonedigit | dtmf-digit
  898. | pause-character)
  899. phonedigit = DIGIT | visual-separator
  900. visual-separator = "-" | "."
  901. pause-character = one-second-pause | wait-for-dial-tone
  902. one-second-pause = "p"
  903. wait-for-dial-tone = "w"
  904. dtmf-digit = "*" | "#" | "A" | "B" | "C" | "D"
  905. Figure 4: SIP URL syntax; telephone subscriber
  906. user: If the host is an Internet telephony gateway, the user field
  907. MAY also encode a telephone number using the notation of
  908. telephone-subscriber (Fig. 4). The telephone number is a special
  909. case of a user name and cannot be distinguished by a BNF. Thus,
  910. a URL parameter, user, is added to distinguish telephone numbers
  911. from user names. The phone identifier is to be used when
  912. connecting to a telephony gateway. Even without this parameter,
  913. recipients of SIP URLs MAY interpret the pre-@ part as a phone
  914. number if local restrictions on the name space for user name
  915. allow it.
  916. password: The SIP scheme MAY use the format "user:password" in the
  917. userinfo field. The use of passwords in the userinfo is NOT
  918. RECOMMENDED, because the passing of authentication information
  919. in clear text (such as URIs) has proven to be a security risk in
  920. almost every case where it has been used.
  921. host: The mailto: URL and RFC 822 email addresses require that
  922. numeric host addresses ("host numbers") are enclosed in square
  923. brackets (presumably, since host names might be numeric), while
  924. host numbers without brackets are used for all other URLs. The
  925. SIP URL requires the latter form, without brackets.
  926. The issue of IPv6 literal addresses in URLs is being looked at
  927. elsewhere in the IETF. SIP implementers are advised to keep up to
  928. date on that activity.
  929. Handley, et al. Standards Track [Page 22]
  930. RFC 2543 SIP: Session Initiation Protocol March 1999
  931. port: The port number to send a request to. If not present, the
  932. procedures outlined in Section 1.4.2 are used to determine the
  933. port number to send a request to.
  934. URL parameters: SIP URLs can define specific parameters of the
  935. request. URL parameters are added after the host component and
  936. are separated by semi-colons. The transport parameter determines
  937. the the transport mechanism (UDP or TCP). UDP is to be assumed
  938. when no explicit transport parameter is included. The maddr
  939. parameter provides the server address to be contacted for this
  940. user, overriding the address supplied in the host field. This
  941. address is typically a multicast address, but could also be the
  942. address of a backup server. The ttl parameter determines the
  943. time-to-live value of the UDP multicast packet and MUST only be
  944. used if maddr is a multicast address and the transport protocol
  945. is UDP. The user parameter was described above. For example, to
  946. specify to call j.doe@big.com using multicast to 239.255.255.1
  947. with a ttl of 15, the following URL would be used:
  948. sip:j.doe@big.com;maddr=239.255.255.1;ttl=15
  949. The transport, maddr, and ttl parameters MUST NOT be used in the From
  950. and To header fields and the Request-URI; they are ignored if
  951. present.
  952. Headers: Headers of the SIP request can be defined with the "?"
  953. mechanism within a SIP URL. The special hname "body" indicates
  954. that the associated hvalue is the message-body of the SIP INVITE
  955. request. Headers MUST NOT be used in the From and To header
  956. fields and the Request-URI; they are ignored if present. hname
  957. and hvalue are encodings of a SIP header name and value,
  958. respectively. All URL reserved characters in the header names
  959. and values MUST be escaped.
  960. Method: The method of the SIP request can be specified with the
  961. method parameter. This parameter MUST NOT be used in the From
  962. and To header fields and the Request-URI; they are ignored if
  963. present.
  964. Table 2 summarizes where the components of the SIP URL can be used
  965. and what default values they assume if not present.
  966. Examples of SIP URLs are:
  967. Handley, et al. Standards Track [Page 23]
  968. RFC 2543 SIP: Session Initiation Protocol March 1999
  969. default Req.-URI To From Contact external
  970. user -- x x x x x
  971. password -- x x x x
  972. host mandatory x x x x x
  973. port 5060 x x x x x
  974. user-param ip x x x x x
  975. method INVITE x x
  976. maddr-param -- x x
  977. ttl-param 1 x x
  978. transp.-param -- x x
  979. headers -- x x
  980. Table 2: Use and default values of URL components for SIP headers,
  981. Request-URI and references
  982. sip:j.doe@big.com
  983. sip:j.doe:secret@big.com;transport=tcp
  984. sip:j.doe@big.com?subject=project
  985. sip:+1-212-555-1212:1234@gateway.com;user=phone
  986. sip:1212@gateway.com
  987. sip:alice@10.1.2.3
  988. sip:alice@example.com
  989. sip:alice%40example.com@gateway.com
  990. sip:alice@registrar.com;method=REGISTER
  991. Within a SIP message, URLs are used to indicate the source and
  992. intended destination of a request, redirection addresses and the
  993. current destination of a request. Normally all these fields will
  994. contain SIP URLs.
  995. SIP URLs are case-insensitive, so that for example the two URLs
  996. sip:j.doe@example.com and SIP:J.Doe@Example.com are equivalent. All
  997. URL parameters are included when comparing SIP URLs for equality.
  998. SIP header fields MAY contain non-SIP URLs. As an example, if a call
  999. from a telephone is relayed to the Internet via SIP, the SIP From
  1000. header field might contain a phone URL.
  1001. 3 SIP Message Overview
  1002. SIP is a text-based protocol and uses the ISO 10646 character set in
  1003. UTF-8 encoding (RFC 2279 [21]). Senders MUST terminate lines with a
  1004. CRLF, but receivers MUST also interpret CR and LF by themselves as
  1005. line terminators.
  1006. Handley, et al. Standards Track [Page 24]
  1007. RFC 2543 SIP: Session Initiation Protocol March 1999
  1008. Except for the above difference in character sets, much of the
  1009. message syntax is and header fields are identical to HTTP/1.1; rather
  1010. than repeating the syntax and semantics here we use [HX.Y] to refer
  1011. to Section X.Y of the current HTTP/1.1 specification (RFC 2068 [11]).
  1012. In addition, we describe SIP in both prose and an augmented Backus-
  1013. Naur form (ABNF). See section C for an overview of ABNF.
  1014. Note, however, that SIP is not an extension of HTTP.
  1015. Unlike HTTP, SIP MAY use UDP. When sent over TCP or UDP, multiple SIP
  1016. transactions can be carried in a single TCP connection or UDP
  1017. datagram. UDP datagrams, including all headers, SHOULD NOT be larger
  1018. than the path maximum transmission unit (MTU) if the MTU is known, or
  1019. 1500 bytes if the MTU is unknown.
  1020. The 1500 bytes accommodates encapsulation within the
  1021. "typical" ethernet MTU without IP fragmentation. Recent
  1022. studies [22] indicate that an MTU of 1500 bytes is a
  1023. reasonable assumption. The next lower common MTU values are
  1024. 1006 bytes for SLIP and 296 for low-delay PPP (RFC 1191
  1025. [23]). Thus, another reasonable value would be a message
  1026. size of 950 bytes, to accommodate packet headers within the
  1027. SLIP MTU without fragmentation.
  1028. A SIP message is either a request from a client to a server, or a
  1029. response from a server to a client.
  1030. SIP-message = Request | Response
  1031. Both Request (section 4) and Response (section 5) messages use the
  1032. generic-message format of RFC 822 [24] for transferring entities (the
  1033. body of the message). Both types of messages consist of a start-line,
  1034. one or more header fields (also known as "headers"), an empty line
  1035. (i.e., a line with nothing preceding the carriage-return line-feed
  1036. (CRLF)) indicating the end of the header fields, and an optional
  1037. message-body. To avoid confusion with similar-named headers in HTTP,
  1038. we refer to the headers describing the message body as entity
  1039. headers. These components are described in detail in the upcoming
  1040. sections.
  1041. generic-message = start-line
  1042. *message-header
  1043. Handley, et al. Standards Track [Page 25]
  1044. RFC 2543 SIP: Session Initiation Protocol March 1999
  1045. CRLF
  1046. [ message-body ]
  1047. start-line = Request-Line | ;Section 4.1
  1048. Status-Line ;Section 5.1
  1049. message-header = ( general-header
  1050. | request-header
  1051. | response-header
  1052. | entity-header )
  1053. In the interest of robustness, any leading empty line(s) MUST be
  1054. ignored. In other words, if the Request or Response message begins
  1055. with one or more CRLF, CR, or LFs, these characters MUST be ignored.
  1056. 4 Request
  1057. The Request message format is shown below:
  1058. Request = Request-Line ; Section 4.1
  1059. *( general-header
  1060. | request-header
  1061. | entity-header )
  1062. CRLF
  1063. [ message-body ] ; Section 8
  1064. 4.1 Request-Line
  1065. The Request-Line begins with a method token, followed by the
  1066. Request-URI and the protocol version, and ending with CRLF. The
  1067. elements are separated by SP characters. No CR or LF are allowed
  1068. except in the final CRLF sequence.
  1069. Request-Line = Method SP Request-URI SP SIP-Version CRLF
  1070. Handley, et al. Standards Track [Page 26]
  1071. RFC 2543 SIP: Session Initiation Protocol March 1999
  1072. general-header = Accept ; Section 6.7
  1073. | Accept-Encoding ; Section 6.8
  1074. | Accept-Language ; Section 6.9
  1075. | Call-ID ; Section 6.12
  1076. | Contact ; Section 6.13
  1077. | CSeq ; Section 6.17
  1078. | Date ; Section 6.18
  1079. | Encryption ; Section 6.19
  1080. | Expires ; Section 6.20
  1081. | From ; Section 6.21
  1082. | Record-Route ; Section 6.29
  1083. | Timestamp ; Section 6.36
  1084. | To ; Section 6.37
  1085. | Via ; Section 6.40
  1086. entity-header = Content-Encoding ; Section 6.14
  1087. | Content-Length ; Section 6.15
  1088. | Content-Type ; Section 6.16
  1089. request-header = Authorization ; Section 6.11
  1090. | Contact ; Section 6.13
  1091. | Hide ; Section 6.22
  1092. | Max-Forwards ; Section 6.23
  1093. | Organization ; Section 6.24
  1094. | Priority ; Section 6.25
  1095. | Proxy-Authorization ; Section 6.27
  1096. | Proxy-Require ; Section 6.28
  1097. | Route ; Section 6.33
  1098. | Require ; Section 6.30
  1099. | Response-Key ; Section 6.31
  1100. | Subject ; Section 6.35
  1101. | User-Agent ; Section 6.39
  1102. response-header = Allow ; Section 6.10
  1103. | Proxy-Authenticate ; Section 6.26
  1104. | Retry-After ; Section 6.32
  1105. | Server ; Section 6.34
  1106. | Unsupported ; Section 6.38
  1107. | Warning ; Section 6.41
  1108. | WWW-Authenticate ; Section 6.42
  1109. Table 3: SIP headers
  1110. 4.2 Methods
  1111. The methods are defined below. Methods that are not supported by a
  1112. proxy or redirect server are treated by that server as if they were
  1113. an OPTIONS method and forwarded accordingly. Methods that are not
  1114. Handley, et al. Standards Track [Page 27]
  1115. RFC 2543 SIP: Session Initiation Protocol March 1999
  1116. supported by a user agent server or registrar cause a 501 (Not
  1117. Implemented) response to be returned (Section 7). As in HTTP, the
  1118. Method token is case-sensitive.
  1119. Method = "INVITE" | "ACK" | "OPTIONS" | "BYE"
  1120. | "CANCEL" | "REGISTER"
  1121. 4.2.1 INVITE
  1122. The INVITE method indicates that the user or service is being invited
  1123. to participate in a session. The message body contains a description
  1124. of the session to which the callee is being invited. For two-party
  1125. calls, the caller indicates the type of media it is able to receive
  1126. and possibly the media it is willing to send as well as their
  1127. parameters such as network destination. A success response MUST
  1128. indicate in its message body which media the callee wishes to receive
  1129. and MAY indicate the media the callee is going to send.
  1130. Not all session description formats have the ability to
  1131. indicate sending media.
  1132. A server MAY automatically respond to an invitation for a conference
  1133. the user is already participating in, identified either by the SIP
  1134. Call-ID or a globally unique identifier within the session
  1135. description, with a 200 (OK) response.
  1136. If a user agent receives an INVITE request for an existing call leg
  1137. with a higher CSeq sequence number than any previous INVITE for the
  1138. same Call-ID, it MUST check any version identifiers in the session
  1139. description or, if there are no version identifiers, the content of
  1140. the session description to see if it has changed. It MUST also
  1141. inspect any other header fields for changes. If there is a change,
  1142. the user agent MUST update any internal state or information
  1143. generated as a result of that header. If the session description has
  1144. changed, the user agent server MUST adjust the session parameters
  1145. accordingly, possibly after asking the user for confirmation.
  1146. (Versioning of the session description can be used to accommodate the
  1147. capabilities of new arrivals to a conference, add or delete media or
  1148. change from a unicast to a multicast conference.)
  1149. This method MUST be supported by SIP proxy, redirect and user agent
  1150. servers as well as clients.
  1151. Handley, et al. Standards Track [Page 28]
  1152. RFC 2543 SIP: Session Initiation Protocol March 1999
  1153. 4.2.2 ACK
  1154. The ACK request confirms that the client has received a final
  1155. response to an INVITE request. (ACK is used only with INVITE
  1156. requests.) 2xx responses are acknowledged by client user agents, all
  1157. other final responses by the first proxy or client user agent to
  1158. receive the response. The Via is always initialized to the host that
  1159. originates the ACK request, i.e., the client user agent after a 2xx
  1160. response or the first proxy to receive a non-2xx final response. The
  1161. ACK request is forwarded as the corresponding INVITE request, based
  1162. on its Request-URI. See Section 10 for details.
  1163. The ACK request MAY contain a message body with the final session
  1164. description to be used by the callee. If the ACK message body is
  1165. empty, the callee uses the session description in the INVITE request.
  1166. A proxy server receiving an ACK request after having sent a 3xx, 4xx,
  1167. 5xx, or 6xx response must make a determination about whether the ACK
  1168. is for it, or for some user agent or proxy server further downstream.
  1169. This determination is made by examining the tag in the To field. If
  1170. the tag in the ACK To header field matches the tag in the To header
  1171. field of the response, and the From, CSeq and Call-ID header fields
  1172. in the response match those in the ACK, the ACK is meant for the
  1173. proxy server. Otherwise, the ACK SHOULD be proxied downstream as any
  1174. other request.
  1175. It is possible for a user agent client or proxy server to
  1176. receive multiple 3xx, 4xx, 5xx, and 6xx responses to a
  1177. request along a single branch. This can happen under
  1178. various error conditions, typically when a forking proxy
  1179. transitions from stateful to stateless before receiving all
  1180. responses. The various responses will all be identical,
  1181. except for the tag in the To field, which is different for
  1182. each one. It can therefore be used as a means to
  1183. disambiguate them.
  1184. This method MUST be supported by SIP proxy, redirect and user agent
  1185. servers as well as clients.
  1186. 4.2.3 OPTIONS
  1187. The server is being queried as to its capabilities. A server that
  1188. believes it can contact the user, such as a user agent where the user
  1189. is logged in and has been recently active, MAY respond to this
  1190. request with a capability set. A called user agent MAY return a
  1191. status reflecting how it would have responded to an invitation, e.g.,
  1192. Handley, et al. Standards Track [Page 29]
  1193. RFC 2543 SIP: Session Initiation Protocol March 1999
  1194. 600 (Busy). Such a server SHOULD return an Allow header field
  1195. indicating the methods that it supports. Proxy and redirect servers
  1196. simply forward the request without indicating their capabilities.
  1197. This method MUST be supported by SIP proxy, redirect and user agent
  1198. servers, registrars and clients.
  1199. 4.2.4 BYE
  1200. The user agent client uses BYE to indicate to the server that it
  1201. wishes to release the call. A BYE request is forwarded like an INVITE
  1202. request and MAY be issued by either caller or callee. A party to a
  1203. call SHOULD issue a BYE request before releasing a call ("hanging
  1204. up"). A party receiving a BYE request MUST cease transmitting media
  1205. streams specifically directed at the party issuing the BYE request.
  1206. If the INVITE request contained a Contact header, the callee SHOULD
  1207. send a BYE request to that address rather than the From address.
  1208. This method MUST be supported by proxy servers and SHOULD be
  1209. supported by redirect and user agent SIP servers.
  1210. 4.2.5 CANCEL
  1211. The CANCEL request cancels a pending request with the same Call-ID,
  1212. To, From and CSeq (sequence number only) header field values, but
  1213. does not affect a completed request. (A request is considered
  1214. completed if the server has returned a final status response.)
  1215. A user agent client or proxy client MAY issue a CANCEL request at any
  1216. time. A proxy, in particular, MAY choose to send a CANCEL to
  1217. destinations that have not yet returned a final response after it has
  1218. received a 2xx or 6xx response for one or more of the parallel-search
  1219. requests. A proxy that receives a CANCEL request forwards the request
  1220. to all destinations with pending requests.
  1221. The Call-ID, To, the numeric part of CSeq and From headers in the
  1222. CANCEL request are identical to those in the original request. This
  1223. allows a CANCEL request to be matched with the request it cancels.
  1224. However, to allow the client to distinguish responses to the CANCEL
  1225. from those to the original request, the CSeq Method component is set
  1226. to CANCEL. The Via header field is initialized to the proxy issuing
  1227. the CANCEL request. (Thus, responses to this CANCEL request only
  1228. reach the issuing proxy.)
  1229. Once a user agent server has received a CANCEL, it MUST NOT issue a
  1230. 2xx response for the cancelled original request.
  1231. Handley, et al. Standards Track [Page 30]
  1232. RFC 2543 SIP: Session Initiation Protocol March 1999
  1233. A redirect or user agent server receiving a CANCEL request responds
  1234. with a status of 200 (OK) if the transaction exists and a status of
  1235. 481 (Transaction Does Not Exist) if not, but takes no further action.
  1236. In particular, any existing call is unaffected.
  1237. The BYE request cannot be used to cancel branches of a
  1238. parallel search, since several branches may, through
  1239. intermediate proxies, find the same user agent server and
  1240. then terminate the call. To terminate a call instead of
  1241. just pending searches, the UAC must use BYE instead of or
  1242. in addition to CANCEL. While CANCEL can terminate any
  1243. pending request other than ACK or CANCEL, it is typically
  1244. useful only for INVITE. 200 responses to INVITE and 200
  1245. responses to CANCEL are distinguished by the method in the
  1246. Cseq header field, so there is no ambiguity.
  1247. This method MUST be supported by proxy servers and SHOULD be
  1248. supported by all other SIP server types.
  1249. 4.2.6 REGISTER
  1250. A client uses the REGISTER method to register the address listed in
  1251. the To header field with a SIP server.
  1252. A user agent MAY register with a local server on startup by sending a
  1253. REGISTER request to the well-known "all SIP servers" multicast
  1254. address "sip.mcast.net" (224.0.1.75). This request SHOULD be scoped
  1255. to ensure it is not forwarded beyond the boundaries of the
  1256. administrative system. This MAY be done with either TTL or
  1257. administrative scopes [25], depending on what is implemented in the
  1258. network. SIP user agents MAY listen to that address and use it to
  1259. become aware of the location of other local users [20]; however, they
  1260. do not respond to the request. A user agent MAY also be configured
  1261. with the address of a registrar server to which it sends a REGISTER
  1262. request upon startup.
  1263. Requests are processed in the order received. Clients SHOULD avoid
  1264. sending a new registration (as opposed to a retransmission) until
  1265. they have received the response from the server for the previous one.
  1266. Clients may register from different locations, by necessity
  1267. using different Call-ID values. Thus, the CSeq value cannot
  1268. be used to enforce ordering. Since registrations are
  1269. additive, ordering is less of a problem than if each
  1270. REGISTER request completely replaced all earlier ones.
  1271. Handley, et al. Standards Track [Page 31]
  1272. RFC 2543 SIP: Session Initiation Protocol March 1999
  1273. The meaning of the REGISTER request-header fields is defined as
  1274. follows. We define "address-of-record" as the SIP address that the
  1275. registry knows the registrand, typically of the form "user@domain"
  1276. rather than "user@host". In third-party registration, the entity
  1277. issuing the request is different from the entity being registered.
  1278. To: The To header field contains the address-of-record whose
  1279. registration is to be created or updated.
  1280. From: The From header field contains the address-of-record of the
  1281. person responsible for the registration. For first-party
  1282. registration, it is identical to the To header field value.
  1283. Request-URI: The Request-URI names the destination of the
  1284. registration request, i.e., the domain of the registrar. The
  1285. user name MUST be empty. Generally, the domains in the Request-
  1286. URI and the To header field have the same value; however, it is
  1287. possible to register as a "visitor", while maintaining one's
  1288. name. For example, a traveler sip:alice@acme.com (To) might
  1289. register under the Request-URI sip:atlanta.hiayh.org , with the
  1290. former as the To header field and the latter as the Request-URI.
  1291. The REGISTER request is no longer forwarded once it has reached
  1292. the server whose authoritative domain is the one listed in the
  1293. Request-URI.
  1294. Call-ID: All registrations from a client SHOULD use the same Call-ID
  1295. header value, at least within the same reboot cycle.
  1296. Cseq: Registrations with the same Call-ID MUST have increasing CSeq
  1297. header values. However, the server does not reject out-of-order
  1298. requests.
  1299. Contact: The request MAY contain a Contact header field; future non-
  1300. REGISTER requests for the URI given in the To header field
  1301. SHOULD be directed to the address(es) given in the Contact
  1302. header.
  1303. If the request does not contain a Contact header, the registration
  1304. remains unchanged.
  1305. This is useful to obtain the current list of registrations
  1306. in the response. Registrations using SIP URIs that differ
  1307. in one or more of host, port, transport-param or maddr-
  1308. param (see Figure 3) from an existing registration are
  1309. added to the list of registrations. Other URI types are
  1310. compared according to the standard URI equivalency rules
  1311. for the URI schema. If the URIs are equivalent to that of
  1312. an existing registration, the new registration replaces the
  1313. Handley, et al. Standards Track [Page 32]
  1314. RFC 2543 SIP: Session Initiation Protocol March 1999
  1315. old one if it has a higher q value or, for the same value
  1316. of q, if the ttl value is higher. All current registrations
  1317. MUST share the same action value. Registrations that have
  1318. a different action than current registrations for the same
  1319. user MUST be rejected with status of 409 (Conflict).
  1320. A proxy server ignores the q parameter when processing non-REGISTER
  1321. requests, while a redirect server simply returns that parameter in
  1322. its Contact response header field.
  1323. Having the proxy server interpret the q parameter is not
  1324. sufficient to guide proxy behavior, as it is not clear, for
  1325. example, how long it is supposed to wait between trying
  1326. addresses.
  1327. If the registration is changed while a user agent or proxy server
  1328. processes an invitation, the new information SHOULD be used.
  1329. This allows a service known as "directed pick-up". In the
  1330. telephone network, directed pickup permits a user at a
  1331. remote station who hears his own phone ringing to pick up
  1332. at that station, dial an access code, and be connected to
  1333. the calling user as if he had answered his own phone.
  1334. A server MAY choose any duration for the registration lifetime.
  1335. Registrations not refreshed after this amount of time SHOULD be
  1336. silently discarded. Responses to a registration SHOULD include an
  1337. Expires header (Section 6.20) or expires Contact parameters (Section
  1338. 6.13), indicating the time at which the server will drop the
  1339. registration. If none is present, one hour is assumed. Clients MAY
  1340. request a registration lifetime by indicating the time in an Expires
  1341. header in the request. A server SHOULD NOT use a higher lifetime than
  1342. the one requested, but MAY use a lower one. A single address (if
  1343. host-independent) MAY be registered from several different clients.
  1344. A client cancels an existing registration by sending a REGISTER
  1345. request with an expiration time (Expires) of zero seconds for a
  1346. particular Contact or the wildcard Contact designated by a "*" for
  1347. all registrations. Registrations are matched based on the user, host,
  1348. port and maddr parameters.
  1349. The server SHOULD return the current list of registrations in the 200
  1350. response as Contact header fields.
  1351. It is particularly important that REGISTER requests are authenticated
  1352. since they allow to redirect future requests (see Section 13.2).
  1353. Handley, et al. Standards Track [Page 33]
  1354. RFC 2543 SIP: Session Initiation Protocol March 1999
  1355. Beyond its use as a simple location service, this method is
  1356. needed if there are several SIP servers on a single host.
  1357. In that case, only one of the servers can use the default
  1358. port number.
  1359. Support of this method is RECOMMENDED.
  1360. 4.3 Request-URI
  1361. The Request-URI is a SIP URL as described in Section 2 or a general
  1362. URI. It indicates the user or service to which this request is being
  1363. addressed. Unlike the To field, the Request-URI MAY be re-written by
  1364. proxies.
  1365. When used as a Request-URI, a SIP-URL MUST NOT contain the
  1366. transport-param, maddr-param, ttl-param, or headers elements. A
  1367. server that receives a SIP-URL with these elements removes them
  1368. before further processing.
  1369. Typically, the UAC sets the Request-URI and To to the same
  1370. SIP URL, presumed to remain unchanged over long time
  1371. periods. However, if the UAC has cached a more direct path
  1372. to the callee, e.g., from the Contact header field of a
  1373. response to a previous request, the To would still contain
  1374. the long-term, "public" address, while the Request-URI
  1375. would be set to the cached address.
  1376. Proxy and redirect servers MAY use the information in the Request-URI
  1377. and request header fields to handle the request and possibly rewrite
  1378. the Request-URI. For example, a request addressed to the generic
  1379. address sip:sales@acme.com is proxied to the particular person, e.g.,
  1380. sip:bob@ny.acme.com , with the To field remaining as
  1381. sip:sales@acme.com. At ny.acme.com , Bob then designates Alice as
  1382. the temporary substitute.
  1383. The host part of the Request-URI typically agrees with one of the
  1384. host names of the receiving server. If it does not, the server SHOULD
  1385. proxy the request to the address indicated or return a 404 (Not
  1386. Found) response if it is unwilling or unable to do so. For example,
  1387. the Request-URI and server host name can disagree in the case of a
  1388. firewall proxy that handles outgoing calls. This mode of operation is
  1389. similar to that of HTTP proxies.
  1390. If a SIP server receives a request with a URI indicating a scheme
  1391. other than SIP which that server does not understand, the server MUST
  1392. return a 400 (Bad Request) response. It MUST do this even if the To
  1393. Handley, et al. Standards Track [Page 34]
  1394. RFC 2543 SIP: Session Initiation Protocol March 1999
  1395. header field contains a scheme it does understand. This is because
  1396. proxies are responsible for processing the Request-URI; the To field
  1397. is of end-to-end significance.
  1398. 4.3.1 SIP Version
  1399. Both request and response messages include the version of SIP in use,
  1400. and follow [H3.1] (with HTTP replaced by SIP, and HTTP/1.1 replaced
  1401. by SIP/2.0) regarding version ordering, compliance requirements, and
  1402. upgrading of version numbers. To be compliant with this
  1403. specification, applications sending SIP messages MUST include a SIP-
  1404. Version of "SIP/2.0".
  1405. 4.4 Option Tags
  1406. Option tags are unique identifiers used to designate new options in
  1407. SIP. These tags are used in Require (Section 6.30) and Unsupported
  1408. (Section 6.38) fields.
  1409. Syntax:
  1410. option-tag = token
  1411. See Section C for a definition of token. The creator of a new SIP
  1412. option MUST either prefix the option with their reverse domain name
  1413. or register the new option with the Internet Assigned Numbers
  1414. Authority (IANA). For example, "com.foo.mynewfeature" is an apt name
  1415. for a feature whose inventor can be reached at "foo.com". Individual
  1416. organizations are then responsible for ensuring that option names
  1417. don't collide. Options registered with IANA have the prefix
  1418. "org.iana.sip.", options described in RFCs have the prefix
  1419. "org.ietf.rfc.N", where N is the RFC number. Option tags are case-
  1420. insensitive.
  1421. 4.4.1 Registering New Option Tags with IANA
  1422. When registering a new SIP option, the following information MUST be
  1423. provided:
  1424. o Name and description of option. The name MAY be of any
  1425. length, but SHOULD be no more than twenty characters long. The
  1426. name MUST consist of alphanum (See Figure 3) characters only;
  1427. Handley, et al. Standards Track [Page 35]
  1428. RFC 2543 SIP: Session Initiation Protocol March 1999
  1429. o Indication of who has change control over the option (for
  1430. example, IETF, ISO, ITU-T, other international standardization
  1431. bodies, a consortium or a particular company or group of
  1432. companies);
  1433. o A reference to a further description, if available, for
  1434. example (in order of preference) an RFC, a published paper, a
  1435. patent filing, a technical report, documented source code or a
  1436. computer manual;
  1437. o Contact information (postal and email address);
  1438. Registrations should be sent to iana@iana.org
  1439. This procedure has been borrowed from RTSP [4] and the RTP
  1440. AVP [26].
  1441. 5 Response
  1442. After receiving and interpreting a request message, the recipient
  1443. responds with a SIP response message. The response message format is
  1444. shown below:
  1445. Response = Status-Line ; Section 5.1
  1446. *( general-header
  1447. | response-header
  1448. | entity-header )
  1449. CRLF
  1450. [ message-body ] ; Section 8
  1451. SIP's structure of responses is similar to [H6], but is defined
  1452. explicitly here.
  1453. 5.1 Status-Line
  1454. The first line of a Response message is the Status-Line, consisting
  1455. of the protocol version (Section 4.3.1) followed by a numeric
  1456. Status-Code and its associated textual phrase, with each element
  1457. separated by SP characters. No CR or LF is allowed except in the
  1458. final CRLF sequence.
  1459. Status-Line = SIP-version SP Status-Code SP Reason-Phrase CRLF
  1460. Handley, et al. Standards Track [Page 36]
  1461. RFC 2543 SIP: Session Initiation Protocol March 1999
  1462. 5.1.1 Status Codes and Reason Phrases
  1463. The Status-Code is a 3-digit integer result code that indicates the
  1464. outcome of the attempt to understand and satisfy the request. The
  1465. Reason-Phrase is intended to give a short textual description of the
  1466. Status-Code. The Status-Code is intended for use by automata, whereas
  1467. the Reason-Phrase is intended for the human user. The client is not
  1468. required to examine or display the Reason-Phrase.
  1469. Status-Code = Informational ;Fig. 5
  1470. | Success ;Fig. 5
  1471. | Redirection ;Fig. 6
  1472. | Client-Error ;Fig. 7
  1473. | Server-Error ;Fig. 8
  1474. | Global-Failure ;Fig. 9
  1475. | extension-code
  1476. extension-code = 3DIGIT
  1477. Reason-Phrase = *<TEXT-UTF8, excluding CR, LF>
  1478. We provide an overview of the Status-Code below, and provide full
  1479. definitions in Section 7. The first digit of the Status-Code defines
  1480. the class of response. The last two digits do not have any
  1481. categorization role. SIP/2.0 allows 6 values for the first digit:
  1482. 1xx: Informational -- request received, continuing to process the
  1483. request;
  1484. 2xx: Success -- the action was successfully received, understood, and
  1485. accepted;
  1486. 3xx: Redirection -- further action needs to be taken in order to
  1487. complete the request;
  1488. 4xx: Client Error -- the request contains bad syntax or cannot be
  1489. fulfilled at this server;
  1490. 5xx: Server Error -- the server failed to fulfill an apparently valid
  1491. request;
  1492. 6xx: Global Failure -- the request cannot be fulfilled at any server.
  1493. Figures 5 through 9 present the individual values of the numeric
  1494. response codes, and an example set of corresponding reason phrases
  1495. for SIP/2.0. These reason phrases are only recommended; they may be
  1496. replaced by local equivalents without affecting the protocol. Note
  1497. Handley, et al. Standards Track [Page 37]
  1498. RFC 2543 SIP: Session Initiation Protocol March 1999
  1499. that SIP adopts many HTTP/1.1 response codes. SIP/2.0 adds response
  1500. codes in the range starting at x80 to avoid conflicts with newly
  1501. defined HTTP response codes, and adds a new class, 6xx, of response
  1502. codes.
  1503. SIP response codes are extensible. SIP applications are not required
  1504. to understand the meaning of all registered response codes, though
  1505. such understanding is obviously desirable. However, applications MUST
  1506. understand the class of any response code, as indicated by the first
  1507. digit, and treat any unrecognized response as being equivalent to the
  1508. x00 response code of that class, with the exception that an
  1509. unrecognized response MUST NOT be cached. For example, if a client
  1510. receives an unrecognized response code of 431, it can safely assume
  1511. that there was something wrong with its request and treat the
  1512. response as if it had received a 400 (Bad Request) response code. In
  1513. such cases, user agents SHOULD present to the user the message body
  1514. returned with the response, since that message body is likely to
  1515. include human-readable information which will explain the unusual
  1516. status.
  1517. Informational = "100" ; Trying
  1518. | "180" ; Ringing
  1519. | "181" ; Call Is Being Forwarded
  1520. | "182" ; Queued
  1521. Success = "200" ; OK
  1522. Figure 5: Informational and success status codes
  1523. Redirection = "300" ; Multiple Choices
  1524. | "301" ; Moved Permanently
  1525. | "302" ; Moved Temporarily
  1526. | "303" ; See Other
  1527. | "305" ; Use Proxy
  1528. | "380" ; Alternative Service
  1529. Figure 6: Redirection status codes
  1530. Handley, et al. Standards Track [Page 38]
  1531. RFC 2543 SIP: Session Initiation Protocol March 1999
  1532. Client-Error = "400" ; Bad Request
  1533. | "401" ; Unauthorized
  1534. | "402" ; Payment Required
  1535. | "403" ; Forbidden
  1536. | "404" ; Not Found
  1537. | "405" ; Method Not Allowed
  1538. | "406" ; Not Acceptable
  1539. | "407" ; Proxy Authentication Required
  1540. | "408" ; Request Timeout
  1541. | "409" ; Conflict
  1542. | "410" ; Gone
  1543. | "411" ; Length Required
  1544. | "413" ; Request Entity Too Large
  1545. | "414" ; Request-URI Too Large
  1546. | "415" ; Unsupported Media Type
  1547. | "420" ; Bad Extension
  1548. | "480" ; Temporarily not available
  1549. | "481" ; Call Leg/Transaction Does Not Exist
  1550. | "482" ; Loop Detected
  1551. | "483" ; Too Many Hops
  1552. | "484" ; Address Incomplete
  1553. | "485" ; Ambiguous
  1554. | "486" ; Busy Here
  1555. Figure 7: Client error status codes
  1556. Server-Error = "500" ; Internal Server Error
  1557. | "501" ; Not Implemented
  1558. | "502" ; Bad Gateway
  1559. | "503" ; Service Unavailable
  1560. | "504" ; Gateway Time-out
  1561. | "505" ; SIP Version not supported
  1562. Figure 8: Server error status codes
  1563. 6 Header Field Definitions
  1564. SIP header fields are similar to HTTP header fields in both syntax
  1565. and semantics. In particular, SIP header fields follow the syntax for
  1566. message-header as described in [H4.2]. The rules for extending header
  1567. fields over multiple lines, and use of multiple message-header fields
  1568. with the same field-name, described in [H4.2] also apply to SIP. The
  1569. Handley, et al. Standards Track [Page 39]
  1570. RFC 2543 SIP: Session Initiation Protocol March 1999
  1571. Global-Failure | "600" ; Busy Everywhere
  1572. | "603" ; Decline
  1573. | "604" ; Does not exist anywhere
  1574. | "606" ; Not Acceptable
  1575. Figure 9: Global failure status codes
  1576. rules in [H4.2] regarding ordering of header fields apply to SIP,
  1577. with the exception of Via fields, see below, whose order matters.
  1578. Additionally, header fields which are hop-by-hop MUST appear before
  1579. any header fields which are end-to-end. Proxies SHOULD NOT reorder
  1580. header fields. Proxies add Via header fields and MAY add other hop-
  1581. by-hop header fields. They can modify certain header fields, such as
  1582. Max-Forwards (Section 6.23) and "fix up" the Via header fields with
  1583. "received" parameters as described in Section 6.40.1. Proxies MUST
  1584. NOT alter any fields that are authenticated (see Section 13.2).
  1585. The header fields required, optional and not applicable for each
  1586. method are listed in Table 4 and Table 5. The table uses "o" to
  1587. indicate optional, "m" mandatory and "-" for not applicable. A "*"
  1588. indicates that the header fields are needed only if message body is
  1589. not empty. See sections 6.15, 6.16 and 8 for details.
  1590. The "where" column describes the request and response types with
  1591. which the header field can be used. "R" refers to header fields that
  1592. can be used in requests (that is, request and general header fields).
  1593. "r" designates a response or general-header field as applicable to
  1594. all responses, while a list of numeric values indicates the status
  1595. codes with which the header field can be used. "g" and "e" designate
  1596. general (Section 6.1) and entity header (Section 6.2) fields,
  1597. respectively. If a header field is marked "c", it is copied from the
  1598. request to the response.
  1599. The "enc." column describes whether this message header field MAY be
  1600. encrypted end-to-end. A "n" designates fields that MUST NOT be
  1601. encrypted, while "c" designates fields that SHOULD be encrypted if
  1602. encryption is used.
  1603. The "e-e" column has a value of "e" for end-to-end and a value of "h"
  1604. for hop-by-hop header fields.
  1605. Handley, et al. Standards Track [Page 40]
  1606. RFC 2543 SIP: Session Initiation Protocol March 1999
  1607. where enc. e-e ACK BYE CAN INV OPT REG
  1608. __________________________________________________________
  1609. Accept R e - - - o o o
  1610. Accept 415 e - - - o o o
  1611. Accept-Encoding R e - - - o o o
  1612. Accept-Encoding 415 e - - - o o o
  1613. Accept-Language R e - o o o o o
  1614. Accept-Language 415 e - o o o o o
  1615. Allow 200 e - - - - m -
  1616. Allow 405 e o o o o o o
  1617. Authorization R e o o o o o o
  1618. Call-ID gc n e m m m m m m
  1619. Contact R e o - - o o o
  1620. Contact 1xx e - - - o o -
  1621. Contact 2xx e - - - o o o
  1622. Contact 3xx e - o - o o o
  1623. Contact 485 e - o - o o o
  1624. Content-Encoding e e o - - o o o
  1625. Content-Length e e o - - o o o
  1626. Content-Type e e * - - * * *
  1627. CSeq gc n e m m m m m m
  1628. Date g e o o o o o o
  1629. Encryption g n e o o o o o o
  1630. Expires g e - - - o - o
  1631. From gc n e m m m m m m
  1632. Hide R n h o o o o o o
  1633. Max-Forwards R n e o o o o o o
  1634. Organization g c h - - - o o o
  1635. Table 4: Summary of header fields, A--O
  1636. Other header fields can be added as required; a server MUST ignore
  1637. header fields not defined in this specification that it does not
  1638. understand. A proxy MUST NOT remove or modify header fields not
  1639. defined in this specification that it does not understand. A compact
  1640. form of these header fields is also defined in Section 9 for use over
  1641. UDP when the request has to fit into a single packet and size is an
  1642. issue.
  1643. Table 6 in Appendix A lists those header fields that different client
  1644. and server types MUST be able to parse.
  1645. 6.1 General Header Fields
  1646. General header fields apply to both request and response messages.
  1647. The "general-header" field names can be extended reliably only in
  1648. combination with a change in the protocol version. However, new or
  1649. Handley, et al. Standards Track [Page 41]
  1650. RFC 2543 SIP: Session Initiation Protocol March 1999
  1651. where enc. e-e ACK BYE CAN INV OPT REG
  1652. ___________________________________________________________________
  1653. Proxy-Authenticate 407 n h o o o o o o
  1654. Proxy-Authorization R n h o o o o o o
  1655. Proxy-Require R n h o o o o o o
  1656. Priority R c e - - - o - -
  1657. Require R e o o o o o o
  1658. Retry-After R c e - - - - - o
  1659. Retry-After 404,480,486 c e o o o o o o
  1660. 503 c e o o o o o o
  1661. 600,603 c e o o o o o o
  1662. Response-Key R c e - o o o o o
  1663. Record-Route R h o o o o o o
  1664. Record-Route 2xx h o o o o o o
  1665. Route R h o o o o o o
  1666. Server r c e o o o o o o
  1667. Subject R c e - - - o - -
  1668. Timestamp g e o o o o o o
  1669. To gc(1) n e m m m m m m
  1670. Unsupported 420 e o o o o o o
  1671. User-Agent g c e o o o o o o
  1672. Via gc(2) n e m m m m m m
  1673. Warning r e o o o o o o
  1674. WWW-Authenticate 401 c e o o o o o o
  1675. Table 5: Summary of header fields, P--Z; (1): copied with possible
  1676. addition of tag; (2): UAS removes first Via header field
  1677. experimental header fields MAY be given the semantics of general
  1678. header fields if all parties in the communication recognize them to
  1679. be "general-header" fields. Unrecognized header fields are treated as
  1680. "entity-header" fields.
  1681. 6.2 Entity Header Fields
  1682. The "entity-header" fields define meta-information about the
  1683. message-body or, if no body is present, about the resource identified
  1684. by the request. The term "entity header" is an HTTP 1.1 term where
  1685. the response body can contain a transformed version of the message
  1686. body. The original message body is referred to as the "entity". We
  1687. retain the same terminology for header fields but usually refer to
  1688. the "message body" rather then the entity as the two are the same in
  1689. SIP.
  1690. Handley, et al. Standards Track [Page 42]
  1691. RFC 2543 SIP: Session Initiation Protocol March 1999
  1692. 6.3 Request Header Fields
  1693. The "request-header" fields allow the client to pass additional
  1694. information about the request, and about the client itself, to the
  1695. server. These fields act as request modifiers, with semantics
  1696. equivalent to the parameters of a programming language method
  1697. invocation.
  1698. The "request-header" field names can be extended reliably only in
  1699. combination with a change in the protocol version. However, new or
  1700. experimental header fields MAY be given the semantics of "request-
  1701. header" fields if all parties in the communication recognize them to
  1702. be request-header fields. Unrecognized header fields are treated as
  1703. "entity-header" fields.
  1704. 6.4 Response Header Fields
  1705. The "response-header" fields allow the server to pass additional
  1706. information about the response which cannot be placed in the Status-
  1707. Line. These header fields give information about the server and about
  1708. further access to the resource identified by the Request-URI.
  1709. Response-header field names can be extended reliably only in
  1710. combination with a change in the protocol version. However, new or
  1711. experimental header fields MAY be given the semantics of "response-
  1712. header" fields if all parties in the communication recognize them to
  1713. be "response-header" fields. Unrecognized header fields are treated
  1714. as "entity-header" fields.
  1715. 6.5 End-to-end and Hop-by-hop Headers
  1716. End-to-end headers MUST be transmitted unmodified across all proxies,
  1717. while hop-by-hop headers MAY be modified or added by proxies.
  1718. 6.6 Header Field Format
  1719. Header fields ("general-header", "request-header", "response-header",
  1720. and "entity-header") follow the same generic header format as that
  1721. given in Section 3.1 of RFC 822 [24]. Each header field consists of a
  1722. name followed by a colon (":") and the field value. Field names are
  1723. case-insensitive. The field value MAY be preceded by any amount of
  1724. leading white space (LWS), though a single space (SP) is preferred.
  1725. Header fields can be extended over multiple lines by preceding each
  1726. extra line with at least one SP or horizontal tab (HT). Applications
  1727. MUST follow HTTP "common form" when generating these constructs,
  1728. since there might exist some implementations that fail to accept
  1729. anything beyond the common forms.
  1730. Handley, et al. Standards Track [Page 43]
  1731. RFC 2543 SIP: Session Initiation Protocol March 1999
  1732. message-header = field-name ":" [ field-value ] CRLF
  1733. field-name = token
  1734. field-value = *( field-content | LWS )
  1735. field-content = < the OCTETs making up the field-value
  1736. and consisting of either *TEXT-UTF8
  1737. or combinations of token,
  1738. separators, and quoted-string>
  1739. The relative order of header fields with different field names is not
  1740. significant. Multiple header fields with the same field-name may be
  1741. present in a message if and only if the entire field-value for that
  1742. header field is defined as a comma-separated list (i.e., #(values)).
  1743. It MUST be possible to combine the multiple header fields into one
  1744. "field-name: field-value" pair, without changing the semantics of the
  1745. message, by appending each subsequent field-value to the first, each
  1746. separated by a comma. The order in which header fields with the same
  1747. field-name are received is therefore significant to the
  1748. interpretation of the combined field value, and thus a proxy MUST NOT
  1749. change the order of these field values when a message is forwarded.
  1750. Field names are not case-sensitive, although their values may be.
  1751. 6.7 Accept
  1752. The Accept header follows the syntax defined in [H14.1]. The
  1753. semantics are also identical, with the exception that if no Accept
  1754. header is present, the server SHOULD assume a default value of
  1755. application/sdp.
  1756. This request-header field is used only with the INVITE, OPTIONS and
  1757. REGISTER request methods to indicate what media types are acceptable
  1758. in the response.
  1759. Example:
  1760. Accept: application/sdp;level=1, application/x-private, text/html
  1761. 6.8 Accept-Encoding
  1762. The Accept-Encoding request-header field is similar to Accept, but
  1763. restricts the content-codings [H3.4.1] that are acceptable in the
  1764. response. See [H14.3]. The syntax of this header is defined in
  1765. [H14.3]. The semantics in SIP are identical to those defined in
  1766. [H14.3].
  1767. Handley, et al. Standards Track [Page 44]
  1768. RFC 2543 SIP: Session Initiation Protocol March 1999
  1769. 6.9 Accept-Language
  1770. The Accept-Language header follows the syntax defined in [H14.4]. The
  1771. rules for ordering the languages based on the q parameter apply to
  1772. SIP as well. When used in SIP, the Accept-Language request-header
  1773. field can be used to allow the client to indicate to the server in
  1774. which language it would prefer to receive reason phrases, session
  1775. descriptions or status responses carried as message bodies. A proxy
  1776. MAY use this field to help select the destination for the call, for
  1777. example, a human operator conversant in a language spoken by the
  1778. caller.
  1779. Example:
  1780. Accept-Language: da, en-gb;q=0.8, en;q=0.7
  1781. 6.10 Allow
  1782. The Allow entity-header field lists the set of methods supported by
  1783. the resource identified by the Request-URI. The purpose of this field
  1784. is strictly to inform the recipient of valid methods associated with
  1785. the resource. An Allow header field MUST be present in a 405 (Method
  1786. Not Allowed) response and SHOULD be present in an OPTIONS response.
  1787. Allow = "Allow" ":" 1#Method
  1788. 6.11 Authorization
  1789. A user agent that wishes to authenticate itself with a server --
  1790. usually, but not necessarily, after receiving a 401 response -- MAY
  1791. do so by including an Authorization request-header field with the
  1792. request. The Authorization field value consists of credentials
  1793. containing the authentication information of the user agent for the
  1794. realm of the resource being requested.
  1795. Section 13.2 overviews the use of the Authorization header, and
  1796. section 15 describes the syntax and semantics when used with PGP
  1797. based authentication.
  1798. Handley, et al. Standards Track [Page 45]
  1799. RFC 2543 SIP: Session Initiation Protocol March 1999
  1800. 6.12 Call-ID
  1801. The Call-ID general-header field uniquely identifies a particular
  1802. invitation or all registrations of a particular client. Note that a
  1803. single multimedia conference can give rise to several calls with
  1804. different Call-IDs, e.g., if a user invites a single individual
  1805. several times to the same (long-running) conference.
  1806. For an INVITE request, a callee user agent server SHOULD NOT alert
  1807. the user if the user has responded previously to the Call-ID in the
  1808. INVITE request. If the user is already a member of the conference and
  1809. the conference parameters contained in the session description have
  1810. not changed, a callee user agent server MAY silently accept the call,
  1811. regardless of the Call-ID. An invitation for an existing Call-ID or
  1812. session can change the parameters of the conference. A client
  1813. application MAY decide to simply indicate to the user that the
  1814. conference parameters have been changed and accept the invitation
  1815. automatically or it MAY require user confirmation.
  1816. A user may be invited to the same conference or call using several
  1817. different Call-IDs. If desired, the client MAY use identifiers within
  1818. the session description to detect this duplication. For example, SDP
  1819. contains a session id and version number in the origin (o) field.
  1820. The REGISTER and OPTIONS methods use the Call-ID value to
  1821. unambiguously match requests and responses. All REGISTER requests
  1822. issued by a single client SHOULD use the same Call-ID, at least
  1823. within the same boot cycle.
  1824. Since the Call-ID is generated by and for SIP, there is no
  1825. reason to deal with the complexity of URL-encoding and
  1826. case-ignoring string comparison.
  1827. Call-ID = ( "Call-ID" | "i" ) ":" local-id "@" host
  1828. local-id = 1*uric
  1829. "host" SHOULD be either a fully qualified domain name or a globally
  1830. routable IP address. If this is the case, the "local-id" SHOULD be an
  1831. identifier consisting of URI characters that is unique within "host".
  1832. Use of cryptographically random identifiers [27] is RECOMMENDED. If,
  1833. however, host is not an FQDN or globally routable IP address (such as
  1834. a net 10 address), the local-id MUST be globally unique, as opposed
  1835. Handley, et al. Standards Track [Page 46]
  1836. RFC 2543 SIP: Session Initiation Protocol March 1999
  1837. to unique within host. These rules guarantee overall global
  1838. uniqueness of the Call-ID. The value for Call-ID MUST NOT be reused
  1839. for a different call. Call-IDs are case-sensitive.
  1840. Using cryptographically random identifiers provides some
  1841. protection against session hijacking. Call-ID, To and From
  1842. are needed to identify a call leg. The distinction between
  1843. call and call leg matters in calls with third-party
  1844. control.
  1845. For systems which have tight bandwidth constraints, many of the
  1846. mandatory SIP headers have a compact form, as discussed in Section 9.
  1847. These are alternate names for the headers which occupy less space in
  1848. the message. In the case of Call-ID, the compact form is i.
  1849. For example, both of the following are valid:
  1850. Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com
  1851. or
  1852. i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@foo.bar.com
  1853. 6.13 Contact
  1854. The Contact general-header field can appear in INVITE, ACK, and
  1855. REGISTER requests, and in 1xx, 2xx, 3xx, and 485 responses. In
  1856. general, it provides a URL where the user can be reached for further
  1857. communications.
  1858. INVITE and ACK requests: INVITE and ACK requests MAY contain Contact
  1859. headers indicating from which location the request is
  1860. originating.
  1861. This allows the callee to send future requests, such as
  1862. BYE, directly to the caller instead of through a series of
  1863. proxies. The Via header is not sufficient since the
  1864. desired address may be that of a proxy.
  1865. INVITE 2xx responses: A user agent server sending a definitive,
  1866. positive response (2xx) MAY insert a Contact response header
  1867. field indicating the SIP address under which it is reachable
  1868. most directly for future SIP requests, such as ACK, within the
  1869. Handley, et al. Standards Track [Page 47]
  1870. RFC 2543 SIP: Session Initiation Protocol March 1999
  1871. same Call-ID. The Contact header field contains the address of
  1872. the server itself or that of a proxy, e.g., if the host is
  1873. behind a firewall. The value of this Contact header is copied
  1874. into the Request-URI of subsequent requests for this call if the
  1875. response did not also contain a Record-Route header. If the
  1876. response also contains a Record-Route header field, the address
  1877. in the Contact header field is added as the last item in the
  1878. Route header field. See Section 6.29 for details.
  1879. The Contact value SHOULD NOT be cached across calls, as it
  1880. may not represent the most desirable location for a
  1881. particular destination address.
  1882. INVITE 1xx responses: A UAS sending a provisional response (1xx) MAY
  1883. insert a Contact response header. It has the same semantics in a
  1884. 1xx response as a 2xx INVITE response. Note that CANCEL requests
  1885. MUST NOT be sent to that address, but rather follow the same
  1886. path as the original request.
  1887. REGISTER requests: REGISTER requests MAY contain a Contact header
  1888. field indicating at which locations the user is reachable. The
  1889. REGISTER request defines a wildcard Contact field, "*", which
  1890. MUST only be used with Expires: 0 to remove all registrations
  1891. for a particular user. An optional "expires" parameter indicates
  1892. the desired expiration time of the registration. If a Contact
  1893. entry does not have an "expires" parameter, the Expires header
  1894. field is used as the default value. If neither of these
  1895. mechanisms is used, SIP URIs are assumed to expire after one
  1896. hour. Other URI schemes have no expiration times.
  1897. REGISTER 2xx responses: A REGISTER response MAY return all locations
  1898. at which the user is currently reachable. An optional "expires"
  1899. parameter indicates the expiration time of the registration. If
  1900. a Contact entry does not have an "expires" parameter, the value
  1901. of the Expires header field indicates the expiration time. If
  1902. neither mechanism is used, the expiration time specified in the
  1903. request, explicitly or by default, is used.
  1904. 3xx and 485 responses: The Contact response-header field can be used
  1905. with a 3xx or 485 (Ambiguous) response codes to indicate one or
  1906. more alternate addresses to try. It can appear in responses to
  1907. BYE, INVITE and OPTIONS methods. The Contact header field
  1908. contains URIs giving the new locations or user names to try, or
  1909. may simply specify additional transport parameters. A 300
  1910. (Multiple Choices), 301 (Moved Permanently), 302 (Moved
  1911. Temporarily) or 485 (Ambiguous) response SHOULD contain a
  1912. Contact field containing URIs of new addresses to be tried. A
  1913. Handley, et al. Standards Track [Page 48]
  1914. RFC 2543 SIP: Session Initiation Protocol March 1999
  1915. 301 or 302 response may also give the same location and username
  1916. that was being tried but specify additional transport parameters
  1917. such as a different server or multicast address to try or a
  1918. change of SIP transport from UDP to TCP or vice versa. The
  1919. client copies the "user", "password", "host", "port" and "user-
  1920. param" elements of the Contact URI into the Request-URI of the
  1921. redirected request and directs the request to the address
  1922. specified by the "maddr" and "port" parameters, using the
  1923. transport protocol given in the "transport" parameter. If
  1924. "maddr" is a multicast address, the value of "ttl" is used as
  1925. the time-to-live value.
  1926. Note that the Contact header field MAY also refer to a different
  1927. entity than the one originally called. For example, a SIP call
  1928. connected to GSTN gateway may need to deliver a special information
  1929. announcement such as "The number you have dialed has been changed."
  1930. A Contact response header field can contain any suitable URI
  1931. indicating where the called party can be reached, not limited to SIP
  1932. URLs. For example, it could contain URL's for phones, fax, or irc (if
  1933. they were defined) or a mailto: (RFC 2368, [28]) URL.
  1934. The following parameters are defined. Additional parameters may be
  1935. defined in other specifications.
  1936. q: The "qvalue" indicates the relative preference among the locations
  1937. given. "qvalue" values are decimal numbers from 0 to 1, with
  1938. higher values indicating higher preference.
  1939. action: The "action" parameter is used only when registering with the
  1940. REGISTER request. It indicates whether the client wishes that
  1941. the server proxy or redirect future requests intended for the
  1942. client. If this parameter is not specified the action taken
  1943. depends on server configuration. In its response, the registrar
  1944. SHOULD indicate the mode used. This parameter is ignored for
  1945. other requests.
  1946. expires: The "expires" parameter indicates how long the URI is valid.
  1947. The parameter is either a number indicating seconds or a quoted
  1948. string containing a SIP-date. If this parameter is not provided,
  1949. the value of the Expires header field determines how long the
  1950. URI is valid. Implementations MAY treat values larger than
  1951. 2**32-1 (4294967295 seconds or 136 years) as equivalent to
  1952. 2**32-1.
  1953. Contact = ( "Contact" | "m" ) ":"
  1954. ("*" | (1# (( name-addr | addr-spec )
  1955. [ *( ";" contact-params ) ] [ comment ] )))
  1956. name-addr = [ display-name ] "<" addr-spec ">"
  1957. addr-spec = SIP-URL | URI
  1958. display-name = *token | quoted-string
  1959. contact-params = "q" "=" qvalue
  1960. | "action" "=" "proxy" | "redirect"
  1961. | "expires" "=" delta-seconds | <"> SIP-date <">
  1962. | extension-attribute
  1963. extension-attribute = extension-name [ "=" extension-value ]
  1964. only allows one address, unquoted. Since URIs can contain
  1965. commas and semicolons as reserved characters, they can be
  1966. mistaken for header or parameter delimiters, respectively.
  1967. The current syntax corresponds to that for the To and From
  1968. header, which also allows the use of display names.
  1969. Example:
  1970. Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com>
  1971. ;q=0.7; expires=3600,
  1972. "Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1
  1973. 6.14 Content-Encoding
  1974. Content-Encoding = ( "Content-Encoding" | "e" ) ":"
  1975. 1#content-coding
  1976. The Content-Encoding entity-header field is used as a modifier to the
  1977. "media-type". When present, its value indicates what additional
  1978. content codings have been applied to the entity-body, and thus what
  1979. decoding mechanisms MUST be applied in order to obtain the media-type
  1980. referenced by the Content-Type header field. Content-Encoding is
  1981. primarily used to allow a body to be compressed without losing the
  1982. identity of its underlying media type.
  1983. If multiple encodings have been applied to an entity, the content
  1984. codings MUST be listed in the order in which they were applied.
  1985. All content-coding values are case-insensitive. The Internet Assigned
  1986. Numbers Authority (IANA) acts as a registry for content-coding value
  1987. tokens. See [3.5] for a definition of the syntax for content-coding.
  1988. Clients MAY apply content encodings to the body in requests. If the
  1989. server is not capable of decoding the body, or does not recognize any
  1990. of the content-coding values, it MUST send a 415 "Unsupported Media
  1991. Type" response, listing acceptable encodings in the Accept-Encoding
  1992. Handley, et al. Standards Track [Page 50]
  1993. RFC 2543 SIP: Session Initiation Protocol March 1999
  1994. header. A server MAY apply content encodings to the bodies in
  1995. responses. The server MUST only use encodings listed in the Accept-
  1996. Encoding header in the request.
  1997. 6.15 Content-Length
  1998. The Content-Length entity-header field indicates the size of the
  1999. message-body, in decimal number of octets, sent to the recipient.
  2000. Content-Length = ( "Content-Length" | "l" ) ":" 1*DIGIT
  2001. An example is
  2002. Content-Length: 3495
  2003. Applications SHOULD use this field to indicate the size of the
  2004. message-body to be transferred, regardless of the media type of the
  2005. entity. Any Content-Length greater than or equal to zero is a valid
  2006. value. If no body is present in a message, then the Content-Length
  2007. header field MUST be set to zero. If a server receives a UDP request
  2008. without Content-Length, it MUST assume that the request encompasses
  2009. the remainder of the packet. If a server receives a UDP request with
  2010. a Content-Length, but the value is larger than the size of the body
  2011. sent in the request, the client SHOULD generate a 400 class response.
  2012. If there is additional data in the UDP packet after the last byte of
  2013. the body has been read, the server MUST treat the remaining data as a
  2014. separate message. This allows several messages to be placed in a
  2015. single UDP packet.
  2016. If a response does not contain a Content-Length, the client assumes
  2017. that it encompasses the remainder of the UDP packet or the data until
  2018. the TCP connection is closed, as applicable. Section 8 describes how
  2019. to determine the length of the message body.
  2020. 6.16 Content-Type
  2021. The Content-Type entity-header field indicates the media type of the
  2022. message-body sent to the recipient. The "media-type" element is
  2023. defined in [H3.7].
  2024. Content-Type = ( "Content-Type" | "c" ) ":" media-type
  2025. Handley, et al. Standards Track [Page 51]
  2026. RFC 2543 SIP: Session Initiation Protocol March 1999
  2027. Examples of this header field are
  2028. Content-Type: application/sdp
  2029. Content-Type: text/html; charset=ISO-8859-4
  2030. 6.17 CSeq
  2031. Clients MUST add the CSeq (command sequence) general-header field to
  2032. every request. A CSeq header field in a request contains the request
  2033. method and a single decimal sequence number chosen by the requesting
  2034. client, unique within a single value of Call-ID. The sequence number
  2035. MUST be expressible as a 32-bit unsigned integer. The initial value
  2036. of the sequence number is arbitrary, but MUST be less than 2**31.
  2037. Consecutive requests that differ in request method, headers or body,
  2038. but have the same Call-ID MUST contain strictly monotonically
  2039. increasing and contiguous sequence numbers; sequence numbers do not
  2040. wrap around. Retransmissions of the same request carry the same
  2041. sequence number, but an INVITE with a different message body or
  2042. different header fields (a "re-invitation") acquires a new, higher
  2043. sequence number. A server MUST echo the CSeq value from the request
  2044. in its response. If the Method value is missing in the received CSeq
  2045. header field, the server fills it in appropriately.
  2046. The ACK and CANCEL requests MUST contain the same CSeq value as the
  2047. INVITE request that it refers to, while a BYE request cancelling an
  2048. invitation MUST have a higher sequence number. A BYE request with a
  2049. CSeq that is not higher should cause a 400 response to be generated.
  2050. A user agent server MUST remember the highest sequence number for any
  2051. INVITE request with the same Call-ID value. The server MUST respond
  2052. to, and then discard, any INVITE request with a lower sequence
  2053. number.
  2054. All requests spawned in a parallel search have the same CSeq value as
  2055. the request triggering the parallel search.
  2056. CSeq = "CSeq" ":" 1*DIGIT Method
  2057. Strictly speaking, CSeq header fields are needed for any
  2058. SIP request that can be cancelled by a BYE or CANCEL
  2059. request or where a client can issue several requests for
  2060. the same Call-ID in close succession. Without a sequence
  2061. Handley, et al. Standards Track [Page 52]
  2062. RFC 2543 SIP: Session Initiation Protocol March 1999
  2063. number, the response to an INVITE could be mistaken for the
  2064. response to the cancellation (BYE or CANCEL). Also, if the
  2065. network duplicates packets or if an ACK is delayed until
  2066. the server has sent an additional response, the client
  2067. could interpret an old response as the response to a re-
  2068. invitation issued shortly thereafter. Using CSeq also makes
  2069. it easy for the server to distinguish different versions of
  2070. an invitation, without comparing the message body.
  2071. The Method value allows the client to distinguish the response to an
  2072. INVITE request from that of a CANCEL response. CANCEL requests can be
  2073. generated by proxies; if they were to increase the sequence number,
  2074. it might conflict with a later request issued by the user agent for
  2075. the same call.
  2076. With a length of 32 bits, a server could generate, within a single
  2077. call, one request a second for about 136 years before needing to wrap
  2078. around. The initial value of the sequence number is chosen so that
  2079. subsequent requests within the same call will not wrap around. A
  2080. non-zero initial value allows to use a time-based initial sequence
  2081. number, if the client desires. A client could, for example, choose
  2082. the 31 most significant bits of a 32-bit second clock as an initial
  2083. sequence number.
  2084. Forked requests MUST have the same CSeq as there would be ambiguity
  2085. otherwise between these forked requests and later BYE issued by the
  2086. client user agent.
  2087. Example:
  2088. CSeq: 4711 INVITE
  2089. 6.18 Date
  2090. Date is a general-header field. Its syntax is:
  2091. SIP-date = rfc1123-date
  2092. See [H14.19] for a definition of rfc1123-date. Note that unlike
  2093. HTTP/1.1, SIP only supports the most recent RFC1123 [29] formatting
  2094. for dates.
  2095. Handley, et al. Standards Track [Page 53]
  2096. RFC 2543 SIP: Session Initiation Protocol March 1999
  2097. The Date header field reflects the time when the request or response
  2098. is first sent. Thus, retransmissions have the same Date header field
  2099. value as the original.
  2100. The Date header field can be used by simple end systems
  2101. without a battery-backed clock to acquire a notion of
  2102. current time.
  2103. 6.19 Encryption
  2104. The Encryption general-header field specifies that the content has
  2105. been encrypted. Section 13 describes the overall SIP security
  2106. architecture and algorithms. This header field is intended for end-
  2107. to-end encryption of requests and responses. Requests are encrypted
  2108. based on the public key belonging to the entity named in the To
  2109. header field. Responses are encrypted based on the public key
  2110. conveyed in the Response-Key header field. Note that the public keys
  2111. themselves may not be used for the encryption. This depends on the
  2112. particular algorithms used.
  2113. For any encrypted message, at least the message body and possibly
  2114. other message header fields are encrypted. An application receiving a
  2115. request or response containing an Encryption header field decrypts
  2116. the body and then concatenates the plaintext to the request line and
  2117. headers of the original message. Message headers in the decrypted
  2118. part completely replace those with the same field name in the
  2119. plaintext part. (Note: If only the body of the message is to be
  2120. encrypted, the body has to be prefixed with CRLF to allow proper
  2121. concatenation.) Note that the request method and Request-URI cannot
  2122. be encrypted.
  2123. Encryption only provides privacy; the recipient has no
  2124. guarantee that the request or response came from the party
  2125. listed in the From message header, only that the sender
  2126. used the recipient's public key. However, proxies will not
  2127. be able to modify the request or response.
  2128. Encryption = "Encryption" ":" encryption-scheme 1*SP
  2129. #encryption-params
  2130. encryption-scheme = token
  2131. encryption-params = token "=" ( token | quoted-string )
  2132. The token indicates the form of encryption used; it is
  2133. described in section 13.
  2134. Handley, et al. Standards Track [Page 54]
  2135. RFC 2543 SIP: Session Initiation Protocol March 1999
  2136. The example in Figure 10 shows a message encrypted with ASCII-armored
  2137. PGP that was generated by applying "pgp -ea" to the payload to be
  2138. encrypted.
  2139. INVITE sip:watson@boston.bell-telephone.com SIP/2.0
  2140. Via: SIP/2.0/UDP 169.130.12.5
  2141. From: <sip:a.g.bell@bell-telephone.com>
  2142. To: T. A. Watson <sip:watson@bell-telephone.com>
  2143. Call-ID: 187602141351@worcester.bell-telephone.com
  2144. Content-Length: 885
  2145. Encryption: PGP version=2.6.2,encoding=ascii
  2146. hQEMAxkp5GPd+j5xAQf/ZDIfGD/PDOM1wayvwdQAKgGgjmZWe+MTy9NEX8O25Red
  2147. h0/pyrd/+DV5C2BYs7yzSOSXaj1C/tTK/4do6rtjhP8QA3vbDdVdaFciwEVAcuXs
  2148. ODxlNAVqyDi1RqFC28BJIvQ5KfEkPuACKTK7WlRSBc7vNPEA3nyqZGBTwhxRSbIR
  2149. RuFEsHSVojdCam4htcqxGnFwD9sksqs6LIyCFaiTAhWtwcCaN437G7mUYzy2KLcA
  2150. zPVGq1VQg83b99zPzIxRdlZ+K7+bAnu8Rtu+ohOCMLV3TPXbyp+err1YiThCZHIu
  2151. X9dOVj3CMjCP66RSHa/ea0wYTRRNYA/G+kdP8DSUcqYAAAE/hZPX6nFIqk7AVnf6
  2152. IpWHUPTelNUJpzUp5Ou+q/5P7ZAsn+cSAuF2YWtVjCf+SQmBR13p2EYYWHoxlA2/
  2153. GgKADYe4M3JSwOtqwU8zUJF3FIfk7vsxmSqtUQrRQaiIhqNyG7KxJt4YjWnEjF5E
  2154. WUIPhvyGFMJaeQXIyGRYZAYvKKklyAJcm29zLACxU5alX4M25lHQd9FR9Zmq6Jed
  2155. wbWvia6cAIfsvlZ9JGocmQYF7pcuz5pnczqP+/yvRqFJtDGD/v3s++G2R+ViVYJO
  2156. z/lxGUZaM4IWBCf+4DUjNanZM0oxAE28NjaIZ0rrldDQmO8V9FtPKdHxkqA5iJP+
  2157. 6vGOFti1Ak4kmEz0vM/Nsv7kkubTFhRl05OiJIGr9S1UhenlZv9l6RuXsOY/EwH2
  2158. z8X9N4MhMyXEVuC9rt8/AUhmVQ==
  2159. =bOW+
  2160. Figure 10: PGP Encryption Example
  2161. Since proxies can base their forwarding decision on any combination
  2162. of SIP header fields, there is no guarantee that an encrypted request
  2163. "hiding" header fields will reach the same destination as an
  2164. otherwise identical un-encrypted request.
  2165. 6.20 Expires
  2166. The Expires entity-header field gives the date and time after which
  2167. the message content expires.
  2168. This header field is currently defined only for the REGISTER and
  2169. INVITE methods. For REGISTER, it is a request and response-header
  2170. field. In a REGISTER request, the client indicates how long it wishes
  2171. the registration to be valid. In the response, the server indicates
  2172. Handley, et al. Standards Track [Page 55]
  2173. RFC 2543 SIP: Session Initiation Protocol March 1999
  2174. the earliest expiration time of all registrations. The server MAY
  2175. choose a shorter time interval than that requested by the client, but
  2176. SHOULD NOT choose a longer one.
  2177. For INVITE requests, it is a request and response-header field. In a
  2178. request, the caller can limit the validity of an invitation, for
  2179. example, if a client wants to limit the time duration of a search or
  2180. a conference invitation. A user interface MAY take this as a hint to
  2181. leave the invitation window on the screen even if the user is not
  2182. currently at the workstation. This also limits the duration of a
  2183. search. If the request expires before the search completes, the proxy
  2184. returns a 408 (Request Timeout) status. In a 302 (Moved Temporarily)
  2185. response, a server can advise the client of the maximal duration of
  2186. the redirection.
  2187. The value of this field can be either a SIP-date or an integer number
  2188. of seconds (in decimal), measured from the receipt of the request.
  2189. The latter approach is preferable for short durations, as it does not
  2190. depend on clients and servers sharing a synchronized clock.
  2191. Implementations MAY treat values larger than 2**32-1 (4294967295 or
  2192. 136 years) as equivalent to 2**32-1.
  2193. Expires = "Expires" ":" ( SIP-date | delta-seconds )
  2194. Two examples of its use are
  2195. Expires: Thu, 01 Dec 1994 16:00:00 GMT
  2196. Expires: 5
  2197. 6.21 From
  2198. Requests and responses MUST contain a From general-header field,
  2199. indicating the initiator of the request. The From field MAY contain
  2200. the "tag" parameter. The server copies the From header field from the
  2201. request to the response. The optional "display-name" is meant to be
  2202. rendered by a human-user interface. A system SHOULD use the display
  2203. name "Anonymous" if the identity of the client is to remain hidden.
  2204. The SIP-URL MUST NOT contain the "transport-param", "maddr-param",
  2205. "ttl-param", or "headers" elements. A server that receives a SIP-URL
  2206. with these elements removes them before further processing.
  2207. Handley, et al. Standards Track [Page 56]
  2208. RFC 2543 SIP: Session Initiation Protocol March 1999
  2209. Even if the "display-name" is empty, the "name-addr" form MUST be
  2210. used if the "addr-spec" contains a comma, question mark, or
  2211. semicolon.
  2212. From = ( "From" | "f" ) ":" ( name-addr | addr-spec )
  2213. *( ";" addr-params )
  2214. addr-params = tag-param
  2215. tag-param = "tag=" UUID
  2216. UUID = 1*( hex | "-" )
  2217. Examples:
  2218. From: "A. G. Bell" <sip:agb@bell-telephone.com>
  2219. From: sip:+12125551212@server.phone2net.com
  2220. From: Anonymous <sip:c8oqz84zk7z@privacy.org>
  2221. The "tag" MAY appear in the From field of a request. It MUST be
  2222. present when it is possible that two instances of a user sharing a
  2223. SIP address can make call invitations with the same Call-ID.
  2224. The "tag" value MUST be globally unique and cryptographically random
  2225. with at least 32 bits of randomness. A single user maintains the same
  2226. tag throughout the call identified by the Call-ID.
  2227. Call-ID, To and From are needed to identify a call leg.
  2228. The distinction between call and call leg matters in calls
  2229. with multiple responses to a forked request. The format is
  2230. similar to the equivalent RFC 822 [24] header, but with a
  2231. URI instead of just an email address.
  2232. 6.22 Hide
  2233. A client uses the Hide request header field to indicate that it wants
  2234. the path comprised of the Via header fields (Section 6.40) to be
  2235. hidden from subsequent proxies and user agents. It can take two
  2236. forms: Hide: route and Hide: hop. Hide header fields are typically
  2237. added by the client user agent, but MAY be added by any proxy along
  2238. the path.
  2239. Handley, et al. Standards Track [Page 57]
  2240. RFC 2543 SIP: Session Initiation Protocol March 1999
  2241. If a request contains the "Hide: route" header field, all following
  2242. proxies SHOULD hide their previous hop. If a request contains the
  2243. "Hide: hop" header field, only the next proxy SHOULD hide the
  2244. previous hop and then remove the Hide option unless it also wants to
  2245. remain anonymous.
  2246. A server hides the previous hop by encrypting the "host" and "port"
  2247. parts of the top-most Via header field with an algorithm of its
  2248. choice. Servers SHOULD add additional "salt" to the "host" and "port"
  2249. information prior to encryption to prevent malicious downstream
  2250. proxies from guessing earlier parts of the path based on seeing
  2251. identical encrypted Via headers. Hidden Via fields are marked with
  2252. the "hidden" Via option, as described in Section 6.40.
  2253. A server that is capable of hiding Via headers MUST attempt to
  2254. decrypt all Via headers marked as "hidden" to perform loop detection.
  2255. Servers that are not capable of hiding can ignore hidden Via fields
  2256. in their loop detection algorithm.
  2257. If hidden headers were not marked, a proxy would have to
  2258. decrypt all headers to detect loops, just in case one was
  2259. encrypted, as the Hide: Hop option may have been removed
  2260. along the way.
  2261. A host MUST NOT add such a "Hide: hop" header field unless it can
  2262. guarantee it will only send a request for this destination to the
  2263. same next hop. The reason for this is that it is possible that the
  2264. request will loop back through this same hop from a downstream proxy.
  2265. The loop will be detected by the next hop if the choice of next hop
  2266. is fixed, but could loop an arbitrary number of times otherwise.
  2267. A client requesting "Hide: route" can only rely on keeping the
  2268. request path private if it sends the request to a trusted proxy.
  2269. Hiding the route of a SIP request is of limited value if the request
  2270. results in data packets being exchanged directly between the calling
  2271. and called user agent.
  2272. The use of Hide header fields is discouraged unless path privacy is
  2273. truly needed; Hide fields impose extra processing costs and
  2274. restrictions for proxies and can cause requests to generate 482 (Loop
  2275. Detected) responses that could otherwise be avoided.
  2276. The encryption of Via header fields is described in more detail in
  2277. Section 13.
  2278. The Hide header field has the following syntax:
  2279. Handley, et al. Standards Track [Page 58]
  2280. RFC 2543 SIP: Session Initiation Protocol March 1999
  2281. Hide = "Hide" ":" ( "route" | "hop" )
  2282. 6.23 Max-Forwards
  2283. The Max-Forwards request-header field may be used with any SIP method
  2284. to limit the number of proxies or gateways that can forward the
  2285. request to the next downstream server. This can also be useful when
  2286. the client is attempting to trace a request chain which appears to be
  2287. failing or looping in mid-chain.
  2288. Max-Forwards = "Max-Forwards" ":" 1*DIGIT
  2289. The Max-Forwards value is a decimal integer indicating the remaining
  2290. number of times this request message is allowed to be forwarded.
  2291. Each proxy or gateway recipient of a request containing a Max-
  2292. Forwards header field MUST check and update its value prior to
  2293. forwarding the request. If the received value is zero (0), the
  2294. recipient MUST NOT forward the request. Instead, for the OPTIONS and
  2295. REGISTER methods, it MUST respond as the final recipient. For all
  2296. other methods, the server returns 483 (Too many hops).
  2297. If the received Max-Forwards value is greater than zero, then the
  2298. forwarded message MUST contain an updated Max-Forwards field with a
  2299. value decremented by one (1).
  2300. Example:
  2301. Max-Forwards: 6
  2302. 6.24 Organization
  2303. The Organization general-header field conveys the name of the
  2304. organization to which the entity issuing the request or response
  2305. belongs. It MAY also be inserted by proxies at the boundary of an
  2306. organization.
  2307. The field MAY be used by client software to filter calls.
  2308. Handley, et al. Standards Track [Page 59]
  2309. RFC 2543 SIP: Session Initiation Protocol March 1999
  2310. Organization = "Organization" ":" *TEXT-UTF8
  2311. 6.25 Priority
  2312. The Priority request-header field indicates the urgency of the
  2313. request as perceived by the client.
  2314. Priority = "Priority" ":" priority-value
  2315. priority-value = "emergency" | "urgent" | "normal"
  2316. | "non-urgent"
  2317. It is RECOMMENDED that the value of "emergency" only be used when
  2318. life, limb or property are in imminent danger.
  2319. Examples:
  2320. Subject: A tornado is heading our way!
  2321. Priority: emergency
  2322. Subject: Weekend plans
  2323. Priority: non-urgent
  2324. These are the values of RFC 2076 [30], with the addition of
  2325. "emergency".
  2326. 6.26 Proxy-Authenticate
  2327. The Proxy-Authenticate response-header field MUST be included as part
  2328. of a 407 (Proxy Authentication Required) response. The field value
  2329. consists of a challenge that indicates the authentication scheme and
  2330. parameters applicable to the proxy for this Request-URI.
  2331. Unlike its usage within HTTP, the Proxy-Authenticate header MUST be
  2332. passed upstream in the response to the UAC. In SIP, only UAC's can
  2333. authenticate themselves to proxies.
  2334. The syntax for this header is defined in [H14.33]. See 14 for further
  2335. details on its usage.
  2336. Handley, et al. Standards Track [Page 60]
  2337. RFC 2543 SIP: Session Initiation Protocol March 1999
  2338. A client SHOULD cache the credentials used for a particular proxy
  2339. server and realm for the next request to that server. Credentials
  2340. are, in general, valid for a specific value of the Request-URI at a
  2341. particular proxy server. If a client contacts a proxy server that has
  2342. required authentication in the past, but the client does not have
  2343. credentials for the particular Request-URI, it MAY attempt to use the
  2344. most-recently used credential. The server responds with 401
  2345. (Unauthorized) if the client guessed wrong.
  2346. This suggested caching behavior is motivated by proxies
  2347. restricting phone calls to authenticated users. It seems
  2348. likely that in most cases, all destinations require the
  2349. same password. Note that end-to-end authentication is
  2350. likely to be destination-specific.
  2351. 6.27 Proxy-Authorization
  2352. The Proxy-Authorization request-header field allows the client to
  2353. identify itself (or its user) to a proxy which requires
  2354. authentication. The Proxy-Authorization field value consists of
  2355. credentials containing the authentication information of the user
  2356. agent for the proxy and/or realm of the resource being requested.
  2357. Unlike Authorization, the Proxy-Authorization header field applies
  2358. only to the next outbound proxy that demanded authentication using
  2359. the Proxy- Authenticate field. When multiple proxies are used in a
  2360. chain, the Proxy-Authorization header field is consumed by the first
  2361. outbound proxy that was expecting to receive credentials. A proxy MAY
  2362. relay the credentials from the client request to the next proxy if
  2363. that is the mechanism by which the proxies cooperatively authenticate
  2364. a given request.
  2365. See [H14.34] for a definition of the syntax, and section 14 for a
  2366. discussion of its usage.
  2367. 6.28 Proxy-Require
  2368. The Proxy-Require header field is used to indicate proxy-sensitive
  2369. features that MUST be supported by the proxy. Any Proxy-Require
  2370. header field features that are not supported by the proxy MUST be
  2371. negatively acknowledged by the proxy to the client if not supported.
  2372. Proxy servers treat this field identically to the Require field.
  2373. See Section 6.30 for more details on the mechanics of this message
  2374. and a usage example.
  2375. Handley, et al. Standards Track [Page 61]
  2376. RFC 2543 SIP: Session Initiation Protocol March 1999
  2377. 6.29 Record-Route
  2378. The Record-Route request and response header field is added to a
  2379. request by any proxy that insists on being in the path of subsequent
  2380. requests for the same call leg. It contains a globally reachable
  2381. Request-URI that identifies the proxy server. Each proxy server adds
  2382. its Request-URI to the beginning of the list.
  2383. The server copies the Record-Route header field unchanged into the
  2384. response. (Record-Route is only relevant for 2xx responses.)
  2385. The calling user agent client copies the Record-Route header into a
  2386. Route header field of subsequent requests within the same call leg,
  2387. reversing the order of requests, so that the first entry is closest
  2388. to the user agent client. If the response contained a Contact header
  2389. field, the calling user agent adds its content as the last Route
  2390. header. Unless this would cause a loop, any client MUST send any
  2391. subsequent requests for this call leg to the first Request-URI in the
  2392. Route request header field and remove that entry.
  2393. The calling user agent MUST NOT use the Record-Route header field in
  2394. requests that contain Route header fields.
  2395. Some proxies, such as those controlling firewalls or in an
  2396. automatic call distribution (ACD) system, need to maintain
  2397. call state and thus need to receive any BYE and ACK packets
  2398. for the call.
  2399. The Record-Route header field has the following syntax:
  2400. Record-Route = "Record-Route" ":" 1# name-addr
  2401. Proxy servers SHOULD use the "maddr" URL parameter containing their
  2402. address to ensure that subsequent requests are guaranteed to reach
  2403. exactly the same server.
  2404. Example for a request that has traversed the hosts ieee.org and
  2405. bell-telephone.com , in that order:
  2406. Record-Route: <sip:a.g.bell@bell-telephone.com>,
  2407. <sip:a.bell@ieee.org>
  2408. Handley, et al. Standards Track [Page 62]
  2409. RFC 2543 SIP: Session Initiation Protocol March 1999
  2410. 6.30 Require
  2411. The Require request-header field is used by clients to tell user
  2412. agent servers about options that the client expects the server to
  2413. support in order to properly process the request. If a server does
  2414. not understand the option, it MUST respond by returning status code
  2415. 420 (Bad Extension) and list those options it does not understand in
  2416. the Unsupported header.
  2417. Require = "Require" ":" 1#option-tag
  2418. Example:
  2419. C->S: INVITE sip:watson@bell-telephone.com SIP/2.0
  2420. Require: com.example.billing
  2421. Payment: sheep_skins, conch_shells
  2422. S->C: SIP/2.0 420 Bad Extension
  2423. Unsupported: com.example.billing
  2424. This is to make sure that the client-server interaction
  2425. will proceed without delay when all options are understood
  2426. by both sides, and only slow down if options are not
  2427. understood (as in the example above). For a well-matched
  2428. client-server pair, the interaction proceeds quickly,
  2429. saving a round-trip often required by negotiation
  2430. mechanisms. In addition, it also removes ambiguity when the
  2431. client requires features that the server does not
  2432. understand. Some features, such as call handling fields,
  2433. are only of interest to end systems.
  2434. Proxy and redirect servers MUST ignore features that are not
  2435. understood. If a particular extension requires that intermediate
  2436. devices support it, the extension MUST be tagged in the Proxy-Require
  2437. field as well (see Section 6.28).
  2438. 6.31 Response-Key
  2439. The Response-Key request-header field can be used by a client to
  2440. request the key that the called user agent SHOULD use to encrypt the
  2441. response with. The syntax is:
  2442. Handley, et al. Standards Track [Page 63]
  2443. RFC 2543 SIP: Session Initiation Protocol March 1999
  2444. Response-Key = "Response-Key" ":" key-scheme 1*SP #key-param
  2445. key-scheme = token
  2446. key-param = token "=" ( token | quoted-string )
  2447. The "key-scheme" gives the type of encryption to be used for the
  2448. response. Section 13 describes security schemes.
  2449. If the client insists that the server return an encrypted response,
  2450. it includes a
  2451. Require: org.ietf.sip.encrypt-response
  2452. header field in its request. If the server cannot encrypt for
  2453. whatever reason, it MUST follow normal Require header field
  2454. procedures and return a 420 (Bad Extension) response. If this Require
  2455. header field is not present, a server SHOULD still encrypt if it can.
  2456. 6.32 Retry-After
  2457. The Retry-After general-header field can be used with a 503 (Service
  2458. Unavailable) response to indicate how long the service is expected to
  2459. be unavailable to the requesting client and with a 404 (Not Found),
  2460. 600 (Busy), or 603 (Decline) response to indicate when the called
  2461. party anticipates being available again. The value of this field can
  2462. be either an SIP-date or an integer number of seconds (in decimal)
  2463. after the time of the response.
  2464. A REGISTER request MAY include this header field when deleting
  2465. registrations with "Contact: * ;expires: 0". The Retry-After value
  2466. then indicates when the user might again be reachable. The registrar
  2467. MAY then include this information in responses to future calls.
  2468. An optional comment can be used to indicate additional information
  2469. about the time of callback. An optional "duration" parameter
  2470. indicates how long the called party will be reachable starting at the
  2471. initial time of availability. If no duration parameter is given, the
  2472. service is assumed to be available indefinitely.
  2473. Retry-After = "Retry-After" ":" ( SIP-date | delta-seconds )
  2474. [ comment ] [ ";" "duration" "=" delta-seconds ]
  2475. Examples of its use are
  2476. Retry-After: Mon, 21 Jul 1997 18:48:34 GMT (I'm in a meeting)
  2477. Handley, et al. Standards Track [Page 64]
  2478. RFC 2543 SIP: Session Initiation Protocol March 1999
  2479. Retry-After: Mon, 01 Jan 9999 00:00:00 GMT
  2480. (Dear John: Don't call me back, ever)
  2481. Retry-After: Fri, 26 Sep 1997 21:00:00 GMT;duration=3600
  2482. Retry-After: 120
  2483. In the third example, the callee is reachable for one hour starting
  2484. at 21:00 GMT. In the last example, the delay is 2 minutes.
  2485. 6.33 Route
  2486. The Route request-header field determines the route taken by a
  2487. request. Each host removes the first entry and then proxies the
  2488. request to the host listed in that entry, also using it as the
  2489. Request-URI. The operation is further described in Section 6.29.
  2490. The Route header field has the following syntax:
  2491. Route = "Route" ":" 1# name-addr
  2492. 6.34 Server
  2493. The Server response-header field contains information about the
  2494. software used by the user agent server to handle the request. The
  2495. syntax for this field is defined in [H14.39].
  2496. 6.35 Subject
  2497. This is intended to provide a summary, or to indicate the nature, of
  2498. the call, allowing call filtering without having to parse the session
  2499. description. (Also, the session description does not have to use the
  2500. same subject indication as the invitation.)
  2501. Subject = ( "Subject" | "s" ) ":" *TEXT-UTF8
  2502. Example:
  2503. Subject: Tune in - they are talking about your work!
  2504. Handley, et al. Standards Track [Page 65]
  2505. RFC 2543 SIP: Session Initiation Protocol March 1999
  2506. 6.36 Timestamp
  2507. The timestamp general-header field describes when the client sent the
  2508. request to the server. The value of the timestamp is of significance
  2509. only to the client and it MAY use any timescale. The server MUST echo
  2510. the exact same value and MAY, if it has accurate information about
  2511. this, add a floating point number indicating the number of seconds
  2512. that have elapsed since it has received the request. The timestamp is
  2513. used by the client to compute the round-trip time to the server so
  2514. that it can adjust the timeout value for retransmissions.
  2515. Timestamp = "Timestamp" ":" *(DIGIT) [ "." *(DIGIT) ] [ delay ]
  2516. delay = *(DIGIT) [ "." *(DIGIT) ]
  2517. Note that there MUST NOT be any LWS between a DIGIT and the decimal
  2518. point.
  2519. 6.37 To
  2520. The To general-header field specifies recipient of the request, with
  2521. the same SIP URL syntax as the From field.
  2522. To = ( "To" | "t" ) ":" ( name-addr | addr-spec )
  2523. *( ";" addr-params )
  2524. Requests and responses MUST contain a To general-header field,
  2525. indicating the desired recipient of the request. The optional
  2526. "display-name" is meant to be rendered by a human-user interface.
  2527. The UAS or redirect server copies the To header field into its
  2528. response, and MUST add a "tag" parameter if the request contained
  2529. more than one Via header field.
  2530. If there was more than one Via header field, the request
  2531. was handled by at least one proxy server. Since the
  2532. receiver cannot know whether any of the proxy servers
  2533. forked the request, it is safest to assume that they might
  2534. have.
  2535. The SIP-URL MUST NOT contain the "transport-param", "maddr-param",
  2536. "ttl-param", or "headers" elements. A server that receives a SIP-URL
  2537. with these elements removes them before further processing.
  2538. Handley, et al. Standards Track [Page 66]
  2539. RFC 2543 SIP: Session Initiation Protocol March 1999
  2540. The "tag" parameter serves as a general mechanism to distinguish
  2541. multiple instances of a user identified by a single SIP URL. As
  2542. proxies can fork requests, the same request can reach multiple
  2543. instances of a user (mobile and home phones, for example). As each
  2544. can respond, there needs to be a means to distinguish the responses
  2545. from each at the caller. The situation also arises with multicast
  2546. requests. The tag in the To header field serves to distinguish
  2547. responses at the UAC. It MUST be placed in the To field of the
  2548. response by each instance when there is a possibility that the
  2549. request was forked at an intermediate proxy. The "tag" MUST be added
  2550. by UAS, registrars and redirect servers, but MUST NOT be inserted
  2551. into responses forwarded upstream by proxies. The "tag" is added for
  2552. all definitive responses for all methods, and MAY be added for
  2553. informational responses from a UAS or redirect server. All subsequent
  2554. transactions between two entities MUST include the "tag" parameter,
  2555. as described in Section 11.
  2556. See Section 6.21 for details of the "tag" parameter.
  2557. The "tag" parameter in To headers is ignored when matching responses
  2558. to requests that did not contain a "tag" in their To header.
  2559. A SIP server returns a 400 (Bad Request) response if it receives a
  2560. request with a To header field containing a URI with a scheme it does
  2561. not recognize.
  2562. Even if the "display-name" is empty, the "name-addr" form MUST be
  2563. used if the "addr-spec" contains a comma, question mark, or
  2564. semicolon.
  2565. The following are examples of valid To headers:
  2566. To: The Operator <sip:operator@cs.columbia.edu>;tag=287447
  2567. To: sip:+12125551212@server.phone2net.com
  2568. Call-ID, To and From are needed to identify a call leg.
  2569. The distinction between call and call leg matters in calls
  2570. with multiple responses from a forked request. The "tag" is
  2571. added to the To header field in the response to allow
  2572. forking of future requests for the same call by proxies,
  2573. while addressing only one of the possibly several
  2574. responding user agent servers. It also allows several
  2575. instances of the callee to send requests that can be
  2576. distinguished.
  2577. Handley, et al. Standards Track [Page 67]
  2578. RFC 2543 SIP: Session Initiation Protocol March 1999
  2579. 6.38 Unsupported
  2580. The Unsupported response-header field lists the features not
  2581. supported by the server. See Section 6.30 for a usage example and
  2582. motivation.
  2583. Syntax:
  2584. Unsupported = "Unsupported" ":" 1#option-tag
  2585. 6.39 User-Agent
  2586. The User-Agent general-header field contains information about the
  2587. client user agent originating the request. The syntax and semantics
  2588. are defined in [H14.42].
  2589. 6.40 Via
  2590. The Via field indicates the path taken by the request so far. This
  2591. prevents request looping and ensures replies take the same path as
  2592. the requests, which assists in firewall traversal and other unusual
  2593. routing situations.
  2594. 6.40.1 Requests
  2595. The client originating the request MUST insert into the request a Via
  2596. field containing its host name or network address and, if not the
  2597. default port number, the port number at which it wishes to receive
  2598. responses. (Note that this port number can differ from the UDP source
  2599. port number of the request.) A fully-qualified domain name is
  2600. RECOMMENDED. Each subsequent proxy server that sends the request
  2601. onwards MUST add its own additional Via field before any existing Via
  2602. fields. A proxy that receives a redirection (3xx) response and then
  2603. searches recursively, MUST use the same Via headers as on the
  2604. original proxied request.
  2605. A proxy SHOULD check the top-most Via header field to ensure that it
  2606. contains the sender's correct network address, as seen from that
  2607. proxy. If the sender's address is incorrect, the proxy MUST add an
  2608. additional "received" attribute, as described 6.40.2.
  2609. A host behind a network address translator (NAT) or
  2610. firewall may not be able to insert a network address into
  2611. the Via header that can be reached by the next hop beyond
  2612. Handley, et al. Standards Track [Page 68]
  2613. RFC 2543 SIP: Session Initiation Protocol March 1999
  2614. the NAT. Use of the received attribute allows SIP requests
  2615. to traverse NAT's which only modify the source IP address.
  2616. NAT's which modify port numbers, called Network Address
  2617. Port Translator's (NAPT) will not properly pass SIP when
  2618. transported on UDP, in which case an application layer
  2619. gateway is required. When run over TCP, SIP stands a better
  2620. chance of traversing NAT's, since its behavior is similar
  2621. to HTTP in this case (but of course on different ports).
  2622. A proxy sending a request to a multicast address MUST add the "maddr"
  2623. parameter to its Via header field, and SHOULD add the "ttl"
  2624. parameter. If a server receives a request which contained an "maddr"
  2625. parameter in the topmost Via field, it SHOULD send the response to
  2626. the multicast address listed in the "maddr" parameter.
  2627. If a proxy server receives a request which contains its own address
  2628. in the Via header value, it MUST respond with a 482 (Loop Detected)
  2629. status code.
  2630. A proxy server MUST NOT forward a request to a multicast group which
  2631. already appears in any of the Via headers.
  2632. This prevents a malfunctioning proxy server from causing
  2633. loops. Also, it cannot be guaranteed that a proxy server
  2634. can always detect that the address returned by a location
  2635. service refers to a host listed in the Via list, as a
  2636. single host may have aliases or several network interfaces.
  2637. 6.40.2 Receiver-tagged Via Header Fields
  2638. Normally, every host that sends or forwards a SIP message adds a Via
  2639. field indicating the path traversed. However, it is possible that
  2640. Network Address Translators (NATs) changes the source address and
  2641. port of the request (e.g., from net-10 to a globally routable
  2642. address), in which case the Via header field cannot be relied on to
  2643. route replies. To prevent this, a proxy SHOULD check the top-most Via
  2644. header field to ensure that it contains the sender's correct network
  2645. address, as seen from that proxy. If the sender's address is
  2646. incorrect, the proxy MUST add a "received" parameter to the Via
  2647. header field inserted by the previous hop. Such a modified Via header
  2648. field is known as a receiver-tagged Via header field. An example is:
  2649. Via: SIP/2.0/UDP erlang.bell-telephone.com:5060
  2650. Via: SIP/2.0/UDP 10.0.0.1:5060 ;received=199.172.136.3
  2651. Handley, et al. Standards Track [Page 69]
  2652. RFC 2543 SIP: Session Initiation Protocol March 1999
  2653. In this example, the message originated from 10.0.0.1 and traversed a
  2654. NAT with the external address border.ieee.org (199.172.136.3) to
  2655. reach erlang.bell-telephone.com. The latter noticed the mismatch,
  2656. and added a parameter to the previous hop's Via header field,
  2657. containing the address that the packet actually came from. (Note that
  2658. the NAT border.ieee.org is not a SIP server.)
  2659. 6.40.3 Responses
  2660. Via header fields in responses are processed by a proxy or UAC
  2661. according to the following rules:
  2662. 1. The first Via header field should indicate the proxy or
  2663. client processing this response. If it does not, discard
  2664. the message. Otherwise, remove this Via field.
  2665. 2. If there is no second Via header field, this response is
  2666. destined for this client. Otherwise, the processing depends
  2667. on whether the Via field contains a "maddr" parameter or is
  2668. a receiver-tagged field:
  2669. - If the second Via header field contains a "maddr"
  2670. parameter, send the response to the multicast address
  2671. listed there, using the port indicated in "sent-by", or
  2672. port 5060 if none is present. The response SHOULD be sent
  2673. using the TTL indicated in the "ttl" parameter, or with a
  2674. TTL of 1 if that parameter is not present. For
  2675. robustness, responses MUST be sent to the address
  2676. indicated in the "maddr" parameter even if it is not a
  2677. multicast address.
  2678. - If the second Via header field does not contain a "maddr"
  2679. parameter and is a receiver-tagged field (Section
  2680. 6.40.2), send the message to the address in the
  2681. "received" parameter, using the port indicated in the
  2682. "sent-by" value, or using port 5060 if none is present.
  2683. - If neither of the previous cases apply, send the message
  2684. to the address indicated by the "sent-by" value in the
  2685. second Via header field.
  2686. 6.40.4 User Agent and Redirect Servers
  2687. A UAS or redirect server sends a response based on one of the
  2688. following rules:
  2689. o If the first Via header field in the request contains a
  2690. "maddr" parameter, send the response to the multicast address
  2691. Handley, et al. Standards Track [Page 70]
  2692. RFC 2543 SIP: Session Initiation Protocol March 1999
  2693. listed there, using the port indicated in "sent-by", or port
  2694. 5060 if none is present. The response SHOULD be sent using the
  2695. TTL indicated in the "ttl" parameter, or with a TTL of 1 if
  2696. that parameter is not present. For robustness, responses MUST
  2697. be sent to the address indicated in the "maddr" parameter even
  2698. if it is not a multicast address.
  2699. o If the address in the "sent-by" value of the first Via field
  2700. differs from the source address of the packet, send the
  2701. response to the actual packet source address, similar to the
  2702. treatment for receiver-tagged Via header fields (Section
  2703. 6.40.2).
  2704. o If neither of these conditions is true, send the response to
  2705. the address contained in the "sent-by" value. If the request
  2706. was sent using TCP, use the existing TCP connection if
  2707. available.
  2708. 6.40.5 Syntax
  2709. The format for a Via header field is shown in Fig. 11. The defaults
  2710. for "protocol-name" and "transport" are "SIP" and "UDP",
  2711. respectively. The "maddr" parameter, designating the multicast
  2712. address, and the "ttl" parameter, designating the time-to-live (TTL)
  2713. value, are included only if the request was sent via multicast. The
  2714. "received" parameter is added only for receiver-added Via fields
  2715. (Section 6.40.2). For reasons of privacy, a client or proxy may wish
  2716. to hide its Via information by encrypting it (see Section 6.22). The
  2717. "hidden" parameter is included if this header field was hidden by the
  2718. upstream proxy (see 6.22). Note that privacy of the proxy relies on
  2719. the cooperation of the next hop, as the next-hop proxy will, by
  2720. necessity, know the IP address and port number of the source host.
  2721. The "branch" parameter is included by every forking proxy. The token
  2722. MUST be unique for each distinct request generated when a proxy
  2723. forks. CANCEL requests MUST have the same branch value as the
  2724. corresponding forked request. When a response arrives at the proxy it
  2725. can use the branch value to figure out which branch the response
  2726. corresponds to. A proxy which generates a single request (non-
  2727. forking) MAY also insert the "branch" parameter. The identifier has
  2728. to be unique only within a set of isomorphic requests.
  2729. Via: SIP/2.0/UDP first.example.com:4000;ttl=16
  2730. ;maddr=224.2.0.1 ;branch=a7c6a8dlze (Example)
  2731. Via: SIP/2.0/UDP adk8
  2732. Handley, et al. Standards Track [Page 71]
  2733. RFC 2543 SIP: Session Initiation Protocol March 1999
  2734. Via = ( "Via" | "v") ":" 1#( sent-protocol sent-by
  2735. *( ";" via-params ) [ comment ] )
  2736. via-params = via-hidden | via-ttl | via-maddr
  2737. | via-received | via-branch
  2738. via-hidden = "hidden"
  2739. via-ttl = "ttl" "=" ttl
  2740. via-maddr = "maddr" "=" maddr
  2741. via-received = "received" "=" host
  2742. via-branch = "branch" "=" token
  2743. sent-protocol = protocol-name "/" protocol-version "/" transport
  2744. protocol-name = "SIP" | token
  2745. protocol-version = token
  2746. transport = "UDP" | "TCP" | token
  2747. sent-by = ( host [ ":" port ] ) | ( concealed-host )
  2748. concealed-host = token
  2749. ttl = 1*3DIGIT ; 0 to 255
  2750. Figure 11: Syntax of Via header field
  2751. 6.41 Warning
  2752. The Warning response-header field is used to carry additional
  2753. information about the status of a response. Warning headers are sent
  2754. with responses and have the following format:
  2755. Warning = "Warning" ":" 1#warning-value
  2756. warning-value = warn-code SP warn-agent SP warn-text
  2757. warn-code = 3DIGIT
  2758. warn-agent = ( host [ ":" port ] ) | pseudonym
  2759. ; the name or pseudonym of the server adding
  2760. ; the Warning header, for use in debugging
  2761. warn-text = quoted-string
  2762. A response MAY carry more than one Warning header.
  2763. The "warn-text" should be in a natural language that is most likely
  2764. to be intelligible to the human user receiving the response. This
  2765. decision can be based on any available knowledge, such as the
  2766. location of the cache or user, the Accept-Language field in a
  2767. request, or the Content-Language field in a response. The default
  2768. language is i-default [31].
  2769. Handley, et al. Standards Track [Page 72]
  2770. RFC 2543 SIP: Session Initiation Protocol March 1999
  2771. Any server MAY add Warning headers to a response. Proxy servers MUST
  2772. place additional Warning headers before any Authorization headers.
  2773. Within that constraint, Warning headers MUST be added after any
  2774. existing Warning headers not covered by a signature. A proxy server
  2775. MUST NOT delete any Warning header field that it received with a
  2776. response.
  2777. When multiple Warning headers are attached to a response, the user
  2778. agent SHOULD display as many of them as possible, in the order that
  2779. they appear in the response. If it is not possible to display all of
  2780. the warnings, the user agent first displays warnings that appear
  2781. early in the response.
  2782. The warn-code consists of three digits. A first digit of "3"
  2783. indicates warnings specific to SIP.
  2784. This is a list of the currently-defined "warn-code"s, each with a
  2785. recommended warn-text in English, and a description of its meaning.
  2786. Note that these warnings describe failures induced by the session
  2787. description.
  2788. Warnings 300 through 329 are reserved for indicating problems with
  2789. keywords in the session description, 330 through 339 are warnings
  2790. related to basic network services requested in the session
  2791. description, 370 through 379 are warnings related to quantitative QoS
  2792. parameters requested in the session description, and 390 through 399
  2793. are miscellaneous warnings that do not fall into one of the above
  2794. categories.
  2795. 300 Incompatible network protocol: One or more network protocols
  2796. contained in the session description are not available.
  2797. 301 Incompatible network address formats: One or more network address
  2798. formats contained in the session description are not available.
  2799. 302 Incompatible transport protocol: One or more transport protocols
  2800. described in the session description are not available.
  2801. 303 Incompatible bandwidth units: One or more bandwidth measurement
  2802. units contained in the session description were not understood.
  2803. 304 Media type not available: One or more media types contained in
  2804. the session description are not available.
  2805. 305 Incompatible media format: One or more media formats contained in
  2806. the session description are not available.
  2807. Handley, et al. Standards Track [Page 73]
  2808. RFC 2543 SIP: Session Initiation Protocol March 1999
  2809. 306 Attribute not understood: One or more of the media attributes in
  2810. the session description are not supported.
  2811. 307 Session description parameter not understood: A parameter other
  2812. than those listed above was not understood.
  2813. 330 Multicast not available: The site where the user is located does
  2814. not support multicast.
  2815. 331 Unicast not available: The site where the user is located does
  2816. not support unicast communication (usually due to the presence
  2817. of a firewall).
  2818. 370 Insufficient bandwidth: The bandwidth specified in the session
  2819. description or defined by the media exceeds that known to be
  2820. available.
  2821. 399 Miscellaneous warning: The warning text can include arbitrary
  2822. information to be presented to a human user, or logged. A system
  2823. receiving this warning MUST NOT take any automated action.
  2824. 1xx and 2xx have been taken by HTTP/1.1.
  2825. Additional "warn-code"s, as in the example below, can be defined
  2826. through IANA.
  2827. Examples:
  2828. Warning: 307 isi.edu "Session parameter 'foo' not understood"
  2829. Warning: 301 isi.edu "Incompatible network address type 'E.164'"
  2830. 6.42 WWW-Authenticate
  2831. The WWW-Authenticate response-header field MUST be included in 401
  2832. (Unauthorized) response messages. The field value consists of at
  2833. least one challenge that indicates the authentication scheme(s) and
  2834. parameters applicable to the Request-URI. See [H14.46] for a
  2835. definition of the syntax, and section 14 for an overview of usage.
  2836. The content of the "realm" parameter SHOULD be displayed to the user.
  2837. A user agent SHOULD cache the authorization credentials for a given
  2838. value of the destination (To header) and "realm" and attempt to re-
  2839. use these values on the next request for that destination.
  2840. Handley, et al. Standards Track [Page 74]
  2841. RFC 2543 SIP: Session Initiation Protocol March 1999
  2842. In addition to the "basic" and "digest" authentication schemes
  2843. defined in the specifications cited above, SIP defines a new scheme,
  2844. PGP (RFC 2015, [32]), Section 15. Other schemes, such as S/MIME, are
  2845. for further study.
  2846. 7 Status Code Definitions
  2847. The response codes are consistent with, and extend, HTTP/1.1 response
  2848. codes. Not all HTTP/1.1 response codes are appropriate, and only
  2849. those that are appropriate are given here. Other HTTP/1.1 response
  2850. codes SHOULD NOT be used. Response codes not defined by HTTP/1.1 have
  2851. codes x80 upwards to avoid clashes with future HTTP response codes.
  2852. Also, SIP defines a new class, 6xx. The default behavior for unknown
  2853. response codes is given for each category of codes.
  2854. 7.1 Informational 1xx
  2855. Informational responses indicate that the server or proxy contacted
  2856. is performing some further action and does not yet have a definitive
  2857. response. The client SHOULD wait for a further response from the
  2858. server, and the server SHOULD send such a response without further
  2859. prompting. A server SHOULD send a 1xx response if it expects to take
  2860. more than 200 ms to obtain a final response. A server MAY issue zero
  2861. or more 1xx responses, with no restriction on their ordering or
  2862. uniqueness. Note that 1xx responses are not transmitted reliably,
  2863. that is, they do not cause the client to send an ACK. Servers are
  2864. free to retransmit informational responses and clients can inquire
  2865. about the current state of call processing by re-sending the request.
  2866. 7.1.1 100 Trying
  2867. Some unspecified action is being taken on behalf of this call (e.g.,
  2868. a database is being consulted), but the user has not yet been
  2869. located.
  2870. 7.1.2 180 Ringing
  2871. The called user agent has located a possible location where the user
  2872. has registered recently and is trying to alert the user.
  2873. 7.1.3 181 Call Is Being Forwarded
  2874. A proxy server MAY use this status code to indicate that the call is
  2875. being forwarded to a different set of destinations.
  2876. Handley, et al. Standards Track [Page 75]
  2877. RFC 2543 SIP: Session Initiation Protocol March 1999
  2878. 7.1.4 182 Queued
  2879. The called party is temporarily unavailable, but the callee has
  2880. decided to queue the call rather than reject it. When the callee
  2881. becomes available, it will return the appropriate final status
  2882. response. The reason phrase MAY give further details about the status
  2883. of the call, e.g., "5 calls queued; expected waiting time is 15
  2884. minutes". The server MAY issue several 182 responses to update the
  2885. caller about the status of the queued call.
  2886. 7.2 Successful 2xx
  2887. The request was successful and MUST terminate a search.
  2888. 7.2.1 200 OK
  2889. The request has succeeded. The information returned with the response
  2890. depends on the method used in the request, for example:
  2891. BYE: The call has been terminated. The message body is empty.
  2892. CANCEL: The search has been cancelled. The message body is empty.
  2893. INVITE: The callee has agreed to participate; the message body
  2894. indicates the callee's capabilities.
  2895. OPTIONS: The callee has agreed to share its capabilities, included in
  2896. the message body.
  2897. REGISTER: The registration has succeeded. The client treats the
  2898. message body according to its Content-Type.
  2899. 7.3 Redirection 3xx
  2900. 3xx responses give information about the user's new location, or
  2901. about alternative services that might be able to satisfy the call.
  2902. They SHOULD terminate an existing search, and MAY cause the initiator
  2903. to begin a new search if appropriate.
  2904. Any redirection (3xx) response MUST NOT suggest any of the addresses
  2905. in the Via (Section 6.40) path of the request in the Contact header
  2906. field. (Addresses match if their host and port number match.)
  2907. To avoid forwarding loops, a user agent client or proxy MUST check
  2908. whether the address returned by a redirect server equals an address
  2909. tried earlier.
  2910. Handley, et al. Standards Track [Page 76]
  2911. RFC 2543 SIP: Session Initiation Protocol March 1999
  2912. 7.3.1 300 Multiple Choices
  2913. The address in the request resolved to several choices, each with its
  2914. own specific location, and the user (or user agent) can select a
  2915. preferred communication end point and redirect its request to that
  2916. location.
  2917. The response SHOULD include an entity containing a list of resource
  2918. characteristics and location(s) from which the user or user agent can
  2919. choose the one most appropriate, if allowed by the Accept request
  2920. header. The entity format is specified by the media type given in the
  2921. Content-Type header field. The choices SHOULD also be listed as
  2922. Contact fields (Section 6.13). Unlike HTTP, the SIP response MAY
  2923. contain several Contact fields or a list of addresses in a Contact
  2924. field. User agents MAY use the Contact header field value for
  2925. automatic redirection or MAY ask the user to confirm a choice.
  2926. However, this specification does not define any standard for such
  2927. automatic selection.
  2928. This status response is appropriate if the callee can be
  2929. reached at several different locations and the server
  2930. cannot or prefers not to proxy the request.
  2931. 7.3.2 301 Moved Permanently
  2932. The user can no longer be found at the address in the Request-URI and
  2933. the requesting client SHOULD retry at the new address given by the
  2934. Contact header field (Section 6.13). The caller SHOULD update any
  2935. local directories, address books and user location caches with this
  2936. new value and redirect future requests to the address(es) listed.
  2937. 7.3.3 302 Moved Temporarily
  2938. The requesting client SHOULD retry the request at the new address(es)
  2939. given by the Contact header field (Section 6.13). The duration of
  2940. the redirection can be indicated through an Expires (Section 6.20)
  2941. header. If there is no explicit expiration time, the address is only
  2942. valid for this call and MUST NOT be cached for future calls.
  2943. 7.3.4 305 Use Proxy
  2944. The requested resource MUST be accessed through the proxy given by
  2945. the Contact field. The Contact field gives the URI of the proxy. The
  2946. recipient is expected to repeat this single request via the proxy.
  2947. 305 responses MUST only be generated by user agent servers.
  2948. Handley, et al. Standards Track [Page 77]
  2949. RFC 2543 SIP: Session Initiation Protocol March 1999
  2950. 7.3.5 380 Alternative Service
  2951. The call was not successful, but alternative services are possible.
  2952. The alternative services are described in the message body of the
  2953. response. Formats for such bodies are not defined here, and may be
  2954. the subject of future standardization.
  2955. 7.4 Request Failure 4xx
  2956. 4xx responses are definite failure responses from a particular
  2957. server. The client SHOULD NOT retry the same request without
  2958. modification (e.g., adding appropriate authorization). However, the
  2959. same request to a different server might be successful.
  2960. 7.4.1 400 Bad Request
  2961. The request could not be understood due to malformed syntax.
  2962. 7.4.2 401 Unauthorized
  2963. The request requires user authentication.
  2964. 7.4.3 402 Payment Required
  2965. Reserved for future use.
  2966. 7.4.4 403 Forbidden
  2967. The server understood the request, but is refusing to fulfill it.
  2968. Authorization will not help, and the request SHOULD NOT be repeated.
  2969. 7.4.5 404 Not Found
  2970. The server has definitive information that the user does not exist at
  2971. the domain specified in the Request-URI. This status is also returned
  2972. if the domain in the Request-URI does not match any of the domains
  2973. handled by the recipient of the request.
  2974. 7.4.6 405 Method Not Allowed
  2975. The method specified in the Request-Line is not allowed for the
  2976. address identified by the Request-URI. The response MUST include an
  2977. Allow header field containing a list of valid methods for the
  2978. indicated address.
  2979. Handley, et al. Standards Track [Page 78]
  2980. RFC 2543 SIP: Session Initiation Protocol March 1999
  2981. 7.4.7 406 Not Acceptable
  2982. The resource identified by the request is only capable of generating
  2983. response entities which have content characteristics not acceptable
  2984. according to the accept headers sent in the request.
  2985. 7.4.8 407 Proxy Authentication Required
  2986. This code is similar to 401 (Unauthorized), but indicates that the
  2987. client MUST first authenticate itself with the proxy. The proxy MUST
  2988. return a Proxy-Authenticate header field (section 6.26) containing a
  2989. challenge applicable to the proxy for the requested resource. The
  2990. client MAY repeat the request with a suitable Proxy-Authorization
  2991. header field (section 6.27). SIP access authentication is explained
  2992. in section 13.2 and 14.
  2993. This status code is used for applications where access to the
  2994. communication channel (e.g., a telephony gateway) rather than the
  2995. callee requires authentication.
  2996. 7.4.9 408 Request Timeout
  2997. The server could not produce a response, e.g., a user location,
  2998. within the time indicated in the Expires request-header field. The
  2999. client MAY repeat the request without modifications at any later
  3000. time.
  3001. 7.4.10 409 Conflict
  3002. The request could not be completed due to a conflict with the current
  3003. state of the resource. This response is returned if the action
  3004. parameter in a REGISTER request conflicts with existing
  3005. registrations.
  3006. 7.4.11 410 Gone
  3007. The requested resource is no longer available at the server and no
  3008. forwarding address is known. This condition is expected to be
  3009. considered permanent. If the server does not know, or has no facility
  3010. to determine, whether or not the condition is permanent, the status
  3011. code 404 (Not Found) SHOULD be used instead.
  3012. 7.4.12 411 Length Required
  3013. The server refuses to accept the request without a defined Content-
  3014. Length. The client MAY repeat the request if it adds a valid
  3015. Content-Length header field containing the length of the message-body
  3016. in the request message.
  3017. Handley, et al. Standards Track [Page 79]
  3018. RFC 2543 SIP: Session Initiation Protocol March 1999
  3019. 7.4.13 413 Request Entity Too Large
  3020. The server is refusing to process a request because the request
  3021. entity is larger than the server is willing or able to process. The
  3022. server MAY close the connection to prevent the client from continuing
  3023. the request.
  3024. If the condition is temporary, the server SHOULD include a Retry-
  3025. After header field to indicate that it is temporary and after what
  3026. time the client MAY try again.
  3027. 7.4.14 414 Request-URI Too Long
  3028. The server is refusing to service the request because the Request-URI
  3029. is longer than the server is willing to interpret.
  3030. 7.4.15 415 Unsupported Media Type
  3031. The server is refusing to service the request because the message
  3032. body of the request is in a format not supported by the requested
  3033. resource for the requested method. The server SHOULD return a list of
  3034. acceptable formats using the Accept, Accept-Encoding and Accept-
  3035. Language header fields.
  3036. 7.4.16 420 Bad Extension
  3037. The server did not understand the protocol extension specified in a
  3038. Require (Section 6.30) header field.
  3039. 7.4.17 480 Temporarily Unavailable
  3040. The callee's end system was contacted successfully but the callee is
  3041. currently unavailable (e.g., not logged in or logged in in such a
  3042. manner as to preclude communication with the callee). The response
  3043. MAY indicate a better time to call in the Retry-After header. The
  3044. user could also be available elsewhere (unbeknownst to this host),
  3045. thus, this response does not terminate any searches. The reason
  3046. phrase SHOULD indicate a more precise cause as to why the callee is
  3047. unavailable. This value SHOULD be setable by the user agent. Status
  3048. 486 (Busy Here) MAY be used to more precisely indicate a particular
  3049. reason for the call failure.
  3050. This status is also returned by a redirect server that recognizes the
  3051. user identified by the Request-URI, but does not currently have a
  3052. valid forwarding location for that user.
  3053. Handley, et al. Standards Track [Page 80]
  3054. RFC 2543 SIP: Session Initiation Protocol March 1999
  3055. 7.4.18 481 Call Leg/Transaction Does Not Exist
  3056. This status is returned under two conditions: The server received a
  3057. BYE request that does not match any existing call leg or the server
  3058. received a CANCEL request that does not match any existing
  3059. transaction. (A server simply discards an ACK referring to an unknown
  3060. transaction.)
  3061. 7.4.19 482 Loop Detected
  3062. The server received a request with a Via (Section 6.40) path
  3063. containing itself.
  3064. 7.4.20 483 Too Many Hops
  3065. The server received a request that contains more Via entries (hops)
  3066. (Section 6.40) than allowed by the Max-Forwards (Section 6.23) header
  3067. field.
  3068. 7.4.21 484 Address Incomplete
  3069. The server received a request with a To (Section 6.37) address or
  3070. Request-URI that was incomplete. Additional information SHOULD be
  3071. provided.
  3072. This status code allows overlapped dialing. With overlapped
  3073. dialing, the client does not know the length of the dialing
  3074. string. It sends strings of increasing lengths, prompting
  3075. the user for more input, until it no longer receives a 484
  3076. status response.
  3077. 7.4.22 485 Ambiguous
  3078. The callee address provided in the request was ambiguous. The
  3079. response MAY contain a listing of possible unambiguous addresses in
  3080. Contact headers.
  3081. Revealing alternatives can infringe on privacy concerns of the user
  3082. or the organization. It MUST be possible to configure a server to
  3083. respond with status 404 (Not Found) or to suppress the listing of
  3084. possible choices if the request address was ambiguous.
  3085. Example response to a request with the URL lee@example.com :
  3086. 485 Ambiguous SIP/2.0
  3087. Contact: Carol Lee <sip:carol.lee@example.com>
  3088. Handley, et al. Standards Track [Page 81]
  3089. RFC 2543 SIP: Session Initiation Protocol March 1999
  3090. Contact: Ping Lee <sip:p.lee@example.com>
  3091. Contact: Lee M. Foote <sip:lee.foote@example.com>
  3092. Some email and voice mail systems provide this
  3093. functionality. A status code separate from 3xx is used
  3094. since the semantics are different: for 300, it is assumed
  3095. that the same person or service will be reached by the
  3096. choices provided. While an automated choice or sequential
  3097. search makes sense for a 3xx response, user intervention is
  3098. required for a 485 response.
  3099. 7.4.23 486 Busy Here
  3100. The callee's end system was contacted successfully but the callee is
  3101. currently not willing or able to take additional calls. The response
  3102. MAY indicate a better time to call in the Retry-After header. The
  3103. user could also be available elsewhere, such as through a voice mail
  3104. service, thus, this response does not terminate any searches. Status
  3105. 600 (Busy Everywhere) SHOULD be used if the client knows that no
  3106. other end system will be able to accept this call.
  3107. 7.5 Server Failure 5xx
  3108. 5xx responses are failure responses given when a server itself has
  3109. erred. They are not definitive failures, and MUST NOT terminate a
  3110. search if other possible locations remain untried.
  3111. 7.5.1 500 Server Internal Error
  3112. The server encountered an unexpected condition that prevented it from
  3113. fulfilling the request. The client MAY display the specific error
  3114. condition, and MAY retry the request after several seconds.
  3115. 7.5.2 501 Not Implemented
  3116. The server does not support the functionality required to fulfill the
  3117. request. This is the appropriate response when the server does not
  3118. recognize the request method and is not capable of supporting it for
  3119. any user.
  3120. 7.5.3 502 Bad Gateway
  3121. The server, while acting as a gateway or proxy, received an invalid
  3122. response from the downstream server it accessed in attempting to
  3123. fulfill the request.
  3124. Handley, et al. Standards Track [Page 82]
  3125. RFC 2543 SIP: Session Initiation Protocol March 1999
  3126. 7.5.4 503 Service Unavailable
  3127. The server is currently unable to handle the request due to a
  3128. temporary overloading or maintenance of the server. The implication
  3129. is that this is a temporary condition which will be alleviated after
  3130. some delay. If known, the length of the delay MAY be indicated in a
  3131. Retry-After header. If no Retry-After is given, the client MUST
  3132. handle the response as it would for a 500 response.
  3133. Note: The existence of the 503 status code does not imply that a
  3134. server has to use it when becoming overloaded. Some servers MAY wish
  3135. to simply refuse the connection.
  3136. 7.5.5 504 Gateway Time-out
  3137. The server, while acting as a gateway, did not receive a timely
  3138. response from the server (e.g., a location server) it accessed in
  3139. attempting to complete the request.
  3140. 7.5.6 505 Version Not Supported
  3141. The server does not support, or refuses to support, the SIP protocol
  3142. version that was used in the request message. The server is
  3143. indicating that it is unable or unwilling to complete the request
  3144. using the same major version as the client, other than with this
  3145. error message. The response MAY contain an entity describing why that
  3146. version is not supported and what other protocols are supported by
  3147. that server. The format for such an entity is not defined here and
  3148. may be the subject of future standardization.
  3149. 7.6 Global Failures 6xx
  3150. 6xx responses indicate that a server has definitive information about
  3151. a particular user, not just the particular instance indicated in the
  3152. Request-URI. All further searches for this user are doomed to failure
  3153. and pending searches SHOULD be terminated.
  3154. 7.6.1 600 Busy Everywhere
  3155. The callee's end system was contacted successfully but the callee is
  3156. busy and does not wish to take the call at this time. The response
  3157. MAY indicate a better time to call in the Retry-After header. If the
  3158. callee does not wish to reveal the reason for declining the call, the
  3159. callee uses status code 603 (Decline) instead. This status response
  3160. is returned only if the client knows that no other end point (such as
  3161. a voice mail system) will answer the request. Otherwise, 486 (Busy
  3162. Here) should be returned.
  3163. Handley, et al. Standards Track [Page 83]
  3164. RFC 2543 SIP: Session Initiation Protocol March 1999
  3165. 7.6.2 603 Decline
  3166. The callee's machine was successfully contacted but the user
  3167. explicitly does not wish to or cannot participate. The response MAY
  3168. indicate a better time to call in the Retry-After header.
  3169. 7.6.3 604 Does Not Exist Anywhere
  3170. The server has authoritative information that the user indicated in
  3171. the To request field does not exist anywhere. Searching for the user
  3172. elsewhere will not yield any results.
  3173. 7.6.4 606 Not Acceptable
  3174. The user's agent was contacted successfully but some aspects of the
  3175. session description such as the requested media, bandwidth, or
  3176. addressing style were not acceptable.
  3177. A 606 (Not Acceptable) response means that the user wishes to
  3178. communicate, but cannot adequately support the session described. The
  3179. 606 (Not Acceptable) response MAY contain a list of reasons in a
  3180. Warning header field describing why the session described cannot be
  3181. supported. Reasons are listed in Section 6.41. It is hoped that
  3182. negotiation will not frequently be needed, and when a new user is
  3183. being invited to join an already existing conference, negotiation may
  3184. not be possible. It is up to the invitation initiator to decide
  3185. whether or not to act on a 606 (Not Acceptable) response.
  3186. 8 SIP Message Body
  3187. 8.1 Body Inclusion
  3188. Requests MAY contain message bodies unless otherwise noted. Within
  3189. this specification, the BYE request MUST NOT contain a message body.
  3190. For ACK, INVITE and OPTIONS, the message body is always a session
  3191. description. The use of message bodies for REGISTER requests is for
  3192. further study.
  3193. For response messages, the request method and the response status
  3194. code determine the type and interpretation of any message body. All
  3195. responses MAY include a body. Message bodies for 1xx responses
  3196. contain advisory information about the progress of the request. 2xx
  3197. responses to INVITE requests contain session descriptions. In 3xx
  3198. responses, the message body MAY contain the description of
  3199. alternative destinations or services, as described in Section 7.3.
  3200. For responses with status 400 or greater, the message body MAY
  3201. Handley, et al. Standards Track [Page 84]
  3202. RFC 2543 SIP: Session Initiation Protocol March 1999
  3203. contain additional, human-readable information about the reasons for
  3204. failure. It is RECOMMENDED that information in 1xx and 300 and
  3205. greater responses be of type text/plain or text/html
  3206. 8.2 Message Body Type
  3207. The Internet media type of the message body MUST be given by the
  3208. Content-Type header field. If the body has undergone any encoding
  3209. (such as compression) then this MUST be indicated by the Content-
  3210. Encoding header field, otherwise Content-Encoding MUST be omitted. If
  3211. applicable, the character set of the message body is indicated as
  3212. part of the Content-Type header-field value.
  3213. 8.3 Message Body Length
  3214. The body length in bytes SHOULD be given by the Content-Length header
  3215. field. Section 6.15 describes the behavior in detail.
  3216. The "chunked" transfer encoding of HTTP/1.1 MUST NOT be used for SIP.
  3217. (Note: The chunked encoding modifies the body of a message in order
  3218. to transfer it as a series of chunks, each with its own size
  3219. indicator.)
  3220. 9 Compact Form
  3221. When SIP is carried over UDP with authentication and a complex
  3222. session description, it may be possible that the size of a request or
  3223. response is larger than the MTU. To address this problem, a more
  3224. compact form of SIP is also defined by using abbreviations for the
  3225. common header fields listed below:
  3226. short field name long field name note
  3227. c Content-Type
  3228. e Content-Encoding
  3229. f From
  3230. i Call-ID
  3231. m Contact from "moved"
  3232. l Content-Length
  3233. s Subject
  3234. t To
  3235. v Via
  3236. Thus, the message in section 16.2 could also be written:
  3237. Handley, et al. Standards Track [Page 85]
  3238. RFC 2543 SIP: Session Initiation Protocol March 1999
  3239. INVITE sip:schooler@vlsi.caltech.edu SIP/2.0
  3240. v:SIP/2.0/UDP 131.215.131.131;maddr=239.128.16.254;ttl=16
  3241. v:SIP/2.0/UDP 128.16.64.19
  3242. f:sip:mjh@isi.edu
  3243. t:sip:schooler@cs.caltech.edu
  3244. i:62729-27@128.16.64.19
  3245. c:application/sdp
  3246. CSeq: 4711 INVITE
  3247. l:187
  3248. v=0
  3249. o=user1 53655765 2353687637 IN IP4 128.3.4.5
  3250. s=Mbone Audio
  3251. i=Discussion of Mbone Engineering Issues
  3252. e=mbone@somewhere.com
  3253. c=IN IP4 224.2.0.1/127
  3254. t=0 0
  3255. m=audio 3456 RTP/AVP 0
  3256. Clients MAY mix short field names and long field names within the
  3257. same request. Servers MUST accept both short and long field names for
  3258. requests. Proxies MAY change header fields between their long and
  3259. short forms, but this MUST NOT be done to fields following an
  3260. Authorization header.
  3261. 10 Behavior of SIP Clients and Servers
  3262. 10.1 General Remarks
  3263. SIP is defined so it can use either UDP (unicast or multicast) or TCP
  3264. as a transport protocol; it provides its own reliability mechanism.
  3265. 10.1.1 Requests
  3266. Servers discard isomorphic requests, but first retransmit the
  3267. appropriate response. (SIP requests are said to be idempotent , i.e.,
  3268. receiving more than one copy of a request does not change the server
  3269. state.)
  3270. After receiving a CANCEL request from an upstream client, a stateful
  3271. proxy server MAY send a CANCEL on all branches where it has not yet
  3272. received a final response.
  3273. When a user agent receives a request, it checks the Call-ID against
  3274. those of in-progress calls. If the Call-ID was found, it compares the
  3275. tag value of To with the user's tag and rejects the request if the
  3276. Handley, et al. Standards Track [Page 86]
  3277. RFC 2543 SIP: Session Initiation Protocol March 1999
  3278. two do not match. If the From header, including any tag value,
  3279. matches the value for an existing call leg, the server compares the
  3280. CSeq header field value. If less than or equal to the current
  3281. sequence number, the request is a retransmission. Otherwise, it is a
  3282. new request. If the From header does not match an existing call leg,
  3283. a new call leg is created.
  3284. If the Call-ID was not found, a new call leg is created, with entries
  3285. for the To, From and Call-ID headers. In this case, the To header
  3286. field should not have contained a tag. The server returns a response
  3287. containing the same To value, but with a unique tag added. The tag
  3288. MAY be omitted if the request contained only one Via header field.
  3289. 10.1.2 Responses
  3290. A server MAY issue one or more provisional responses at any time
  3291. before sending a final response. If a stateful proxy, user agent
  3292. server, redirect server or registrar cannot respond to a request with
  3293. a final response within 200 ms, it SHOULD issue a provisional (1xx)
  3294. response as soon as possible. Stateless proxies MUST NOT issue
  3295. provisional responses on their own.
  3296. Responses are mapped to requests by the matching To, From, Call-ID,
  3297. CSeq headers and the branch parameter of the first Via header.
  3298. Responses terminate request retransmissions even if they have Via
  3299. headers that cause them to be delivered to an upstream client.
  3300. A stateful proxy may receive a response that it does not have state
  3301. for, that is, where it has no a record of an associated request. If
  3302. the Via header field indicates that the upstream server used TCP, the
  3303. proxy actively opens a TCP connection to that address. Thus, proxies
  3304. have to be prepared to receive responses on the incoming side of
  3305. passive TCP connections, even though most responses will arrive on
  3306. the incoming side of an active connection. (An active connection is a
  3307. TCP connection initiated by the proxy, a passive connection is one
  3308. accepted by the proxy, but initiated by another entity.)
  3309. 100 responses SHOULD NOT be forwarded, other 1xx responses MAY be
  3310. forwarded, possibly after the server eliminates responses with status
  3311. codes that had already been sent earlier. 2xx responses are forwarded
  3312. according to the Via header. Once a stateful proxy has received a 2xx
  3313. response, it MUST NOT forward non-2xx final responses. Responses
  3314. with status 300 and higher are retransmitted by each stateful proxy
  3315. until the next upstream proxy sends an ACK (see below for timing
  3316. details) or CANCEL.
  3317. Handley, et al. Standards Track [Page 87]
  3318. RFC 2543 SIP: Session Initiation Protocol March 1999
  3319. A stateful proxy SHOULD maintain state for at least 32 seconds after
  3320. the receipt of the first definitive non-200 response, in order to
  3321. handle retransmissions of the response.
  3322. The 32 second window is given by the maximum retransmission
  3323. duration of 200-class responses using the default timers,
  3324. in case the ACK is lost somewhere on the way to the called
  3325. user agent or the next stateful proxy.
  3326. 10.2 Source Addresses, Destination Addresses and Connections
  3327. 10.2.1 Unicast UDP
  3328. Responses are returned to the address listed in the Via header field
  3329. (Section 6.40), not the source address of the request.
  3330. Recall that responses are not generated by the next-hop
  3331. stateless server, but generated by either a proxy server or
  3332. the user agent server. Thus, the stateless proxy can only
  3333. use the Via header field to forward the response.
  3334. 10.2.2 Multicast UDP
  3335. Requests MAY be multicast; multicast requests likely feature a host-
  3336. independent Request-URI. This request SHOULD be scoped to ensure it
  3337. is not forwarded beyond the boundaries of the administrative system.
  3338. This MAY be done with either TTL or administrative scopes[25],
  3339. depending on what is implemented in the network.
  3340. A client receiving a multicast query does not have to check whether
  3341. the host part of the Request-URI matches its own host or domain name.
  3342. If the request was received via multicast, the response is also
  3343. returned via multicast. Responses to multicast requests are multicast
  3344. with the same TTL as the request, where the TTL is derived from the
  3345. ttl parameter in the Via header (Section 6.40).
  3346. To avoid response implosion, servers MUST NOT answer multicast
  3347. requests with a status code other than 2xx or 6xx. The server delays
  3348. its response by a random interval uniformly distributed between zero
  3349. and one second. Servers MAY suppress responses if they hear a lower-
  3350. numbered or 6xx response from another group member prior to sending.
  3351. Servers do not respond to CANCEL requests received via multicast to
  3352. avoid request implosion. A proxy or UAC SHOULD send a CANCEL on
  3353. receiving the first 2xx or 6xx response to a multicast request.
  3354. Handley, et al. Standards Track [Page 88]
  3355. RFC 2543 SIP: Session Initiation Protocol March 1999
  3356. Server response suppression is a MAY since it requires a
  3357. server to violate some basic message processing rules. Lets
  3358. say A sends a multicast request, and it is received by B,C,
  3359. and D. B sends a 200 response. The topmost Via field in the
  3360. response will contain the address of A. C will also receive
  3361. this response, and could use it to suppress its own
  3362. response. However, C would normally not examine this
  3363. response, as the topmost Via is not its own. Normally, a
  3364. response received with an incorrect topmost Via MUST be
  3365. dropped, but not in this case. To distinguish this packet
  3366. from a misrouted or multicast looped packet is fairly
  3367. complex, and for this reason the procedure is a MAY. The
  3368. CANCEL, instead, provides a simpler and more standard way
  3369. to perform response suppression. It is for this reason that
  3370. the use of CANCEL here is a SHOULD
  3371. 10.3 TCP
  3372. A single TCP connection can serve one or more SIP transactions. A
  3373. transaction contains zero or more provisional responses followed by
  3374. one or more final responses. (Typically, transactions contain exactly
  3375. one final response, but there are exceptional circumstances, where,
  3376. for example, multiple 200 responses can be generated.)
  3377. The client SHOULD keep the connection open at least until the first
  3378. final response arrives. If the client closes or resets the TCP
  3379. connection prior to receiving the first final response, the server
  3380. treats this action as equivalent to a CANCEL request.
  3381. This behavior makes it less likely that malfunctioning
  3382. clients cause a proxy server to keep connection state
  3383. indefinitely.
  3384. The server SHOULD NOT close the TCP connection until it has sent its
  3385. final response, at which point it MAY close the TCP connection if it
  3386. wishes to. However, normally it is the client's responsibility to
  3387. close the connection.
  3388. If the server leaves the connection open, and if the client so
  3389. desires it MAY re-use the connection for further SIP requests or for
  3390. requests from the same family of protocols (such as HTTP or stream
  3391. control commands).
  3392. Handley, et al. Standards Track [Page 89]
  3393. RFC 2543 SIP: Session Initiation Protocol March 1999
  3394. If a server needs to return a response to a client and no longer has
  3395. a connection open to that client, it MAY open a connection to the
  3396. address listed in the Via header. Thus, a proxy or user agent MUST be
  3397. prepared to receive both requests and responses on a "passive"
  3398. connection.
  3399. 10.4 Reliability for BYE, CANCEL, OPTIONS, REGISTER Requests
  3400. 10.4.1 UDP
  3401. A SIP client using UDP SHOULD retransmit a BYE, CANCEL, OPTIONS, or
  3402. REGISTER request with an exponential backoff, starting at a T1 second
  3403. interval, doubling the interval for each packet, and capping off at a
  3404. T2 second interval. This means that after the first packet is sent,
  3405. the second is sent T1 seconds later, the next 2*T1 seconds after
  3406. that, the next 4*T1 seconds after that, and so on, until the interval
  3407. hits T2. Subsequent retransmissions are spaced by T2 seconds. If the
  3408. client receives a provisional response, it continues to retransmit
  3409. the request, but with an interval of T2 seconds. Retransmissions
  3410. cease when the client has sent a total of eleven packets, or receives
  3411. a definitive response. Default values for T1 and T2 are 500 ms and 4
  3412. s, respectively. Clients MAY use larger values, but SHOULD NOT use
  3413. smaller ones. Servers retransmit the response upon receipt of a
  3414. request retransmission. After the server sends a final response, it
  3415. cannot be sure the client has received the response, and thus SHOULD
  3416. cache the results for at least 10*T2 seconds to avoid having to, for
  3417. example, contact the user or location server again upon receiving a
  3418. request retransmission.
  3419. Use of the exponential backoff is for congestion control
  3420. purposes. However, the back-off must cap off, since request
  3421. retransmissions are used to trigger response
  3422. retransmissions at the server. Without a cap, the loss of a
  3423. single response could significantly increase transaction
  3424. latencies.
  3425. The value of the initial retransmission timer is smaller than that
  3426. that for TCP since it is expected that network paths suitable for
  3427. interactive communications have round-trip times smaller than 500 ms.
  3428. For congestion control purposes, the retransmission count has to be
  3429. bounded. Given that most transactions are expected to consist of one
  3430. request and a few responses, round-trip time estimation is not likely
  3431. to be very useful. If RTT estimation is desired to more quickly
  3432. discover a missing final response, each request retransmission needs
  3433. to be labeled with its own Timestamp (Section 6.36), returned in the
  3434. response. The server caches the result until it can be sure that the
  3435. client will not retransmit the same request again.
  3436. Handley, et al. Standards Track [Page 90]
  3437. RFC 2543 SIP: Session Initiation Protocol March 1999
  3438. Each server in a proxy chain generates its own final response to a
  3439. CANCEL request. The server responds immediately upon receipt of the
  3440. CANCEL request rather than waiting until it has received final
  3441. responses from the CANCEL requests it generates.
  3442. BYE and OPTIONS final responses are generated by redirect and user
  3443. agent servers; REGISTER final responses are generated by registrars.
  3444. Note that in contrast to the reliability mechanism described in
  3445. Section 10.5, responses to these requests are not retransmitted
  3446. periodically and not acknowledged via ACK.
  3447. 10.4.2 TCP
  3448. Clients using TCP do not need to retransmit requests.
  3449. 10.5 Reliability for INVITE Requests
  3450. Special considerations apply for the INVITE method.
  3451. 1. After receiving an invitation, considerable time can elapse
  3452. before the server can determine the outcome. For example,
  3453. if the called party is "rung" or extensive searches are
  3454. performed, delays between the request and a definitive
  3455. response can reach several tens of seconds. If either
  3456. caller or callee are automated servers not directly
  3457. controlled by a human being, a call attempt could be
  3458. unbounded in time.
  3459. 2. If a telephony user interface is modeled or if we need to
  3460. interface to the PSTN, the caller's user interface will
  3461. provide "ringback", a signal that the callee is being
  3462. alerted. (The status response 180 (Ringing) MAY be used to
  3463. initiate ringback.) Once the callee picks up, the caller
  3464. needs to know so that it can enable the voice path and stop
  3465. ringback. The callee's response to the invitation could get
  3466. lost. Unless the response is transmitted reliably, the
  3467. caller will continue to hear ringback while the callee
  3468. assumes that the call exists.
  3469. 3. The client has to be able to terminate an on-going request,
  3470. e.g., because it is no longer willing to wait for the
  3471. connection or search to succeed. The server will have to
  3472. wait several retransmission intervals to interpret the lack
  3473. of request retransmissions as the end of a call. If the
  3474. call succeeds shortly after the caller has given up, the
  3475. callee will "pick up the phone" and not be "connected".
  3476. Handley, et al. Standards Track [Page 91]
  3477. RFC 2543 SIP: Session Initiation Protocol March 1999
  3478. 10.5.1 UDP
  3479. For UDP, A SIP client SHOULD retransmit a SIP INVITE request with an
  3480. interval that starts at T1 seconds, and doubles after each packet
  3481. transmission. The client ceases retransmissions if it receives a
  3482. provisional or definitive response, or once it has sent a total of 7
  3483. request packets.
  3484. A server which transmits a provisional response should retransmit it
  3485. upon reception of a duplicate request. A server which transmits a
  3486. final response should retransmit it with an interval that starts at
  3487. T1 seconds, and doubles for each subsequent packet. Response
  3488. retransmissions cease when any one of the following occurs:
  3489. 1. An ACK request for the same transaction is received;
  3490. 2. a BYE request for the same call leg is received;
  3491. 3. a CANCEL request for the same call leg is received and the
  3492. final response status was equal or greater to 300;
  3493. 4. the response has been transmitted 7 times.
  3494. Only the user agent client generates an ACK for 2xx final responses,
  3495. If the response contained a Contact header field, the ACK MAY be sent
  3496. to the address listed in that Contact header field. If the response
  3497. did not contain a Contact header, the client uses the same To header
  3498. field and Request-URI as for the INVITE request and sends the ACK to
  3499. the same destination as the original INVITE request. ACKs for final
  3500. responses other than 2xx are sent to the same server that the
  3501. original request was sent to, using the same Request-URI as the
  3502. original request. Note, however, that the To header field in the ACK
  3503. is copied from the response being acknowledged, not the request, and
  3504. thus MAY additionally contain the tag parameter. Also note than
  3505. unlike 2xx final responses, a proxy generates an ACK for non-2xx
  3506. final responses.
  3507. The ACK request MUST NOT be acknowledged to prevent a response-ACK
  3508. feedback loop. Fig. 12 and 13 show the client and server state
  3509. diagram for invitations.
  3510. The mechanism in Sec. 10.4 would not work well for INVITE
  3511. because of the long delays between INVITE and a final
  3512. response. If the 200 response were to get lost, the callee
  3513. would believe the call to exist, but the voice path would
  3514. Handley, et al. Standards Track [Page 92]
  3515. RFC 2543 SIP: Session Initiation Protocol March 1999
  3516. +===========+
  3517. * *
  3518. ...........>* Initial *<;;;;;;;;;;
  3519. : 7 INVITE * * ;
  3520. : sent +===========+ ;
  3521. : | ;
  3522. : | - ;
  3523. : | INVITE ;
  3524. : | ;
  3525. : v ;
  3526. : ************* ;
  3527. : T1*2^n <--* * ;
  3528. : INVITE -->* Calling *--------+ ;
  3529. : * * | ;
  3530. : ************* | ;
  3531. : : | | ;
  3532. :.............: | 1xx xxx | ;
  3533. | - ACK | ;
  3534. | | ;
  3535. v | ;
  3536. ************* | ;
  3537. * * | ;
  3538. * Ringing *<->1xx | ;
  3539. * * | ;
  3540. ************* | ;
  3541. | | ;
  3542. |<-------------+ ;
  3543. | ;
  3544. v ;
  3545. ************* ;
  3546. xxx <--* * ;
  3547. ACK -->* Completed * ;
  3548. * * ;
  3549. ************* ;
  3550. ; 32s (for proxy);
  3551. ;;;;;;;;;;;;;;;;;;
  3552. event (xxx=status)
  3553. message
  3554. Figure 12: State transition diagram of client for INVITE method
  3555. Handley, et al. Standards Track [Page 93]
  3556. RFC 2543 SIP: Session Initiation Protocol March 1999
  3557. 7 pkts sent +===============+
  3558. +-------------->* *
  3559. | * Initial *<...............
  3560. |;;;;;;;;;;;;;;>* * :
  3561. |; +===============+ :
  3562. |; CANCEL ! :
  3563. |; 200 ! INVITE :
  3564. |; ! 1xx :
  3565. |; ! :
  3566. |; v :
  3567. |; ***************** BYE :
  3568. |; INVITE -->* * 200 :
  3569. |; 1xx <--* Call proceed. *..............>:
  3570. |; * * :
  3571. |;;;;;;;;;;;;;;;***************** :
  3572. |; ! ! :
  3573. |: ! ! :
  3574. |; failure ! ! picks up :
  3575. |; >= 300 ! ! 200 :
  3576. |; +-------+ +-------+ :
  3577. |; v v :
  3578. |; *********** *********** :
  3579. |;INVITE<* *<T1*2^n->* *>INVITE :
  3580. |;status>* failure *>status<-* success *<status :
  3581. |; * * * * :
  3582. |;;;;;;;;*********** *********** :
  3583. | ! : | | ! : :
  3584. | ! : | | ! : :
  3585. +-------------!-:-+------------+ ! : :
  3586. ! :.................!..:.........>:
  3587. ! ! BYE :
  3588. +---------+---------+ 200 :
  3589. event ! ACK :
  3590. message sent v :
  3591. ***************** :
  3592. V---* * :
  3593. ACK * Confirmed * :
  3594. |-->* * :
  3595. ***************** .
  3596. :......................>:
  3597. Figure 13: State transition diagram of server for INVITE method
  3598. Handley, et al. Standards Track [Page 94]
  3599. RFC 2543 SIP: Session Initiation Protocol March 1999
  3600. be dead since the caller does not know that the callee has
  3601. picked up. Thus, the INVITE retransmission interval would
  3602. have to be on the order of a second or two to limit the
  3603. duration of this state confusion. Retransmitting the
  3604. response with an exponential back-off helps ensure that the
  3605. response is received, without placing an undue burden on
  3606. the network.
  3607. 10.5.2 TCP
  3608. A user agent using TCP MUST NOT retransmit requests, but uses the
  3609. same algorithm as for UDP (Section 10.5.1) to retransmit responses
  3610. until it receives an ACK.
  3611. It is necessary to retransmit 2xx responses as their
  3612. reliability is assured end-to-end only. If the chain of
  3613. proxies has a UDP link in the middle, it could lose the
  3614. response, with no possibility of recovery. For simplicity,
  3615. we also retransmit non-2xx responses, although that is not
  3616. strictly necessary.
  3617. 10.6 Reliability for ACK Requests
  3618. The ACK request does not generate responses. It is only generated
  3619. when a response to an INVITE request arrives (see Section 10.5). This
  3620. behavior is independent of the transport protocol. Note that the ACK
  3621. request MAY take a different path than the original INVITE request,
  3622. and MAY even cause a new TCP connection to be opened in order to send
  3623. it.
  3624. 10.7 ICMP Handling
  3625. Handling of ICMP messages in the case of UDP messages is
  3626. straightforward. For requests, a host, network, port, or protocol
  3627. unreachable error SHOULD be treated as if a 400-class response was
  3628. received. For responses, these errors SHOULD cause the server to
  3629. cease retransmitting the response.
  3630. Source quench ICMP messages SHOULD be ignored. TTL exceeded errors
  3631. SHOULD be ignored. Parameter problem errors SHOULD be treated as if a
  3632. 400-class response was received.
  3633. 11 Behavior of SIP User Agents
  3634. This section describes the rules for user agent client and servers
  3635. for generating and processing requests and responses.
  3636. Handley, et al. Standards Track [Page 95]
  3637. RFC 2543 SIP: Session Initiation Protocol March 1999
  3638. 11.1 Caller Issues Initial INVITE Request
  3639. When a user agent client desires to initiate a call, it formulates an
  3640. INVITE request. The To field in the request contains the address of
  3641. the callee. The Request-URI contains the same address. The From field
  3642. contains the address of the caller. If the From address can appear
  3643. in requests generated by other user agent clients for the same call,
  3644. the caller MUST insert the tag parameter in the From field. A UAC MAY
  3645. optionally add a Contact header containing an address where it would
  3646. like to be contacted for transactions from the callee back to the
  3647. caller.
  3648. 11.2 Callee Issues Response
  3649. When the initial INVITE request is received at the callee, the callee
  3650. can accept, redirect, or reject the call. In all of these cases, it
  3651. formulates a response. The response MUST copy the To, From, Call-ID,
  3652. CSeq and Via fields from the request. Additionally, the responding
  3653. UAS MUST add the tag parameter to the To field in the response if the
  3654. request contained more than one Via header field. Since a request
  3655. from a UAC may fork and arrive at multiple hosts, the tag parameter
  3656. serves to distinguish, at the UAC, multiple responses from different
  3657. UAS's. The UAS MAY add a Contact header field in the response. It
  3658. contains an address where the callee would like to be contacted for
  3659. subsequent transactions, including the ACK for the current INVITE.
  3660. The UAS stores the values of the To and From field, including any
  3661. tags. These become the local and remote addresses of the call leg,
  3662. respectively.
  3663. 11.3 Caller Receives Response to Initial Request
  3664. Multiple responses may arrive at the UAC for a single INVITE request,
  3665. due to a forking proxy. Each response is distinguished by the "tag"
  3666. parameter in the To header field, and each represents a distinct call
  3667. leg. The caller MAY choose to acknowledge or terminate the call with
  3668. each responding UAS. To acknowledge, it sends an ACK request, and to
  3669. terminate it sends a BYE request. The To header field in the ACK or
  3670. BYE MUST be the same as the To field in the 200 response, including
  3671. any tag. The From header field MUST be the same as the From header
  3672. field in the 200 (OK) response, including any tag. The Request-URI of
  3673. the ACK or BYE request MAY be set to whatever address was found in
  3674. the Contact header field in the 200 (OK) response, if present.
  3675. Alternately, a UAC may copy the address from the To header field into
  3676. the Request-URI. The UAC also notes the value of the To and From
  3677. header fields in each response. For each call leg, the To header
  3678. field becomes the remote address, and the From header field becomes
  3679. the local address.
  3680. Handley, et al. Standards Track [Page 96]
  3681. RFC 2543 SIP: Session Initiation Protocol March 1999
  3682. 11.4 Caller or Callee Generate Subsequent Requests
  3683. Once the call has been established, either the caller or callee MAY
  3684. generate INVITE or BYE requests to change or terminate the call.
  3685. Regardless of whether the caller or callee is generating the new
  3686. request, the header fields in the request are set as follows. For the
  3687. desired call leg, the To header field is set to the remote address,
  3688. and the From header field is set to the local address (both including
  3689. any tags). The Contact header field MAY be different than the Contact
  3690. header field sent in a previous response or request. The Request-URI
  3691. MAY be set to the value of the Contact header field received in a
  3692. previous request or response from the remote party, or to the value
  3693. of the remote address.
  3694. 11.5 Receiving Subsequent Requests
  3695. When a request is received subsequently, the following checks are
  3696. made:
  3697. 1. If the Call-ID is new, the request is for a new call,
  3698. regardless of the values of the To and From header fields.
  3699. 2. If the Call-ID exists, the request is for an existing call.
  3700. If the To, From, Call-ID, and CSeq values exactly match
  3701. (including tags) those of any requests received previously,
  3702. the request is a retransmission.
  3703. 3. If there was no match to the previous step, the To and From
  3704. fields are compared against existing call leg local and
  3705. remote addresses. If there is a match, and the CSeq in the
  3706. request is higher than the last CSeq received on that leg,
  3707. the request is a new transaction for an existing call leg.
  3708. 12 Behavior of SIP Proxy and Redirect Servers
  3709. This section describes behavior of SIP redirect and proxy servers in
  3710. detail. Proxy servers can "fork" connections, i.e., a single incoming
  3711. request spawns several outgoing (client) requests.
  3712. 12.1 Redirect Server
  3713. A redirect server does not issue any SIP requests of its own. After
  3714. receiving a request other than CANCEL, the server gathers the list of
  3715. alternative locations and returns a final response of class 3xx or it
  3716. refuses the request. For well-formed CANCEL requests, it SHOULD
  3717. return a 2xx response. This response ends the SIP transaction. The
  3718. Handley, et al. Standards Track [Page 97]
  3719. RFC 2543 SIP: Session Initiation Protocol March 1999
  3720. redirect server maintains transaction state for the whole SIP
  3721. transaction. It is up to the client to detect forwarding loops
  3722. between redirect servers.
  3723. 12.2 User Agent Server
  3724. User agent servers behave similarly to redirect servers, except that
  3725. they also accept requests and can return a response of class 2xx.
  3726. 12.3 Proxy Server
  3727. This section outlines processing rules for proxy servers. A proxy
  3728. server can either be stateful or stateless. When stateful, a proxy
  3729. remembers the incoming request which generated outgoing requests, and
  3730. the outgoing requests. A stateless proxy forgets all information once
  3731. an outgoing request is generated. A forking proxy SHOULD be stateful.
  3732. Proxies that accept TCP connections MUST be stateful.
  3733. Otherwise, if the proxy were to lose a request, the TCP
  3734. client would never retransmit it.
  3735. A stateful proxy SHOULD NOT become stateless until after it sends a
  3736. definitive response upstream, and at least 32 seconds after it
  3737. received a definitive response.
  3738. A stateful proxy acts as a virtual UAS/UAC. It implements the server
  3739. state machine when receiving requests, and the client state machine
  3740. for generating outgoing requests, with the exception of receiving a
  3741. 2xx response to an INVITE. Instead of generating an ACK, the 2xx
  3742. response is always forwarded upstream towards the caller.
  3743. Furthermore, ACK's for 200 responses to INVITE's are always proxied
  3744. downstream towards the UAS, as they would be for a stateless proxy.
  3745. A stateless proxy does not act as a virtual UAS/UAC (as this would
  3746. require state). Rather, a stateless proxy forwards every request it
  3747. receives downstream, and every response it receives upstream.
  3748. 12.3.1 Proxying Requests
  3749. To prevent loops, a server MUST check if its own address is already
  3750. contained in the Via header field of the incoming request.
  3751. The To, From, Call-ID, and Contact tags are copied exactly from the
  3752. original request. The proxy SHOULD change the Request-URI to indicate
  3753. the server where it intends to send the request.
  3754. Handley, et al. Standards Track [Page 98]
  3755. RFC 2543 SIP: Session Initiation Protocol March 1999
  3756. A proxy server always inserts a Via header field containing its own
  3757. address into those requests that are caused by an incoming request.
  3758. Each proxy MUST insert a "branch" parameter (Section 6.40).
  3759. 12.3.2 Proxying Responses
  3760. A proxy only processes a response if the topmost Via field matches
  3761. one of its addresses. A response with a non-matching top Via field
  3762. MUST be dropped.
  3763. 12.3.3 Stateless Proxy: Proxying Responses
  3764. A stateless proxy removes its own Via field, and checks the address
  3765. in the next Via field. In the case of UDP, the response is sent to
  3766. the address listed in the "maddr" tag if present, otherwise to the
  3767. "received" tag if present, and finally to the address in the "sent-
  3768. by" field. A proxy MUST remain stateful when handling requests
  3769. received via TCP.
  3770. A stateless proxy MUST NOT generate its own provisional responses.
  3771. 12.3.4 Stateful Proxy: Receiving Requests
  3772. When a stateful proxy receives a request, it checks the To, From
  3773. (including tags), Call-ID and CSeq against existing request records.
  3774. If the tuple exists, the request is a retransmission. The provisional
  3775. or final response sent previously is retransmitted, as per the server
  3776. state machine. If the tuple does not exist, the request corresponds
  3777. to a new transaction, and the request should be proxied.
  3778. A stateful proxy server MAY generate its own provisional (1xx)
  3779. responses.
  3780. 12.3.5 Stateful Proxy: Receiving ACKs
  3781. When an ACK request is received, it is either processed locally or
  3782. proxied. To make this determination, the To, From, CSeq and Call-ID
  3783. fields are compared against those in previous requests. If there is
  3784. no match, the ACK request is proxied as if it were an INVITE request.
  3785. If there is a match, and if the server had ever sent a 200 response
  3786. upstream, the ACK is proxied. If the server had never sent any
  3787. responses upstream, the ACK is also proxied. If the server had sent a
  3788. 3xx, 4xx, 5xx or 6xx response, but no 2xx response, the ACK is
  3789. processed locally if the tag in the To field of the ACK matches the
  3790. tag sent by the proxy in the response.
  3791. Handley, et al. Standards Track [Page 99]
  3792. RFC 2543 SIP: Session Initiation Protocol March 1999
  3793. 12.3.6 Stateful Proxy: Receiving Responses
  3794. When a proxy server receives a response that has passed the Via
  3795. checks, the proxy server checks the To (without the tag), From
  3796. (including the tag), Call-ID and CSeq against values seen in previous
  3797. requests. If there is no match, the response is forwarded upstream to
  3798. the address listed in the Via field. If there is a match, the
  3799. "branch" tag in the Via field is examined. If it matches a known
  3800. branch identifier, the response is for the given branch, and
  3801. processed by the virtual client for the given branch. Otherwise, the
  3802. response is dropped.
  3803. A stateful proxy should obey the rules in Section 12.4 to determine
  3804. if the response should be proxied upstream. If it is to be proxied,
  3805. the same rules for stateless proxies above are followed, with the
  3806. following addition for TCP. If a request was received via TCP
  3807. (indicated by the protocol in the top Via header), the proxy checks
  3808. to see if it has a connection currently open to that address. If so,
  3809. the response is sent on that connection. Otherwise, a new TCP
  3810. connection is opened to the address and port in the Via field, and
  3811. the response is sent there. Note that this implies that a UAC or
  3812. proxy MUST be prepared to receive responses on the incoming side of a
  3813. TCP connection. Definitive non 200-class responses MUST be
  3814. retransmitted by the proxy, even over a TCP connection.
  3815. 12.3.7 Stateless, Non-Forking Proxy
  3816. Proxies in this category issue at most a single unicast request for
  3817. each incoming SIP request, that is, they do not "fork" requests.
  3818. However, servers MAY choose to always operate in a mode that allows
  3819. issuing of several requests, as described in Section 12.4.
  3820. The server can forward the request and any responses. It does not
  3821. have to maintain any state for the SIP transaction. Reliability is
  3822. assured by the next redirect or stateful proxy server in the server
  3823. chain.
  3824. A proxy server SHOULD cache the result of any address translations
  3825. and the response to speed forwarding of retransmissions. After the
  3826. cache entry has been expired, the server cannot tell whether an
  3827. incoming request is actually a retransmission of an older request.
  3828. The server will treat it as a new request and commence another
  3829. search.
  3830. 12.4 Forking Proxy
  3831. The server MUST respond to the request immediately with a 100
  3832. (Trying) response.
  3833. Handley, et al. Standards Track [Page 100]
  3834. RFC 2543 SIP: Session Initiation Protocol March 1999
  3835. Successful responses to an INVITE request MAY contain a Contact
  3836. header field so that the following ACK or BYE bypasses the proxy
  3837. search mechanism. If the proxy requires future requests to be routed
  3838. through it, it adds a Record-Route header to the request (Section
  3839. 6.29).
  3840. The following C-code describes the behavior of a proxy server issuing
  3841. several requests in response to an incoming INVITE request. The
  3842. function request(r, a, b) sends a SIP request of type r to address a,
  3843. with branch id b. await_response() waits until a response is received
  3844. and returns the response. close(a) closes the TCP connection to
  3845. client with address a. response(r) sends a response to the client.
  3846. ismulticast() returns 1 if the location is a multicast address and
  3847. zero otherwise. The variable timeleft indicates the amount of time
  3848. left until the maximum response time has expired. The variable
  3849. recurse indicates whether the server will recursively try addresses
  3850. returned through a 3xx response. A server MAY decide to recursively
  3851. try only certain addresses, e.g., those which are within the same
  3852. domain as the proxy server. Thus, an initial multicast request can
  3853. trigger additional unicast requests.
  3854. /* request type */
  3855. typedef enum {INVITE, ACK, BYE, OPTIONS, CANCEL, REGISTER} Method;
  3856. process_request(Method R, int N, address_t address[])
  3857. {
  3858. struct {
  3859. int branch; /* branch id */
  3860. int done; /* has responded */
  3861. } outgoing[];
  3862. int done[]; /* address has responded */
  3863. char *location[]; /* list of locations */
  3864. int heard = 0; /* number of sites heard from */
  3865. int class; /* class of status code */
  3866. int timeleft = 120; /* sample timeout value */
  3867. int loc = 0; /* number of locations */
  3868. struct { /* response */
  3869. int status; /* response: CANCEL=-1 */
  3870. int locations; /* number of redirect locations */
  3871. char *location[]; /* redirect locations */
  3872. address_t a; /* address of respondent */
  3873. int branch; /* branch identifier */
  3874. } r, best; /* response, best response */
  3875. int i;
  3876. best.status = 1000;
  3877. for (i = 0; i < N; i++) {
  3878. Handley, et al. Standards Track [Page 101]
  3879. RFC 2543 SIP: Session Initiation Protocol March 1999
  3880. request(R, address[i], i);
  3881. outgoing[i].done = 0;
  3882. outgoing[i].branch = i;
  3883. }
  3884. while (timeleft > 0 && heard < N) {
  3885. r = await_response();
  3886. class = r.status / 100;
  3887. /* If final response, mark branch as done. */
  3888. if (class >= 2) {
  3889. heard++;
  3890. for (i = 0; i < N; i++) {
  3891. if (r.branch == outgoing[i].branch) {
  3892. outgoing[i].done = 1;
  3893. break;
  3894. }
  3895. }
  3896. }
  3897. /* CANCEL: respond, fork and wait for responses */
  3898. else if (class < 0) {
  3899. best.status = 200;
  3900. response(best);
  3901. for (i = 0; i < N; i++) {
  3902. if (!outgoing[i].done)
  3903. request(CANCEL, address[i], outgoing[i].branch);
  3904. }
  3905. best.status = -1;
  3906. }
  3907. /* Send an ACK */
  3908. if (class != 2) {
  3909. if (R == INVITE) request(ACK, r.a, r.branch);
  3910. }
  3911. if (class == 2) {
  3912. if (r.status < best.status) best = r;
  3913. break;
  3914. }
  3915. else if (class == 3) {
  3916. /* A server MAY optionally recurse. The server MUST check
  3917. * whether it has tried this location before and whether
  3918. * the location is part of the Via path of the incoming
  3919. * request. This check is omitted here for brevity.
  3920. * Multicast locations MUST NOT be returned to the client if
  3921. * the server is not recursing.
  3922. Handley, et al. Standards Track [Page 102]
  3923. RFC 2543 SIP: Session Initiation Protocol March 1999
  3924. */
  3925. if (recurse) {
  3926. multicast = 0;
  3927. N += r.locations;
  3928. for (i = 0; i < r.locations; i++) {
  3929. request(R, r.location[i]);
  3930. }
  3931. } else if (!ismulticast(r.location)) {
  3932. best = r;
  3933. }
  3934. }
  3935. else if (class == 4) {
  3936. if (best.status >= 400) best = r;
  3937. }
  3938. else if (class == 5) {
  3939. if (best.status >= 500) best = r;
  3940. }
  3941. else if (class == 6) {
  3942. best = r;
  3943. break;
  3944. }
  3945. }
  3946. /* We haven't heard anything useful from anybody. */
  3947. if (best.status == 1000) {
  3948. best.status = 404;
  3949. }
  3950. if (best.status/100 != 3) loc = 0;
  3951. response(best);
  3952. }
  3953. Responses are processed as follows. The process completes (and state
  3954. can be freed) when all requests have been answered by final status
  3955. responses (for unicast) or 60 seconds have elapsed (for multicast). A
  3956. proxy MAY send a CANCEL to all branches and return a 408 (Timeout) to
  3957. the client after 60 seconds or more.
  3958. 1xx: The proxy MAY forward the response upstream towards the client.
  3959. 2xx: The proxy MUST forward the response upstream towards the client,
  3960. without sending an ACK downstream. After receiving a 2xx, the
  3961. server MAY terminate all other pending requests by sending a
  3962. CANCEL request and closing the TCP connection, if applicable.
  3963. (Terminating pending requests is advisable as searches consume
  3964. resources. Also, INVITE requests could "ring" on a number of
  3965. workstations if the callee is currently logged in more than
  3966. once.)
  3967. Handley, et al. Standards Track [Page 103]
  3968. RFC 2543 SIP: Session Initiation Protocol March 1999
  3969. 3xx: The proxy MUST send an ACK and MAY recurse on the listed Contact
  3970. addresses. Otherwise, the lowest-numbered response is returned
  3971. if there were no 2xx responses.
  3972. Location lists are not merged as that would prevent
  3973. forwarding of authenticated responses. Also, responses can
  3974. have message bodies, so that merging is not feasible.
  3975. 4xx, 5xx: The proxy MUST send an ACK and remember the response if it
  3976. has a lower status code than any previous 4xx and 5xx responses.
  3977. On completion, the lowest-numbered response is returned if there
  3978. were no 2xx or 3xx responses.
  3979. 6xx: The proxy MUST forward the response to the client and send an
  3980. ACK. Other pending requests MAY be terminated with CANCEL as
  3981. described for 2xx responses.
  3982. A proxy server forwards any response for Call-IDs for which it does
  3983. not have a pending transaction according to the response's Via
  3984. header. User agent servers respond to BYE requests for unknown call
  3985. legs with status code 481 (Transaction Does Not Exist); they drop ACK
  3986. requests with unknown call legs silently.
  3987. Special considerations apply for choosing forwarding destinations for
  3988. ACK and BYE requests. In most cases, these requests will bypass
  3989. proxies and reach the desired party directly, keeping proxies from
  3990. having to make forwarding decisions.
  3991. A proxy MAY maintain call state for a period of its choosing. If a
  3992. proxy still has list of destinations that it forwarded the last
  3993. INVITE to, it SHOULD direct ACK requests only to those downstream
  3994. servers.
  3995. 13 Security Considerations
  3996. 13.1 Confidentiality and Privacy: Encryption
  3997. 13.1.1 End-to-End Encryption
  3998. SIP requests and responses can contain sensitive information about
  3999. the communication patterns and communication content of individuals.
  4000. The SIP message body MAY also contain encryption keys for the session
  4001. itself. SIP supports three complementary forms of encryption to
  4002. protect privacy:
  4003. o End-to-end encryption of the SIP message body and certain
  4004. sensitive header fields;
  4005. Handley, et al. Standards Track [Page 104]
  4006. RFC 2543 SIP: Session Initiation Protocol March 1999
  4007. o hop-by-hop encryption to prevent eavesdropping that tracks
  4008. who is calling whom;
  4009. o hop-by-hop encryption of Via fields to hide the route a
  4010. request has taken.
  4011. Not all of the SIP request or response can be encrypted end-to-end
  4012. because header fields such as To and Via need to be visible to
  4013. proxies so that the SIP request can be routed correctly. Hop-by-hop
  4014. encryption encrypts the entire SIP request or response on the wire so
  4015. that packet sniffers or other eavesdroppers cannot see who is calling
  4016. whom. Hop-by-hop encryption can also encrypt requests and responses
  4017. that have been end-to-end encrypted. Note that proxies can still see
  4018. who is calling whom, and this information is also deducible by
  4019. performing a network traffic analysis, so this provides a very
  4020. limited but still worthwhile degree of protection.
  4021. SIP Via fields are used to route a response back along the path taken
  4022. by the request and to prevent infinite request loops. However, the
  4023. information given by them can also provide useful information to an
  4024. attacker. Section 6.22 describes how a sender can request that Via
  4025. fields be encrypted by cooperating proxies without compromising the
  4026. purpose of the Via field.
  4027. End-to-end encryption relies on keys shared by the two user agents
  4028. involved in the request. Typically, the message is sent encrypted
  4029. with the public key of the recipient, so that only that recipient can
  4030. read the message. All implementations SHOULD support PGP-based
  4031. encryption [33] and MAY implement other schemes.
  4032. A SIP request (or response) is end-to-end encrypted by splitting the
  4033. message to be sent into a part to be encrypted and a short header
  4034. that will remain in the clear. Some parts of the SIP message, namely
  4035. the request line, the response line and certain header fields marked
  4036. with "n" in the "enc." column in Table 4 and 5 need to be read and
  4037. returned by proxies and thus MUST NOT be encrypted end-to-end.
  4038. Possibly sensitive information that needs to be made available as
  4039. plaintext include destination address (To) and the forwarding path
  4040. (Via) of the call. The Authorization header field MUST remain in the
  4041. clear if it contains a digital signature as the signature is
  4042. generated after encryption, but MAY be encrypted if it contains
  4043. "basic" or "digest" authentication. The From header field SHOULD
  4044. normally remain in the clear, but MAY be encrypted if required, in
  4045. which case some proxies MAY return a 401 (Unauthorized) status if
  4046. they require a From field.
  4047. Handley, et al. Standards Track [Page 105]
  4048. RFC 2543 SIP: Session Initiation Protocol March 1999
  4049. Other header fields MAY be encrypted or MAY travel in the clear as
  4050. desired by the sender. The Subject, Allow and Content-Type header
  4051. fields will typically be encrypted. The Accept, Accept-Language,
  4052. Date, Expires, Priority, Require, Call-ID, Cseq, and Timestamp header
  4053. fields will remain in the clear.
  4054. All fields that will remain in the clear MUST precede those that will
  4055. be encrypted. The message is encrypted starting with the first
  4056. character of the first header field that will be encrypted and
  4057. continuing through to the end of the message body. If no header
  4058. fields are to be encrypted, encrypting starts with the second CRLF
  4059. pair after the last header field, as shown below. Carriage return and
  4060. line feed characters have been made visible as "$", and the encrypted
  4061. part of the message is outlined.
  4062. INVITE sip:watson@boston.bell-telephone.com SIP/2.0$
  4063. Via: SIP/2.0/UDP 169.130.12.5$
  4064. To: T. A. Watson <sip:watson@bell-telephone.com>$
  4065. From: A. Bell <sip:a.g.bell@bell-telephone.com>$
  4066. Encryption: PGP version=5.0$
  4067. Content-Length: 224$
  4068. Call-ID: 187602141351@worcester.bell-telephone.com$
  4069. CSeq: 488$
  4070. $
  4071. *******************************************************
  4072. * Subject: Mr. Watson, come here.$ *
  4073. * Content-Type: application/sdp$ *
  4074. * $ *
  4075. * v=0$ *
  4076. * o=bell 53655765 2353687637 IN IP4 128.3.4.5$ *
  4077. * c=IN IP4 135.180.144.94$ *
  4078. * m=audio 3456 RTP/AVP 0 3 4 5$ *
  4079. *******************************************************
  4080. An Encryption header field MUST be added to indicate the encryption
  4081. mechanism used. A Content-Length field is added that indicates the
  4082. length of the encrypted body. The encrypted body is preceded by a
  4083. blank line as a normal SIP message body would be.
  4084. Upon receipt by the called user agent possessing the correct
  4085. decryption key, the message body as indicated by the Content-Length
  4086. field is decrypted, and the now-decrypted body is appended to the
  4087. clear-text header fields. There is no need for an additional
  4088. Content-Length header field within the encrypted body because the
  4089. length of the actual message body is unambiguous after decryption.
  4090. Handley, et al. Standards Track [Page 106]
  4091. RFC 2543 SIP: Session Initiation Protocol March 1999
  4092. Had no SIP header fields required encryption, the message would have
  4093. been as below. Note that the encrypted body MUST then include a blank
  4094. line (start with CRLF) to disambiguate between any possible SIP
  4095. header fields that might have been present and the SIP message body.
  4096. INVITE sip:watson@boston.bell-telephone.com SIP/2.0$
  4097. Via: SIP/2.0/UDP 169.130.12.5$
  4098. To: T. A. Watson <sip:watson@bell-telephone.com>$
  4099. From: A. Bell <a.g.bell@bell-telephone.com>$
  4100. Encryption: PGP version=5.0$
  4101. Content-Type: application/sdp$
  4102. Content-Length: 107$
  4103. $
  4104. *************************************************
  4105. * $ *
  4106. * v=0$ *
  4107. * o=bell 53655765 2353687637 IN IP4 128.3.4.5$ *
  4108. * c=IN IP4 135.180.144.94$ *
  4109. * m=audio 3456 RTP/AVP 0 3 4 5$ *
  4110. *************************************************
  4111. 13.1.2 Privacy of SIP Responses
  4112. SIP requests can be sent securely using end-to-end encryption and
  4113. authentication to a called user agent that sends an insecure
  4114. response. This is allowed by the SIP security model, but is not a
  4115. good idea. However, unless the correct behavior is explicit, it
  4116. would not always be possible for the called user agent to infer what
  4117. a reasonable behavior was. Thus when end-to-end encryption is used by
  4118. the request originator, the encryption key to be used for the
  4119. response SHOULD be specified in the request. If this were not done,
  4120. it might be possible for the called user agent to incorrectly infer
  4121. an appropriate key to use in the response. Thus, to prevent key-
  4122. guessing becoming an acceptable strategy, we specify that a called
  4123. user agent receiving a request that does not specify a key to be used
  4124. for the response SHOULD send that response unencrypted.
  4125. Any SIP header fields that were encrypted in a request SHOULD also be
  4126. encrypted in an encrypted response. Contact response fields MAY be
  4127. encrypted if the information they contain is sensitive, or MAY be
  4128. left in the clear to permit proxies more scope for localized
  4129. searches.
  4130. Handley, et al. Standards Track [Page 107]
  4131. RFC 2543 SIP: Session Initiation Protocol March 1999
  4132. 13.1.3 Encryption by Proxies
  4133. Normally, proxies are not allowed to alter end-to-end header fields
  4134. and message bodies. Proxies MAY, however, encrypt an unsigned request
  4135. or response with the key of the call recipient.
  4136. Proxies need to encrypt a SIP request if the end system
  4137. cannot perform encryption or to enforce organizational
  4138. security policies.
  4139. 13.1.4 Hop-by-Hop Encryption
  4140. SIP requests and responses MAY also be protected by security
  4141. mechanisms at the transport or network layer. No particular mechanism
  4142. is defined or recommended here. Two possibilities are IPSEC [34] or
  4143. TLS [35]. The use of a particular mechanism will generally need to be
  4144. specified out of band, through manual configuration, for example.
  4145. 13.1.5 Via field encryption
  4146. When Via header fields are to be hidden, a proxy that receives a
  4147. request containing an appropriate "Hide: hop" header field (as
  4148. specified in section 6.22) SHOULD encrypt the header field. As only
  4149. the proxy that encrypts the field will decrypt it, the algorithm
  4150. chosen is entirely up to the proxy implementor. Two methods satisfy
  4151. these requirements:
  4152. o The server keeps a cache of Via header fields and the
  4153. associated To header field, and replaces the Via header field
  4154. with an index into the cache. On the reverse path, take the
  4155. Via header field from the cache rather than the message.
  4156. This is insufficient to prevent message looping, and so an
  4157. additional ID MUST be added so that the proxy can detect loops.
  4158. This SHOULD NOT normally be the address of the proxy as the goal
  4159. is to hide the route, so instead a sufficiently large random
  4160. number SHOULD be used by the proxy and maintained in the cache.
  4161. It is possible for replies to get directed to the wrong
  4162. originator if the cache entry gets reused, so great care needs
  4163. to be taken to ensure this does not happen.
  4164. o The server MAY use a secret key to encrypt the Via field, a
  4165. timestamp and an appropriate checksum in any such message with
  4166. the same secret key. The checksum is needed to detect whether
  4167. successful decoding has occurred, and the timestamp is
  4168. Handley, et al. Standards Track [Page 108]
  4169. RFC 2543 SIP: Session Initiation Protocol March 1999
  4170. required to prevent possible replay attacks and to ensure that
  4171. no two requests from the same previous hop have the same
  4172. encrypted Via field. This is the preferred solution.
  4173. 13.2 Message Integrity and Access Control: Authentication
  4174. Protective measures need to be taken to prevent an active attacker
  4175. from modifying and replaying SIP requests and responses. The same
  4176. cryptographic measures that are used to ensure the authenticity of
  4177. the SIP message also serve to authenticate the originator of the
  4178. message. However, the "basic" and "digest" authentication mechanism
  4179. offer authentication only, without message integrity.
  4180. Transport-layer or network-layer authentication MAY be used for hop-
  4181. by-hop authentication. SIP also extends the HTTP WWW-Authenticate
  4182. (Section 6.42) and Authorization (Section 6.11) header field and
  4183. their Proxy counterparts to include cryptographically strong
  4184. signatures. SIP also supports the HTTP "basic" and "digest" schemes
  4185. (see Section 14) and other HTTP authentication schemes to be defined
  4186. that offer a rudimentary mechanism of ascertaining the identity of
  4187. the caller.
  4188. Since SIP requests are often sent to parties with which no
  4189. prior communication relationship has existed, we do not
  4190. specify authentication based on shared secrets.
  4191. SIP requests MAY be authenticated using the Authorization header
  4192. field to include a digital signature of certain header fields, the
  4193. request method and version number and the payload, none of which are
  4194. modified between client and called user agent. The Authorization
  4195. header field is used in requests to authenticate the request
  4196. originator end-to-end to proxies and the called user agent, and in
  4197. responses to authenticate the called user agent or proxies returning
  4198. their own failure codes. If required, hop-by-hop authentication can
  4199. be provided, for example, by the IPSEC Authentication Header.
  4200. SIP does not dictate which digital signature scheme is used for
  4201. authentication, but does define how to provide authentication using
  4202. PGP in Section 15. As indicated above, SIP implementations MAY also
  4203. use "basic" and "digest" authentication and other authentication
  4204. mechanisms defined for HTTP. Note that "basic" authentication has
  4205. severe security limitations. The following does not apply to these
  4206. schemes.
  4207. To cryptographically sign a SIP request, the order of the SIP header
  4208. fields is important. When an Authorization header field is present,
  4209. it indicates that all header fields following the Authorization
  4210. Handley, et al. Standards Track [Page 109]
  4211. RFC 2543 SIP: Session Initiation Protocol March 1999
  4212. header field have been included in the signature. Therefore, hop-
  4213. by-hop header fields which MUST or SHOULD be modified by proxies MUST
  4214. precede the Authorization header field as they will generally be
  4215. modified or added-to by proxy servers. Hop-by-hop header fields
  4216. which MAY be modified by a proxy MAY appear before or after the
  4217. Authorization header. When they appear before, they MAY be modified
  4218. by a proxy. When they appear after, they MUST NOT be modified by a
  4219. proxy. To sign a request, a client constructs a message from the
  4220. request method (in upper case) followed, without LWS, by the SIP
  4221. version number, followed, again without LWS, by the request headers
  4222. to be signed and the message body. The message thus constructed is
  4223. then signed.
  4224. For example, if the SIP request is to be:
  4225. INVITE sip:watson@boston.bell-telephone.com SIP/2.0
  4226. Via: SIP/2.0/UDP 169.130.12.5
  4227. Authorization: PGP version=5.0, signature=...
  4228. From: A. Bell <sip:a.g.bell@bell-telephone.com>
  4229. To: T. A. Watson <sip:watson@bell-telephone.com>
  4230. Call-ID: 187602141351@worcester.bell-telephone.com
  4231. Subject: Mr. Watson, come here.
  4232. Content-Type: application/sdp
  4233. Content-Length: ...
  4234. v=0
  4235. o=bell 53655765 2353687637 IN IP4 128.3.4.5
  4236. c=IN IP4 135.180.144.94
  4237. m=audio 3456 RTP/AVP 0 3 4 5
  4238. Then the data block that is signed is:
  4239. INVITESIP/2.0From: A. Bell <sip:a.g.bell@bell-telephone.com>
  4240. To: T. A. Watson <sip:watson@bell-telephone.com>
  4241. Call-ID: 187602141351@worcester.bell-telephone.com
  4242. Subject: Mr. Watson, come here.
  4243. Content-Type: application/sdp
  4244. Content-Length: ...
  4245. v=0
  4246. o=bell 53655765 2353687637 IN IP4 128.3.4.5
  4247. c=IN IP4 135.180.144.94
  4248. m=audio 3456 RTP/AVP 0 3 4 5
  4249. Handley, et al. Standards Track [Page 110]
  4250. RFC 2543 SIP: Session Initiation Protocol March 1999
  4251. Clients wishing to authenticate requests MUST construct the portion
  4252. of the message below the Authorization header using a canonical form.
  4253. This allows a proxy to parse the message, take it apart, and
  4254. reconstruct it, without causing an authentication failure due to
  4255. extra white space, for example. Canonical form consists of the
  4256. following rules:
  4257. o No short form header fields
  4258. o Header field names are capitalized as shown in this document
  4259. o No white space between the header name and the colon
  4260. o A single space after the colon
  4261. o Line termination with a CRLF
  4262. o No line folding
  4263. o No comma separated lists of header values; each must appear
  4264. as a separate header
  4265. o Only a single SP between tokens, between tokens and quoted
  4266. strings, and between quoted strings; no SP after last token or
  4267. quoted string
  4268. o No LWS between tokens and separators, except as described
  4269. above for after the colon in header fields
  4270. Note that if a message is encrypted and authenticated using a digital
  4271. signature, when the message is generated encryption is performed
  4272. before the digital signature is generated. On receipt, the digital
  4273. signature is checked before decryption.
  4274. A client MAY require that a server sign its response by including a
  4275. Require: org.ietf.sip.signed-response request header field. The
  4276. client indicates the desired authentication method via the WWW-
  4277. Authenticate header.
  4278. The correct behavior in handling unauthenticated responses to a
  4279. request that requires authenticated responses is described in section
  4280. 13.2.1.
  4281. Handley, et al. Standards Track [Page 111]
  4282. RFC 2543 SIP: Session Initiation Protocol March 1999
  4283. 13.2.1 Trusting responses
  4284. There is the possibility that an eavesdropper listens to requests and
  4285. then injects unauthenticated responses that terminate, redirect or
  4286. otherwise interfere with a call. (Even encrypted requests contain
  4287. enough information to fake a response.)
  4288. Clients need to be particularly careful with 3xx redirection
  4289. responses. Thus a client receiving, for example, a 301 (Moved
  4290. Permanently) which was not authenticated when the public key of the
  4291. called user agent is known to the client, and authentication was
  4292. requested in the request SHOULD be treated as suspicious. The correct
  4293. behavior in such a case would be for the called-user to form a dated
  4294. response containing the Contact field to be used, to sign it, and
  4295. give this signed stub response to the proxy that will provide the
  4296. redirection. Thus the response can be authenticated correctly. A
  4297. client SHOULD NOT automatically redirect such a request to the new
  4298. location without alerting the user to the authentication failure
  4299. before doing so.
  4300. Another problem might be responses such as 6xx failure responses
  4301. which would simply terminate a search, or "4xx" and "5xx" response
  4302. failures.
  4303. If TCP is being used, a proxy SHOULD treat 4xx and 5xx responses as
  4304. valid, as they will not terminate a search. However, fake 6xx
  4305. responses from a rogue proxy terminate a search incorrectly. 6xx
  4306. responses SHOULD be authenticated if requested by the client, and
  4307. failure to do so SHOULD cause such a client to ignore the 6xx
  4308. response and continue a search.
  4309. With UDP, the same problem with 6xx responses exists, but also an
  4310. active eavesdropper can generate 4xx and 5xx responses that might
  4311. cause a proxy or client to believe a failure occurred when in fact it
  4312. did not. Typically 4xx and 5xx responses will not be signed by the
  4313. called user agent, and so there is no simple way to detect these
  4314. rogue responses. This problem is best prevented by using hop-by-hop
  4315. encryption of the SIP request, which removes any additional problems
  4316. that UDP might have over TCP.
  4317. These attacks are prevented by having the client require response
  4318. authentication and dropping unauthenticated responses. A server user
  4319. agent that cannot perform response authentication responds using the
  4320. normal Require response of 420 (Bad Extension).
  4321. Handley, et al. Standards Track [Page 112]
  4322. RFC 2543 SIP: Session Initiation Protocol March 1999
  4323. 13.3 Callee Privacy
  4324. User location and SIP-initiated calls can violate a callee's privacy.
  4325. An implementation SHOULD be able to restrict, on a per-user basis,
  4326. what kind of location and availability information is given out to
  4327. certain classes of callers.
  4328. 13.4 Known Security Problems
  4329. With either TCP or UDP, a denial of service attack exists by a rogue
  4330. proxy sending 6xx responses. Although a client SHOULD choose to
  4331. ignore such responses if it requested authentication, a proxy cannot
  4332. do so. It is obliged to forward the 6xx response back to the client.
  4333. The client can then ignore the response, but if it repeats the
  4334. request it will probably reach the same rogue proxy again, and the
  4335. process will repeat.
  4336. 14 SIP Authentication using HTTP Basic and Digest Schemes
  4337. SIP implementations MAY use HTTP's basic and digest authentication
  4338. mechanisms to provide a rudimentary form of security. This section
  4339. overviews usage of these mechanisms in SIP. The basic operation is
  4340. almost completely identical to that for HTTP [36]. This section
  4341. outlines this operation, pointing to [36] for details, and noting the
  4342. differences when used in SIP.
  4343. 14.1 Framework
  4344. The framework for SIP authentication parallels that for HTTP [36]. In
  4345. particular, the BNF for auth-scheme, auth-param, challenge, realm,
  4346. realm-value, and credentials is identical. The 401 response is used
  4347. by user agent servers in SIP to challenge the authorization of a user
  4348. agent client. Additionally, registrars and redirect servers MAY make
  4349. use of 401 responses for authorization, but proxies MUST NOT, and
  4350. instead MAY use the 407 response. The requirements for inclusion of
  4351. the Proxy-Authenticate, Proxy-Authorization, WWW-Authenticate, and
  4352. Authorization in the various messages is identical to [36].
  4353. Since SIP does not have the concept of a canonical root URL, the
  4354. notion of protections spaces are interpreted differently for SIP. The
  4355. realm is a protection domain for all SIP URIs with the same value for
  4356. the userinfo, host and port part of the SIP Request-URI. For example:
  4357. INVITE sip:alice.wonderland@example.com SIP/2.0
  4358. WWW-Authenticate: Basic realm="business"
  4359. Handley, et al. Standards Track [Page 113]
  4360. RFC 2543 SIP: Session Initiation Protocol March 1999
  4361. and
  4362. INVITE sip:aw@example.com SIP/2.0
  4363. WWW-Authenticate: Basic realm="business"
  4364. define different protection realms according to this rule.
  4365. When a UAC resubmits a request with its credentials after receiving a
  4366. 401 or 407 response, it MUST increment the CSeq header field as it
  4367. would normally do when sending an updated request.
  4368. 14.2 Basic Authentication
  4369. The rules for basic authentication follow those defined in [36], but
  4370. with the words "origin server" replaced with "user agent server,
  4371. redirect server , or registrar".
  4372. Since SIP URIs are not hierarchical, the paragraph in [36] that
  4373. states that "all paths at or deeper than the depth of the last
  4374. symbolic element in the path field of the Request-URI also are within
  4375. the protection space specified by the Basic realm value of the
  4376. current challenge" does not apply for SIP. SIP clients MAY
  4377. preemptively send the corresponding Authorization header with
  4378. requests for SIP URIs within the same protection realm (as defined
  4379. above) without receipt of another challenge from the server.
  4380. 14.3 Digest Authentication
  4381. The rules for digest authentication follow those defined in [36],
  4382. with "HTTP 1.1" replaced by "SIP/2.0" in addition to the following
  4383. differences:
  4384. 1. The URI included in the challenge has the following BNF:
  4385. URI = SIP-URL
  4386. 2. The BNF for digest-uri-value is:
  4387. digest-uri-value = Request-URI ; a defined in Section
  4388. 4.3
  4389. Handley, et al. Standards Track [Page 114]
  4390. RFC 2543 SIP: Session Initiation Protocol March 1999
  4391. 3. The example procedure for choosing a nonce based on Etag
  4392. does not work for SIP.
  4393. 4. The Authentication-Info and Proxy-Authentication-Info
  4394. fields are not used in SIP.
  4395. 5. The text in [36] regarding cache operation does not apply
  4396. to SIP.
  4397. 6. [36] requires that a server check that the URI in the
  4398. request line, and the URI included in the Authorization
  4399. header, point to the same resource. In a SIP context, these
  4400. two URI's may actually refer to different users, due to
  4401. forwarding at some proxy. Therefore, in SIP, a server MAY
  4402. check that the request-uri in the Authorization header
  4403. corresponds to a user that the server is willing to accept
  4404. forwarded or direct calls for.
  4405. 14.4 Proxy-Authentication
  4406. The use of the Proxy-Authentication and Proxy-Authorization parallel
  4407. that as described in [36], with one difference. Proxies MUST NOT add
  4408. the Proxy-Authorization header. 407 responses MUST be forwarded
  4409. upstream towards the client following the procedures for any other
  4410. response. It is the client's responsibility to add the Proxy-
  4411. Authorization header containing credentials for the proxy which has
  4412. asked for authentication.
  4413. If a proxy were to resubmit a request with a Proxy-
  4414. Authorization header field, it would need to increment the
  4415. CSeq in the new request. However, this would mean that the
  4416. UAC which submitted the original request would discard a
  4417. response from the UAS, as the CSeq value would be
  4418. different.
  4419. See sections 6.26 and 6.27 for additional information on usage of
  4420. these fields as they apply to SIP.
  4421. 15 SIP Security Using PGP
  4422. 15.1 PGP Authentication Scheme
  4423. The "pgp" authentication scheme is based on the model that the client
  4424. authenticates itself with a request signed with the client's private
  4425. key. The server can then ascertain the origin of the request if it
  4426. has access to the public key, preferably signed by a trusted third
  4427. party.
  4428. Handley, et al. Standards Track [Page 115]
  4429. RFC 2543 SIP: Session Initiation Protocol March 1999
  4430. 15.1.1 The WWW-Authenticate Response Header
  4431. WWW-Authenticate = "WWW-Authenticate" ":" "pgp" pgp-challenge
  4432. pgp-challenge = * (";" pgp-params )
  4433. pgp-params = realm | pgp-version | pgp-algorithm | nonce
  4434. realm = "realm" "=" realm-value
  4435. realm-value = quoted-string
  4436. pgp-version = "version" "="
  4437. <"> digit *( "." digit ) *letter <">
  4438. pgp-algorithm = "algorithm" "=" ( "md5" | "sha1" | token )
  4439. nonce = "nonce" "=" nonce-value
  4440. nonce-value = quoted-string
  4441. The meanings of the values of the parameters used above are as
  4442. follows:
  4443. realm: A string to be displayed to users so they know which identity
  4444. to use. This string SHOULD contain at least the name of the host
  4445. performing the authentication and MAY additionally indicate the
  4446. collection of users who might have access. An example might be "
  4447. Users with call-out privileges ".
  4448. pgp-algorithm: The value of this parameter indicates the PGP message
  4449. integrity check (MIC) to be used to produce the signature. If
  4450. this not present it is assumed to be "md5". The currently
  4451. defined values are "md5" for the MD5 checksum, and "sha1" for
  4452. the SHA.1 algorithm.
  4453. pgp-version: The version of PGP that the client MUST use. Common
  4454. values are "2.6.2" and "5.0". The default is 5.0.
  4455. nonce: A server-specified data string which should be uniquely
  4456. generated each time a 401 response is made. It is RECOMMENDED
  4457. that this string be base64 or hexadecimal data. Specifically,
  4458. since the string is passed in the header lines as a quoted
  4459. string, the double-quote character is not allowed. The contents
  4460. of the nonce are implementation dependent. The quality of the
  4461. implementation depends on a good choice. Since the nonce is used
  4462. only to prevent replay attacks and is signed, a time stamp in
  4463. units convenient to the server is sufficient.
  4464. Handley, et al. Standards Track [Page 116]
  4465. RFC 2543 SIP: Session Initiation Protocol March 1999
  4466. Replay attacks within the duration of the call setup are of
  4467. limited interest, so that timestamps with a resolution of a
  4468. few seconds are often should be sufficient. In that case,
  4469. the server does not have to keep a record of the nonces.
  4470. Example:
  4471. WWW-Authenticate: pgp ;version="5.0"
  4472. ;realm="Your Startrek identity, please" ;algorithm=md5
  4473. ;nonce="913082051"
  4474. 15.1.2 The Authorization Request Header
  4475. The client is expected to retry the request, passing an Authorization
  4476. header line, which is defined as follows.
  4477. Authorization = "Authorization" ":" "pgp" *( ";" pgp-response )
  4478. pgp-response = realm | pgp-version | pgp-signature
  4479. | signed-by | nonce
  4480. pgp-signature = "signature" "=" quoted-string
  4481. signed-by = "signed-by" "=" <"> URI <">
  4482. The client MUST increment the CSeq header before resubmitting the
  4483. request. The signature MUST correspond to the From header of the
  4484. request unless the signed-by parameter is provided.
  4485. pgp-signature: The PGP ASCII-armored signature [33], as it appears
  4486. between the "BEGIN PGP MESSAGE" and "END PGP MESSAGE"
  4487. delimiters, without the version indication. The signature is
  4488. included without any linebreaks.
  4489. The signature is computed across the nonce (if present), request
  4490. method, request version and header fields following the Authorization
  4491. header and the message body, in the same order as they appear in the
  4492. message. The request method and version are prepended to the header
  4493. fields without any white space. The signature is computed across the
  4494. headers as sent, and the terminating CRLF. The CRLF following the
  4495. Authorization header is NOT included in the signature.
  4496. A server MAY be configured not to generate nonces only if replay
  4497. attacks are not a concern.
  4498. Handley, et al. Standards Track [Page 117]
  4499. RFC 2543 SIP: Session Initiation Protocol March 1999
  4500. Not generating nonces avoids the additional set of request,
  4501. 401 response and possibly ACK messages and reduces delay by
  4502. one round-trip time.
  4503. Using the ASCII-armored version is about 25% less space-
  4504. efficient than including the binary signature, but it is
  4505. significantly easier for the receiver to piece together.
  4506. Versions of the PGP program always include the full
  4507. (compressed) signed text in their output unless ASCII-
  4508. armored mode ( -sta ) is specified. Typical signatures are
  4509. about 200 bytes long. -- The PGP signature mechanism allows
  4510. the client to simply pass the request to an external PGP
  4511. program. This relies on the requirement that proxy servers
  4512. are not allowed to reorder or change header fields.
  4513. realm: The realm is copied from the corresponding WWW-Authenticate
  4514. header field parameter.
  4515. signed-by: If and only if the request was not signed by the entity
  4516. listed in the From header, the signed-by header indicates the
  4517. name of the signing entity, expressed as a URI.
  4518. Receivers of signed SIP messages SHOULD discard any end-to-end header
  4519. fields above the Authorization header, as they may have been
  4520. maliciously added en route by a proxy.
  4521. Example:
  4522. Authorization: pgp version="5.0"
  4523. ;realm="Your Startrek identity, please"
  4524. ;nonce="913082051"
  4525. ;signature="iQB1AwUBNNJiUaYBnHmiiQh1AQFYsgL/Wt3dk6TWK81/b0gcNDf
  4526. VAUGU4rhEBW972IPxFSOZ94L1qhCLInTPaqhHFw1cb3lB01rA0RhpV4t5yCdUt
  4527. SRYBSkOK29o5e1KlFeW23EzYPVUm2TlDAhbcjbMdfC+KLFX
  4528. =aIrx"
  4529. 15.2 PGP Encryption Scheme
  4530. The PGP encryption scheme uses the following syntax:
  4531. Encryption = "Encryption" ":" "pgp" pgp-eparams
  4532. pgp-eparams = 1# ( pgp-version | pgp-encoding )
  4533. pgp-encoding = "encoding" "=" "ascii" | token
  4534. Handley, et al. Standards Track [Page 118]
  4535. RFC 2543 SIP: Session Initiation Protocol March 1999
  4536. encoding: Describes the encoding or "armor" used by PGP. The value
  4537. "ascii" refers to the standard PGP ASCII armor, without the
  4538. lines containing "BEGIN PGP MESSAGE" and "END PGP MESSAGE" and
  4539. without the version identifier. By default, the encrypted part
  4540. is included as binary.
  4541. Example:
  4542. Encryption: pgp version="2.6.2", encoding="ascii"
  4543. 15.3 Response-Key Header Field for PGP
  4544. Response-Key = "Response-Key" ":" "pgp" pgp-eparams
  4545. pgp-eparams = 1# ( pgp-version | pgp-encoding | pgp-key)
  4546. pgp-key = "key" "=" quoted-string
  4547. If ASCII encoding has been requested via the encoding parameter, the
  4548. key parameter contains the user's public key as extracted from the
  4549. pgp key ring with the "pgp -kxa user ".
  4550. Example:
  4551. Response-Key: pgp version="2.6.2", encoding="ascii",
  4552. key="mQBtAzNWHNYAAAEDAL7QvAdK2utY05wuUG+ItYK5tCF8HNJM60sU4rLaV+eUnkMk
  4553. mOmJWtc2wXcZx1XaXb2lkydTQOesrUR75IwNXBuZXPEIMThEa5WLsT7VLme7njnx
  4554. sE86SgWmAZx5ookIdQAFEbQxSGVubmluZyBTY2h1bHpyaW5uZSA8c2NodWx6cmlu
  4555. bmVAY3MuY29sdW1iaWEuZWR1Pg==
  4556. =+y19"
  4557. 16 Examples
  4558. In the following examples, we often omit the message body and the
  4559. corresponding Content-Length and Content-Type headers for brevity.
  4560. 16.1 Registration
  4561. A user at host saturn.bell-tel.com registers on start-up, via
  4562. multicast, with the local SIP server named bell-tel.com. In the
  4563. example, the user agent on saturn expects to receive SIP requests on
  4564. UDP port 3890.
  4565. Handley, et al. Standards Track [Page 119]
  4566. RFC 2543 SIP: Session Initiation Protocol March 1999
  4567. C->S: REGISTER sip:bell-tel.com SIP/2.0
  4568. Via: SIP/2.0/UDP saturn.bell-tel.com
  4569. From: sip:watson@bell-tel.com
  4570. To: sip:watson@bell-tel.com
  4571. Call-ID: 70710@saturn.bell-tel.com
  4572. CSeq: 1 REGISTER
  4573. Contact: <sip:watson@saturn.bell-tel.com:3890;transport=udp>
  4574. Expires: 7200
  4575. The registration expires after two hours. Any future invitations for
  4576. watson@bell-tel.com arriving at sip.bell-tel.com will now be
  4577. redirected to watson@saturn.bell-tel.com, UDP port 3890.
  4578. If Watson wants to be reached elsewhere, say, an on-line service he
  4579. uses while traveling, he updates his reservation after first
  4580. cancelling any existing locations:
  4581. C->S: REGISTER sip:bell-tel.com SIP/2.0
  4582. Via: SIP/2.0/UDP saturn.bell-tel.com
  4583. From: sip:watson@bell-tel.com
  4584. To: sip:watson@bell-tel.com
  4585. Call-ID: 70710@saturn.bell-tel.com
  4586. CSeq: 2 REGISTER
  4587. Contact: *
  4588. Expires: 0
  4589. C->S: REGISTER sip:bell-tel.com SIP/2.0
  4590. Via: SIP/2.0/UDP saturn.bell-tel.com
  4591. From: sip:watson@bell-tel.com
  4592. To: sip:watson@bell-tel.com
  4593. Call-ID: 70710@saturn.bell-tel.com
  4594. CSeq: 3 REGISTER
  4595. Contact: sip:tawatson@example.com
  4596. Now, the server will forward any request for Watson to the server at
  4597. example.com, using the Request-URI tawatson@example.com. For the
  4598. server at example.com to reach Watson, he will need to send a
  4599. REGISTER there, or inform the server of his current location through
  4600. some other means.
  4601. It is possible to use third-party registration. Here, the secretary
  4602. jon.diligent registers his boss, T. Watson:
  4603. Handley, et al. Standards Track [Page 120]
  4604. RFC 2543 SIP: Session Initiation Protocol March 1999
  4605. C->S: REGISTER sip:bell-tel.com SIP/2.0
  4606. Via: SIP/2.0/UDP pluto.bell-tel.com
  4607. From: sip:jon.diligent@bell-tel.com
  4608. To: sip:watson@bell-tel.com
  4609. Call-ID: 17320@pluto.bell-tel.com
  4610. CSeq: 1 REGISTER
  4611. Contact: sip:tawatson@example.com
  4612. The request could be sent to either the registrar at bell-tel.com or
  4613. the server at example.com. In the latter case, the server at
  4614. example.com would proxy the request to the address indicated in the
  4615. Request-URI. Then, Max-Forwards header could be used to restrict the
  4616. registration to that server.
  4617. 16.2 Invitation to a Multicast Conference
  4618. The first example invites schooler@vlsi.cs.caltech.edu to a multicast
  4619. session. All examples use the Session Description Protocol (SDP) (RFC
  4620. 2327 [6]) as the session description format.
  4621. 16.2.1 Request
  4622. C->S: INVITE sip:schooler@cs.caltech.edu SIP/2.0
  4623. Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348
  4624. ;maddr=239.128.16.254;ttl=16
  4625. Via: SIP/2.0/UDP north.east.isi.edu
  4626. From: Mark Handley <sip:mjh@isi.edu>
  4627. To: Eve Schooler <sip:schooler@caltech.edu>
  4628. Call-ID: 2963313058@north.east.isi.edu
  4629. CSeq: 1 INVITE
  4630. Subject: SIP will be discussed, too
  4631. Content-Type: application/sdp
  4632. Content-Length: 187
  4633. v=0
  4634. o=user1 53655765 2353687637 IN IP4 128.3.4.5
  4635. s=Mbone Audio
  4636. i=Discussion of Mbone Engineering Issues
  4637. e=mbone@somewhere.com
  4638. c=IN IP4 224.2.0.1/127
  4639. t=0 0
  4640. m=audio 3456 RTP/AVP 0
  4641. Handley, et al. Standards Track [Page 121]
  4642. RFC 2543 SIP: Session Initiation Protocol March 1999
  4643. The From request header above states that the request was initiated
  4644. by mjh@isi.edu and addressed to schooler@caltech.edu (From header
  4645. fields). The Via fields list the hosts along the path from invitation
  4646. initiator (the last element of the list) towards the callee. In the
  4647. example above, the message was last multicast to the administratively
  4648. scoped group 239.128.16.254 with a ttl of 16 from the host
  4649. csvax.cs.caltech.edu. The second Via header field indicates that it
  4650. was originally sent from the host north.east.isi.edu. The Request-URI
  4651. indicates that the request is currently being being addressed to
  4652. schooler@cs.caltech.edu, the local address that csvax looked up for
  4653. the callee.
  4654. In this case, the session description is using the Session
  4655. Description Protocol (SDP), as stated in the Content-Type header.
  4656. The header is terminated by an empty line and is followed by a
  4657. message body containing the session description.
  4658. 16.2.2 Response
  4659. The called user agent, directly or indirectly through proxy servers,
  4660. indicates that it is alerting ("ringing") the called party:
  4661. S->C: SIP/2.0 180 Ringing
  4662. Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348
  4663. ;maddr=239.128.16.254;ttl=16
  4664. Via: SIP/2.0/UDP north.east.isi.edu
  4665. From: Mark Handley <sip:mjh@isi.edu>
  4666. To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472
  4667. Call-ID: 2963313058@north.east.isi.edu
  4668. CSeq: 1 INVITE
  4669. A sample response to the invitation is given below. The first line of
  4670. the response states the SIP version number, that it is a 200 (OK)
  4671. response, which means the request was successful. The Via headers are
  4672. taken from the request, and entries are removed hop by hop as the
  4673. response retraces the path of the request. A new authentication field
  4674. MAY be added by the invited user's agent if required. The Call-ID is
  4675. taken directly from the original request, along with the remaining
  4676. fields of the request message. The original sense of From field is
  4677. preserved (i.e., it is the session initiator).
  4678. In addition, the Contact header gives details of the host where the
  4679. user was located, or alternatively the relevant proxy contact point
  4680. which should be reachable from the caller's host.
  4681. Handley, et al. Standards Track [Page 122]
  4682. RFC 2543 SIP: Session Initiation Protocol March 1999
  4683. S->C: SIP/2.0 200 OK
  4684. Via: SIP/2.0/UDP csvax.cs.caltech.edu;branch=8348
  4685. ;maddr=239.128.16.254;ttl=16
  4686. Via: SIP/2.0/UDP north.east.isi.edu
  4687. From: Mark Handley <sip:mjh@isi.edu>
  4688. To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472
  4689. Call-ID: 2963313058@north.east.isi.edu
  4690. CSeq: 1 INVITE
  4691. Contact: sip:es@jove.cs.caltech.edu
  4692. The caller confirms the invitation by sending an ACK request to the
  4693. location named in the Contact header:
  4694. C->S: ACK sip:es@jove.cs.caltech.edu SIP/2.0
  4695. Via: SIP/2.0/UDP north.east.isi.edu
  4696. From: Mark Handley <sip:mjh@isi.edu>
  4697. To: Eve Schooler <sip:schooler@caltech.edu> ;tag=9883472
  4698. Call-ID: 2963313058@north.east.isi.edu
  4699. CSeq: 1 ACK
  4700. 16.3 Two-party Call
  4701. For two-party Internet phone calls, the response must contain a
  4702. description of where to send the data. In the example below, Bell
  4703. calls Watson. Bell indicates that he can receive RTP audio codings 0
  4704. (PCMU), 3 (GSM), 4 (G.723) and 5 (DVI4).
  4705. C->S: INVITE sip:watson@boston.bell-tel.com SIP/2.0
  4706. Via: SIP/2.0/UDP kton.bell-tel.com
  4707. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4708. To: T. Watson <sip:watson@bell-tel.com>
  4709. Call-ID: 3298420296@kton.bell-tel.com
  4710. CSeq: 1 INVITE
  4711. Subject: Mr. Watson, come here.
  4712. Content-Type: application/sdp
  4713. Content-Length: ...
  4714. v=0
  4715. o=bell 53655765 2353687637 IN IP4 128.3.4.5
  4716. s=Mr. Watson, come here.
  4717. c=IN IP4 kton.bell-tel.com
  4718. m=audio 3456 RTP/AVP 0 3 4 5
  4719. Handley, et al. Standards Track [Page 123]
  4720. RFC 2543 SIP: Session Initiation Protocol March 1999
  4721. S->C: SIP/2.0 100 Trying
  4722. Via: SIP/2.0/UDP kton.bell-tel.com
  4723. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4724. To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4725. Call-ID: 3298420296@kton.bell-tel.com
  4726. CSeq: 1 INVITE
  4727. Content-Length: 0
  4728. S->C: SIP/2.0 180 Ringing
  4729. Via: SIP/2.0/UDP kton.bell-tel.com
  4730. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4731. To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4732. Call-ID: 3298420296@kton.bell-tel.com
  4733. CSeq: 1 INVITE
  4734. Content-Length: 0
  4735. S->C: SIP/2.0 182 Queued, 2 callers ahead
  4736. Via: SIP/2.0/UDP kton.bell-tel.com
  4737. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4738. To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4739. Call-ID: 3298420296@kton.bell-tel.com
  4740. CSeq: 1 INVITE
  4741. Content-Length: 0
  4742. S->C: SIP/2.0 182 Queued, 1 caller ahead
  4743. Via: SIP/2.0/UDP kton.bell-tel.com
  4744. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4745. To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4746. Call-ID: 3298420296@kton.bell-tel.com
  4747. CSeq: 1 INVITE
  4748. Content-Length: 0
  4749. S->C: SIP/2.0 200 OK
  4750. Via: SIP/2.0/UDP kton.bell-tel.com
  4751. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4752. To: <sip:watson@bell-tel.com> ;tag=37462311
  4753. Call-ID: 3298420296@kton.bell-tel.com
  4754. CSeq: 1 INVITE
  4755. Contact: sip:watson@boston.bell-tel.com
  4756. Content-Type: application/sdp
  4757. Content-Length: ...
  4758. v=0
  4759. o=watson 4858949 4858949 IN IP4 192.1.2.3
  4760. s=I'm on my way
  4761. c=IN IP4 boston.bell-tel.com
  4762. m=audio 5004 RTP/AVP 0 3
  4763. Handley, et al. Standards Track [Page 124]
  4764. RFC 2543 SIP: Session Initiation Protocol March 1999
  4765. The example illustrates the use of informational status responses.
  4766. Here, the reception of the call is confirmed immediately (100), then,
  4767. possibly after some database mapping delay, the call rings (180) and
  4768. is then queued, with periodic status updates.
  4769. Watson can only receive PCMU and GSM. Note that Watson's list of
  4770. codecs may or may not be a subset of the one offered by Bell, as each
  4771. party indicates the data types it is willing to receive. Watson will
  4772. send audio data to port 3456 at c.bell-tel.com, Bell will send to
  4773. port 5004 at boston.bell-tel.com.
  4774. By default, the media session is one RTP session. Watson will receive
  4775. RTCP packets on port 5005, while Bell will receive them on port 3457.
  4776. Since the two sides have agreed on the set of media, Bell confirms
  4777. the call without enclosing another session description:
  4778. C->S: ACK sip:watson@boston.bell-tel.com SIP/2.0
  4779. Via: SIP/2.0/UDP kton.bell-tel.com
  4780. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4781. To: T. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4782. Call-ID: 3298420296@kton.bell-tel.com
  4783. CSeq: 1 ACK
  4784. 16.4 Terminating a Call
  4785. To terminate a call, caller or callee can send a BYE request:
  4786. C->S: BYE sip:watson@boston.bell-tel.com SIP/2.0
  4787. Via: SIP/2.0/UDP kton.bell-tel.com
  4788. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4789. To: T. A. Watson <sip:watson@bell-tel.com> ;tag=37462311
  4790. Call-ID: 3298420296@kton.bell-tel.com
  4791. CSeq: 2 BYE
  4792. If the callee wants to abort the call, it simply reverses the To and
  4793. From fields. Note that it is unlikely that a BYE from the callee will
  4794. traverse the same proxies as the original INVITE.
  4795. Handley, et al. Standards Track [Page 125]
  4796. RFC 2543 SIP: Session Initiation Protocol March 1999
  4797. 16.5 Forking Proxy
  4798. In this example, Bell (a.g.bell@bell-tel.com) (C), currently seated
  4799. at host c.bell-tel.com wants to call Watson (t.watson@ieee.org). At
  4800. the time of the call, Watson is logged in at two workstations,
  4801. t.watson@x.bell-tel.com (X) and watson@y.bell-tel.com (Y), and has
  4802. registered with the IEEE proxy server (P) called sip.ieee.org. The
  4803. IEEE server also has a registration for the home machine of Watson,
  4804. at watson@h.bell-tel.com (H), as well as a permanent registration at
  4805. watson@acm.org (A). For brevity, the examples omit the session
  4806. description and Via header fields.
  4807. Bell's user agent sends the invitation to the SIP server for the
  4808. ieee.org domain:
  4809. C->P: INVITE sip:t.watson@ieee.org SIP/2.0
  4810. Via: SIP/2.0/UDP c.bell-tel.com
  4811. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4812. To: T. Watson <sip:t.watson@ieee.org>
  4813. Call-ID: 31415@c.bell-tel.com
  4814. CSeq: 1 INVITE
  4815. The SIP server at ieee.org tries the four addresses in parallel. It
  4816. sends the following message to the home machine:
  4817. P->H: INVITE sip:watson@h.bell-tel.com SIP/2.0
  4818. Via: SIP/2.0/UDP sip.ieee.org ;branch=1
  4819. Via: SIP/2.0/UDP c.bell-tel.com
  4820. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4821. To: T. Watson <sip:t.watson@ieee.org>
  4822. Call-ID: 31415@c.bell-tel.com
  4823. CSeq: 1 INVITE
  4824. This request immediately yields a 404 (Not Found) response, since
  4825. Watson is not currently logged in at home:
  4826. H->P: SIP/2.0 404 Not Found
  4827. Via: SIP/2.0/UDP sip.ieee.org ;branch=1
  4828. Via: SIP/2.0/UDP c.bell-tel.com
  4829. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4830. To: T. Watson <sip:t.watson@ieee.org>;tag=87454273
  4831. Handley, et al. Standards Track [Page 126]
  4832. RFC 2543 SIP: Session Initiation Protocol March 1999
  4833. Call-ID: 31415@c.bell-tel.com
  4834. CSeq: 1 INVITE
  4835. The proxy ACKs the response so that host H can stop retransmitting
  4836. it:
  4837. P->H: ACK sip:watson@h.bell-tel.com SIP/2.0
  4838. Via: SIP/2.0/UDP sip.ieee.org ;branch=1
  4839. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4840. To: T. Watson <sip:t.watson@ieee.org>;tag=87454273
  4841. Call-ID: 31415@c.bell-tel.com
  4842. CSeq: 1 ACK
  4843. Also, P attempts to reach Watson through the ACM server:
  4844. P->A: INVITE sip:watson@acm.org SIP/2.0
  4845. Via: SIP/2.0/UDP sip.ieee.org ;branch=2
  4846. Via: SIP/2.0/UDP c.bell-tel.com
  4847. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4848. To: T. Watson <sip:t.watson@ieee.org>
  4849. Call-ID: 31415@c.bell-tel.com
  4850. CSeq: 1 INVITE
  4851. In parallel, the next attempt proceeds, with an INVITE to X and Y:
  4852. P->X: INVITE sip:t.watson@x.bell-tel.com SIP/2.0
  4853. Via: SIP/2.0/UDP sip.ieee.org ;branch=3
  4854. Via: SIP/2.0/UDP c.bell-tel.com
  4855. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4856. To: T. Watson <sip:t.watson@ieee.org>
  4857. Call-ID: 31415@c.bell-tel.com
  4858. CSeq: 1 INVITE
  4859. P->Y: INVITE sip:watson@y.bell-tel.com SIP/2.0
  4860. Via: SIP/2.0/UDP sip.ieee.org ;branch=4
  4861. Via: SIP/2.0/UDP c.bell-tel.com
  4862. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4863. To: T. Watson <sip:t.watson@ieee.org>
  4864. Call-ID: 31415@c.bell-tel.com
  4865. CSeq: 1 INVITE
  4866. Handley, et al. Standards Track [Page 127]
  4867. RFC 2543 SIP: Session Initiation Protocol March 1999
  4868. As it happens, both Watson at X and a colleague in the other lab at
  4869. host Y hear the phones ringing and pick up. Both X and Y return 200s
  4870. via the proxy to Bell.
  4871. X->P: SIP/2.0 200 OK
  4872. Via: SIP/2.0/UDP sip.ieee.org ;branch=3
  4873. Via: SIP/2.0/UDP c.bell-tel.com
  4874. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4875. To: T. Watson <sip:t.watson@ieee.org> ;tag=192137601
  4876. Call-ID: 31415@c.bell-tel.com
  4877. CSeq: 1 INVITE
  4878. Contact: sip:t.watson@x.bell-tel.com
  4879. Y->P: SIP/2.0 200 OK
  4880. Via: SIP/2.0/UDP sip.ieee.org ;branch=4
  4881. Via: SIP/2.0/UDP c.bell-tel.com
  4882. Contact: sip:t.watson@y.bell-tel.com
  4883. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4884. To: T. Watson <sip:t.watson@ieee.org> ;tag=35253448
  4885. Call-ID: 31415@c.bell-tel.com
  4886. CSeq: 1 INVITE
  4887. Both responses are forwarded to Bell, using the Via information. At
  4888. this point, the ACM server is still searching its database. P can now
  4889. cancel this attempt:
  4890. P->A: CANCEL sip:watson@acm.org SIP/2.0
  4891. Via: SIP/2.0/UDP sip.ieee.org ;branch=2
  4892. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4893. To: T. Watson <sip:t.watson@ieee.org>
  4894. Call-ID: 31415@c.bell-tel.com
  4895. CSeq: 1 CANCEL
  4896. The ACM server gladly stops its neural-network database search and
  4897. responds with a 200. The 200 will not travel any further, since P is
  4898. the last Via stop.
  4899. A->P: SIP/2.0 200 OK
  4900. Via: SIP/2.0/UDP sip.ieee.org ;branch=2
  4901. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4902. To: T. Watson <sip:t.watson@ieee.org>
  4903. Handley, et al. Standards Track [Page 128]
  4904. RFC 2543 SIP: Session Initiation Protocol March 1999
  4905. Call-ID: 31415@c.bell-tel.com
  4906. CSeq: 1 CANCEL
  4907. Bell gets the two 200 responses from X and Y in short order. Bell's
  4908. reaction now depends on his software. He can either send an ACK to
  4909. both if human intelligence is needed to determine who he wants to
  4910. talk to or he can automatically reject one of the two calls. Here, he
  4911. acknowledges both, separately and directly to the final destination:
  4912. C->X: ACK sip:t.watson@x.bell-tel.com SIP/2.0
  4913. Via: SIP/2.0/UDP c.bell-tel.com
  4914. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4915. To: T. Watson <sip:t.watson@ieee.org>;tag=192137601
  4916. Call-ID: 31415@c.bell-tel.com
  4917. CSeq: 1 ACK
  4918. C->Y: ACK sip:watson@y.bell-tel.com SIP/2.0
  4919. Via: SIP/2.0/UDP c.bell-tel.com
  4920. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4921. To: T. Watson <sip:t.watson@ieee.org>;tag=35253448
  4922. Call-ID: 31415@c.bell-tel.com
  4923. CSeq: 1 ACK
  4924. After a brief discussion between Bell with X and Y, it becomes clear
  4925. that Watson is at X. (Note that this is not a three-way call; only
  4926. Bell can talk to X and Y, but X and Y cannot talk to each other.)
  4927. Thus, Bell sends a BYE to Y, which is replied to:
  4928. C->Y: BYE sip:watson@y.bell-tel.com SIP/2.0
  4929. Via: SIP/2.0/UDP c.bell-tel.com
  4930. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4931. To: T. Watson <sip:t.watson@ieee.org>;tag=35253448
  4932. Call-ID: 31415@c.bell-tel.com
  4933. CSeq: 2 BYE
  4934. Y->C: SIP/2.0 200 OK
  4935. Via: SIP/2.0/UDP c.bell-tel.com
  4936. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4937. To: T. Watson <sip:t.watson@ieee.org>;tag=35253448
  4938. Call-ID: 31415@c.bell-tel.com
  4939. CSeq: 2 BYE
  4940. Handley, et al. Standards Track [Page 129]
  4941. RFC 2543 SIP: Session Initiation Protocol March 1999
  4942. 16.6 Redirects
  4943. Replies with status codes 301 (Moved Permanently) or 302 (Moved
  4944. Temporarily) specify another location using the Contact field.
  4945. Continuing our earlier example, the server P at ieee.org decides to
  4946. redirect rather than proxy the request:
  4947. P->C: SIP/2.0 302 Moved temporarily
  4948. Via: SIP/2.0/UDP c.bell-tel.com
  4949. From: A. Bell <sip:a.g.bell@bell-tel.com>
  4950. To: T. Watson <sip:t.watson@ieee.org>;tag=72538263
  4951. Call-ID: 31415@c.bell-tel.com
  4952. CSeq: 1 INVITE
  4953. Contact: sip:watson@h.bell-tel.com,
  4954. sip:watson@acm.org, sip:t.watson@x.bell-tel.com,
  4955. sip:watson@y.bell-tel.com
  4956. CSeq: 1 INVITE
  4957. As another example, assume Alice (A) wants to delegate her calls to
  4958. Bob (B) while she is on vacation until July 29th, 1998. Any calls
  4959. meant for her will reach Bob with Alice's To field, indicating to him
  4960. what role he is to play. Charlie (C) calls Alice (A), whose server
  4961. returns:
  4962. A->C: SIP/2.0 302 Moved temporarily
  4963. From: Charlie <sip:charlie@caller.com>
  4964. To: Alice <sip:alice@anywhere.com> ;tag=2332462
  4965. Call-ID: 27182@caller.com
  4966. Contact: sip:bob@anywhere.com
  4967. Expires: Wed, 29 Jul 1998 9:00:00 GMT
  4968. CSeq: 1 INVITE
  4969. Charlie then sends the following request to the SIP server of the
  4970. anywhere.com domain. Note that the server at anywhere.com forwards
  4971. the request to Bob based on the Request-URI.
  4972. C->B: INVITE sip:bob@anywhere.com SIP/2.0
  4973. From: sip:charlie@caller.com
  4974. To: sip:alice@anywhere.com
  4975. Call-ID: 27182@caller.com
  4976. CSeq: 2 INVITE
  4977. Handley, et al. Standards Track [Page 130]
  4978. RFC 2543 SIP: Session Initiation Protocol March 1999
  4979. In the third redirection example, we assume that all outgoing
  4980. requests are directed through a local firewall F at caller.com, with
  4981. Charlie again inviting Alice:
  4982. C->F: INVITE sip:alice@anywhere.com SIP/2.0
  4983. From: sip:charlie@caller.com
  4984. To: Alice <sip:alice@anywhere.com>
  4985. Call-ID: 27182@caller.com
  4986. CSeq: 1 INVITE
  4987. The local firewall at caller.com happens to be overloaded and thus
  4988. redirects the call from Charlie to a secondary server S:
  4989. F->C: SIP/2.0 302 Moved temporarily
  4990. From: sip:charlie@caller.com
  4991. To: Alice <sip:alice@anywhere.com>
  4992. Call-ID: 27182@caller.com
  4993. CSeq: 1 INVITE
  4994. Contact: <sip:alice@anywhere.com:5080;maddr=spare.caller.com>
  4995. Based on this response, Charlie directs the same invitation to the
  4996. secondary server spare.caller.com at port 5080, but maintains the
  4997. same Request-URI as before:
  4998. C->S: INVITE sip:alice@anywhere.com SIP/2.0
  4999. From: sip:charlie@caller.com
  5000. To: Alice <sip:alice@anywhere.com>
  5001. Call-ID: 27182@caller.com
  5002. CSeq: 2 INVITE
  5003. 16.7 Negotiation
  5004. An example of a 606 (Not Acceptable) response is:
  5005. S->C: SIP/2.0 606 Not Acceptable
  5006. From: sip:mjh@isi.edu
  5007. To: <sip:schooler@cs.caltech.edu> ;tag=7434264
  5008. Call-ID: 14142@north.east.isi.edu
  5009. Handley, et al. Standards Track [Page 131]
  5010. RFC 2543 SIP: Session Initiation Protocol March 1999
  5011. CSeq: 1 INVITE
  5012. Contact: sip:mjh@north.east.isi.edu
  5013. Warning: 370 "Insufficient bandwidth (only have ISDN)",
  5014. 305 "Incompatible media format",
  5015. 330 "Multicast not available"
  5016. Content-Type: application/sdp
  5017. Content-Length: 50
  5018. v=0
  5019. s=Let's talk
  5020. b=CT:128
  5021. c=IN IP4 north.east.isi.edu
  5022. m=audio 3456 RTP/AVP 5 0 7
  5023. m=video 2232 RTP/AVP 31
  5024. In this example, the original request specified a bandwidth that was
  5025. higher than the access link could support, requested multicast, and
  5026. requested a set of media encodings. The response states that only 128
  5027. kb/s is available and that (only) DVI, PCM or LPC audio could be
  5028. supported in order of preference.
  5029. The response also states that multicast is not available. In such a
  5030. case, it might be appropriate to set up a transcoding gateway and
  5031. re-invite the user.
  5032. 16.8 OPTIONS Request
  5033. A caller Alice can use an OPTIONS request to find out the
  5034. capabilities of a potential callee Bob, without "ringing" the
  5035. designated address. Bob returns a description indicating that he is
  5036. capable of receiving audio encodings PCM Ulaw (payload type 0), 1016
  5037. (payload type 1), GSM (payload type 3), and SX7300/8000 (dynamic
  5038. payload type 99), and video encodings H.261 (payload type 31) and
  5039. H.263 (payload type 34).
  5040. C->S: OPTIONS sip:bob@example.com SIP/2.0
  5041. From: Alice <sip:alice@anywhere.org>
  5042. To: Bob <sip:bob@example.com>
  5043. Call-ID: 6378@host.anywhere.org
  5044. CSeq: 1 OPTIONS
  5045. Accept: application/sdp
  5046. S->C: SIP/2.0 200 OK
  5047. From: Alice <sip:alice@anywhere.org>
  5048. To: Bob <sip:bob@example.com> ;tag=376364382
  5049. Handley, et al. Standards Track [Page 132]
  5050. RFC 2543 SIP: Session Initiation Protocol March 1999
  5051. Call-ID: 6378@host.anywhere.org
  5052. Content-Length: 81
  5053. Content-Type: application/sdp
  5054. v=0
  5055. m=audio 0 RTP/AVP 0 1 3 99
  5056. m=video 0 RTP/AVP 31 34
  5057. a=rtpmap:99 SX7300/8000
  5058. Handley, et al. Standards Track [Page 133]
  5059. RFC 2543 SIP: Session Initiation Protocol March 1999
  5060. A Minimal Implementation
  5061. A.1 Client
  5062. All clients MUST be able to generate the INVITE and ACK requests.
  5063. Clients MUST generate and parse the Call-ID, Content-Length,
  5064. Content-Type, CSeq, From and To headers. Clients MUST also parse the
  5065. Require header. A minimal implementation MUST understand SDP (RFC
  5066. 2327, [6]). It MUST be able to recognize the status code classes 1
  5067. through 6 and act accordingly.
  5068. The following capability sets build on top of the minimal
  5069. implementation described in the previous paragraph. In general, each
  5070. capability listed below builds on the ones above it:
  5071. Basic: A basic implementation adds support for the BYE method to
  5072. allow the interruption of a pending call attempt. It includes a
  5073. User-Agent header in its requests and indicates its preferred
  5074. language in the Accept-Language header.
  5075. Redirection: To support call forwarding, a client needs to be able to
  5076. understand the Contact header, but only the SIP-URL part, not
  5077. the parameters.
  5078. Firewall-friendly: A firewall-friendly client understands the Route
  5079. and Record-Route header fields and can be configured to use a
  5080. local proxy for all outgoing requests.
  5081. Negotiation: A client MUST be able to request the OPTIONS method and
  5082. understand the 380 (Alternative Service) status and the Contact
  5083. parameters to participate in terminal and media negotiation. It
  5084. SHOULD be able to parse the Warning response header to provide
  5085. useful feedback to the caller.
  5086. Authentication: If a client wishes to invite callees that require
  5087. caller authentication, it MUST be able to recognize the 401
  5088. (Unauthorized) status code, MUST be able to generate the
  5089. Authorization request header and MUST understand the WWW-
  5090. Authenticate response header.
  5091. If a client wishes to use proxies that require caller authentication,
  5092. it MUST be able to recognize the 407 (Proxy Authentication Required)
  5093. status code, MUST be able to generate the Proxy-Authorization request
  5094. header and understand the Proxy-Authenticate response header.
  5095. Handley, et al. Standards Track [Page 134]
  5096. RFC 2543 SIP: Session Initiation Protocol March 1999
  5097. A.2 Server
  5098. A minimally compliant server implementation MUST understand the
  5099. INVITE, ACK, OPTIONS and BYE requests. A proxy server MUST also
  5100. understand CANCEL. It MUST parse and generate, as appropriate, the
  5101. Call-ID, Content-Length, Content-Type, CSeq, Expires, From, Max-
  5102. Forwards, Require, To and Via headers. It MUST echo the CSeq and
  5103. Timestamp headers in the response. It SHOULD include the Server
  5104. header in its responses.
  5105. A.3 Header Processing
  5106. Table 6 lists the headers that different implementations support. UAC
  5107. refers to a user-agent client (calling user agent), UAS to a user-
  5108. agent server (called user-agent).
  5109. The fields in the table have the following meaning. Type is as in
  5110. Table 4 and 5. "-" indicates the field is not meaningful to this
  5111. system (although it might be generated by it). "m" indicates the
  5112. field MUST be understood. "b" indicates the field SHOULD be
  5113. understood by a Basic implementation. "r" indicates the field SHOULD
  5114. be understood if the system claims to understand redirection. "a"
  5115. indicates the field SHOULD be understood if the system claims to
  5116. support authentication. "e" indicates the field SHOULD be understood
  5117. if the system claims to support encryption. "o" indicates support of
  5118. the field is purely optional. Headers whose support is optional for
  5119. all implementations are not shown.
  5120. Handley, et al. Standards Track [Page 135]
  5121. RFC 2543 SIP: Session Initiation Protocol March 1999
  5122. type UAC proxy UAS registrar
  5123. _____________________________________________________
  5124. Accept R - o m m
  5125. Accept-Encoding R - - m m
  5126. Accept-Language R - b b b
  5127. Allow 405 o - - -
  5128. Authorization R a o a a
  5129. Call-ID g m m m m
  5130. Content-Encoding g m - m m
  5131. Content-Length g m m m m
  5132. Content-Type g m - m m
  5133. CSeq g m m m m
  5134. Encryption g e - e e
  5135. Expires g - o o m
  5136. From g m o m m
  5137. Hide R - m - -
  5138. Contact R - - - m
  5139. Contact r r r - -
  5140. Max-Forwards R - b - -
  5141. Proxy-Authenticate 407 a - - -
  5142. Proxy-Authorization R - a - -
  5143. Proxy-Require R - m - -
  5144. Require R m - m m
  5145. Response-Key R - - e e
  5146. Route R - m - -
  5147. Timestamp g o o m m
  5148. To g m m m m
  5149. Unsupported r b b - -
  5150. User-Agent g b - b -
  5151. Via g m m m m
  5152. WWW-Authenticate 401 a - - -
  5153. Table 6: Header Field Processing Requirements
  5154. B Usage of the Session Description Protocol (SDP)
  5155. This section describes the use of the Session Description Protocol
  5156. (SDP) (RFC 2327 [6]).
  5157. B.1 Configuring Media Streams
  5158. The caller and callee align their media descriptions so that the nth
  5159. media stream ("m=" line) in the caller's session description
  5160. corresponds to the nth media stream in the callee's description.
  5161. Handley, et al. Standards Track [Page 136]
  5162. RFC 2543 SIP: Session Initiation Protocol March 1999
  5163. All media descriptions SHOULD contain "a=rtpmap" mappings from RTP
  5164. payload types to encodings.
  5165. This allows easier migration away from static payload
  5166. types.
  5167. If the callee wants to neither send nor receive a stream offered by
  5168. the caller, the callee sets the port number of that stream to zero in
  5169. its media description.
  5170. There currently is no other way than port zero for the
  5171. callee to refuse a bidirectional stream offered by the
  5172. caller. Both caller and callee need to be aware what media
  5173. tools are to be started.
  5174. For example, assume that the caller Alice has included the following
  5175. description in her INVITE request. It includes an audio stream and
  5176. two bidirectional video streams, using H.261 (payload type 31) and
  5177. MPEG (payload type 32).
  5178. v=0
  5179. o=alice 2890844526 2890844526 IN IP4 host.anywhere.com
  5180. c=IN IP4 host.anywhere.com
  5181. m=audio 49170 RTP/AVP 0
  5182. a=rtpmap:0 PCMU/8000
  5183. m=video 51372 RTP/AVP 31
  5184. a=rtpmap:31 H261/90000
  5185. m=video 53000 RTP/AVP 32
  5186. a=rtpmap:32 MPV/90000
  5187. The callee, Bob, does not want to receive or send the first video
  5188. stream, so it returns the media description below:
  5189. v=0
  5190. o=bob 2890844730 2890844730 IN IP4 host.example.com
  5191. c=IN IP4 host.example.com
  5192. m=audio 47920 RTP/AVP 0 1
  5193. a=rtpmap:0 PCMU/8000
  5194. a=rtpmap:1 1016/8000
  5195. m=video 0 RTP/AVP 31
  5196. m=video 53000 RTP/AVP 32
  5197. a=rtpmap:32 MPV/90000
  5198. Handley, et al. Standards Track [Page 137]
  5199. RFC 2543 SIP: Session Initiation Protocol March 1999
  5200. B.2 Setting SDP Values for Unicast
  5201. If a session description from a caller contains a media stream which
  5202. is listed as send (receive) only, it means that the caller is only
  5203. willing to send (receive) this stream, not receive (send). The same
  5204. is true for the callee.
  5205. For receive-only and send-or-receive streams, the port number and
  5206. address in the session description indicate where the media stream
  5207. should be sent to by the recipient of the session description, either
  5208. caller or callee. For send-only streams, the address and port number
  5209. have no significance and SHOULD be set to zero.
  5210. The list of payload types for each media stream conveys two pieces of
  5211. information, namely the set of codecs that the caller or callee is
  5212. capable of sending or receiving, and the RTP payload type numbers
  5213. used to identify those codecs. For receive-only or send-and-receive
  5214. media streams, a caller SHOULD list all of the codecs it is capable
  5215. of supporting in the session description in an INVITE or ACK. For
  5216. send-only streams, the caller SHOULD indicate only those it wishes to
  5217. send for this session. For receive-only streams, the payload type
  5218. numbers indicate the value of the payload type field in RTP packets
  5219. the caller is expecting to receive for that codec type. For send-only
  5220. streams, the payload type numbers indicate the value of the payload
  5221. type field in RTP packets the caller is planning to send for that
  5222. codec type. For send-and-receive streams, the payload type numbers
  5223. indicate the value of the payload type field the caller expects to
  5224. both send and receive.
  5225. If a media stream is listed as receive-only by the caller, the callee
  5226. lists, in the response, those codecs it intends to use from among the
  5227. ones listed in the request. If a media stream is listed as send-only
  5228. by the caller, the callee lists, in the response, those codecs it is
  5229. willing to receive among the ones listed in the the request. If the
  5230. media stream is listed as both send and receive, the callee lists
  5231. those codecs it is capable of sending or receiving among the ones
  5232. listed by the caller in the INVITE. The actual payload type numbers
  5233. in the callee's session description corresponding to a particular
  5234. codec MUST be the same as the caller's session description.
  5235. If caller and callee have no media formats in common for a particular
  5236. stream, the callee MUST return a session description containing the
  5237. particular "m=" line, but with the port number set to zero, and no
  5238. payload types listed.
  5239. If there are no media formats in common for all streams, the callee
  5240. SHOULD return a 400 response, with a 304 Warning header field.
  5241. Handley, et al. Standards Track [Page 138]
  5242. RFC 2543 SIP: Session Initiation Protocol March 1999
  5243. B.3 Multicast Operation
  5244. The interpretation of send-only and receive-only for multicast media
  5245. sessions differs from that for unicast sessions. For multicast,
  5246. send-only means that the recipient of the session description (caller
  5247. or callee) SHOULD only send media streams to the address and port
  5248. indicated. Receive-only means that the recipient of the session
  5249. description SHOULD only receive media on the address and port
  5250. indicated.
  5251. For multicast, receive and send multicast addresses are the same and
  5252. all parties use the same port numbers to receive media data. If the
  5253. session description provided by the caller is acceptable to the
  5254. callee, the callee can choose not to include a session description or
  5255. MAY echo the description in the response.
  5256. A callee MAY, in the response, return a session description with some
  5257. of the payload types removed, or port numbers set to zero (but no
  5258. other value). This indicates to the caller that the callee does not
  5259. support the given stream or media types which were removed. A callee
  5260. MUST NOT change whether a given stream is send-only, receive-only, or
  5261. send-and-receive.
  5262. If a callee does not support multicast at all, it SHOULD return a 400
  5263. status response and include a 330 Warning.
  5264. B.4 Delayed Media Streams
  5265. In some cases, a caller may not know the set of media formats which
  5266. it can support at the time it would like to issue an invitation. This
  5267. is the case when the caller is actually a gateway to another protocol
  5268. which performs media format negotiation after call setup. When this
  5269. occurs, a caller MAY issue an INVITE with a session description that
  5270. contains no media lines. The callee SHOULD interpret this to mean
  5271. that the caller wishes to participate in a multimedia session
  5272. described by the session description, but that the media streams are
  5273. not yet known. The callee SHOULD return a session description
  5274. indicating the streams and media formats it is willing to support,
  5275. however. The caller MAY update the session description either in the
  5276. ACK request or in a re-INVITE at a later time, once the streams are
  5277. known.
  5278. B.5 Putting Media Streams on Hold
  5279. If a party in a call wants to put the other party "on hold", i.e.,
  5280. request that it temporarily stops sending one or more media streams,
  5281. a party re-invites the other by sending an INVITE request with a
  5282. modified session description. The session description is the same as
  5283. Handley, et al. Standards Track [Page 139]
  5284. RFC 2543 SIP: Session Initiation Protocol March 1999
  5285. in the original invitation (or response), but the "c" destination
  5286. addresses for the media streams to be put on hold are set to zero
  5287. (0.0.0.0).
  5288. B.6 Subject and SDP "s=" Line
  5289. The SDP "s=" line and the SIP Subject header field have different
  5290. meanings when inviting to a multicast session. The session
  5291. description line describes the subject of the multicast session,
  5292. while the SIP Subject header field describes the reason for the
  5293. invitation. The example in Section 16.2 illustrates this point. For
  5294. invitations to two-party sessions, the SDP "s=" line MAY be left
  5295. empty.
  5296. B.7 The SDP "o=" Line
  5297. The "o=" line is not strictly necessary for two-party sessions, but
  5298. MUST be present to allow re-use of SDP-based tools.
  5299. Handley, et al. Standards Track [Page 140]
  5300. RFC 2543 SIP: Session Initiation Protocol March 1999
  5301. C Summary of Augmented BNF
  5302. All of the mechanisms specified in this document are described in
  5303. both prose and an augmented Backus-Naur Form (BNF) similar to that
  5304. used by RFC 822 [9]. Implementors will need to be familiar with the
  5305. notation in order to understand this specification. The augmented BNF
  5306. includes the following constructs:
  5307. name = definition
  5308. The name of a rule is simply the name itself (without any enclosing
  5309. "<" and ">") and is separated from its definition by the equal "="
  5310. character. White space is only significant in that indentation of
  5311. continuation lines is used to indicate a rule definition that spans
  5312. more than one line. Certain basic rules are in uppercase, such as SP,
  5313. LWS, HT, CRLF, DIGIT, ALPHA, etc. Angle brackets are used within
  5314. definitions whenever their presence will facilitate discerning the
  5315. use of rule names.
  5316. "literal"
  5317. Quotation marks surround literal text. Unless stated otherwise, the
  5318. text is case-insensitive.
  5319. rule1 | rule2
  5320. Elements separated by a bar ("|") are alternatives, e.g., "yes | no"
  5321. will accept yes or no.
  5322. (rule1 rule2)
  5323. Elements enclosed in parentheses are treated as a single element.
  5324. Thus, "(elem (foo | bar) elem)" allows the token sequences "elem foo
  5325. elem" and "elem bar elem".
  5326. Handley, et al. Standards Track [Page 141]
  5327. RFC 2543 SIP: Session Initiation Protocol March 1999
  5328. *rule
  5329. The character "*" preceding an element indicates repetition. The full
  5330. form is "<n>*<m>element" indicating at least <n> and at most <m>
  5331. occurrences of element. Default values are 0 and infinity so that
  5332. "*(element)" allows any number, including zero; "1*element" requires
  5333. at least one; and "1*2element" allows one or two.
  5334. [rule]
  5335. Square brackets enclose optional elements; "[foo bar]" is equivalent
  5336. to "*1(foo bar)".
  5337. N rule
  5338. Specific repetition: "<n>(element)" is equivalent to
  5339. "<n>*<n>(element)"; that is, exactly <n> occurrences of (element).
  5340. Thus 2DIGIT is a 2-digit number, and 3ALPHA is a string of three
  5341. alphabetic characters.
  5342. #rule
  5343. A construct "#" is defined, similar to "*", for defining lists of
  5344. elements. The full form is "<n>#<m> element" indicating at least <n>
  5345. and at most <m> elements, each separated by one or more commas (",")
  5346. and OPTIONAL linear white space (LWS). This makes the usual form of
  5347. lists very easy; a rule such as
  5348. ( *LWS element *( *LWS "," *LWS element ))
  5349. can be shown as 1# element. Wherever this construct is used, null
  5350. elements are allowed, but do not contribute to the count of elements
  5351. present. That is, "(element), , (element)" is permitted, but counts
  5352. as only two elements. Therefore, where at least one element is
  5353. required, at least one non-null element MUST be present. Default
  5354. values are 0 and infinity so that "#element" allows any number,
  5355. including zero; "1#element" requires at least one; and "1#2element"
  5356. allows one or two.
  5357. Handley, et al. Standards Track [Page 142]
  5358. RFC 2543 SIP: Session Initiation Protocol March 1999
  5359. ; comment
  5360. A semi-colon, set off some distance to the right of rule text, starts
  5361. a comment that continues to the end of line. This is a simple way of
  5362. including useful notes in parallel with the specifications.
  5363. implied *LWS
  5364. The grammar described by this specification is word-based. Except
  5365. where noted otherwise, linear white space (LWS) can be included
  5366. between any two adjacent words (token or quoted-string), and between
  5367. adjacent tokens and separators, without changing the interpretation
  5368. of a field. At least one delimiter (LWS and/or separators) MUST exist
  5369. between any two tokens (for the definition of "token" below), since
  5370. they would otherwise be interpreted as a single token.
  5371. C.1 Basic Rules
  5372. The following rules are used throughout this specification to
  5373. describe basic parsing constructs. The US-ASCII coded character set
  5374. is defined by ANSI X3.4-1986.
  5375. OCTET = <any 8-bit sequence of data>
  5376. CHAR = <any US-ASCII character (octets 0 - 127)>
  5377. upalpha = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" |
  5378. "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" |
  5379. "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z"
  5380. lowalpha = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" |
  5381. "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" |
  5382. "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
  5383. alpha = lowalpha | upalpha
  5384. digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" |
  5385. "8" | "9"
  5386. alphanum = alpha | digit
  5387. CTL = <any US-ASCII control character
  5388. (octets 0 -- 31) and DEL (127)>
  5389. CR = %d13 ; US-ASCII CR, carriage return character
  5390. LF = %d10 ; US-ASCII LF, line feed character
  5391. SP = %d32 ; US-ASCII SP, space character
  5392. HT = %d09 ; US-ASCII HT, horizontal tab character
  5393. CRLF = CR LF ; typically the end of a line
  5394. The following are defined in RFC 2396 [12] for the SIP URI:
  5395. Handley, et al. Standards Track [Page 143]
  5396. RFC 2543 SIP: Session Initiation Protocol March 1999
  5397. unreserved = alphanum | mark
  5398. mark = "-" | "_" | "." | "!" | "~" | "*" | "'"
  5399. | "(" | ")"
  5400. escaped = "%" hex hex
  5401. SIP header field values can be folded onto multiple lines if the
  5402. continuation line begins with a space or horizontal tab. All linear
  5403. white space, including folding, has the same semantics as SP. A
  5404. recipient MAY replace any linear white space with a single SP before
  5405. interpreting the field value or forwarding the message downstream.
  5406. LWS = [CRLF] 1*( SP | HT ) ; linear whitespace
  5407. The TEXT-UTF8 rule is only used for descriptive field contents and
  5408. values that are not intended to be interpreted by the message parser.
  5409. Words of *TEXT-UTF8 contain characters from the UTF-8 character set
  5410. (RFC 2279 [21]). In this regard, SIP differs from HTTP, which uses
  5411. the ISO 8859-1 character set.
  5412. TEXT-UTF8 = <any UTF-8 character encoding, except CTLs,
  5413. but including LWS>
  5414. A CRLF is allowed in the definition of TEXT-UTF8 only as part of a
  5415. header field continuation. It is expected that the folding LWS will
  5416. be replaced with a single SP before interpretation of the TEXT-UTF8
  5417. value.
  5418. Hexadecimal numeric characters are used in several protocol elements.
  5419. hex = "A" | "B" | "C" | "D" | "E" | "F"
  5420. | "a" | "b" | "c" | "d" | "e" | "f" | digit
  5421. Many SIP header field values consist of words separated by LWS or
  5422. special characters. These special characters MUST be in a quoted
  5423. string to be used within a parameter value.
  5424. Handley, et al. Standards Track [Page 144]
  5425. RFC 2543 SIP: Session Initiation Protocol March 1999
  5426. token = 1*< any CHAR except CTL's or separators>
  5427. separators = "(" | ")" | "<" | ">" | "@" |
  5428. "," | ";" | ":" | "\" | <"> |
  5429. "/" | "[" | "]" | "?" | "=" |
  5430. "{" | "}" | SP | HT
  5431. Comments can be included in some SIP header fields by surrounding the
  5432. comment text with parentheses. Comments are only allowed in fields
  5433. containing "comment" as part of their field value definition. In all
  5434. other fields, parentheses are considered part of the field value.
  5435. comment = "(" *(ctext | quoted-pair | comment) ")"
  5436. ctext = < any TEXT-UTF8 excluding "(" and ")">
  5437. A string of text is parsed as a single word if it is quoted using
  5438. double-quote marks.
  5439. quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
  5440. qdtext = <any TEXT-UTF8 except <">>
  5441. The backslash character ("\") MAY be used as a single-character
  5442. quoting mechanism only within quoted-string and comment constructs.
  5443. quoted-pair = " \ " CHAR
  5444. Handley, et al. Standards Track [Page 145]
  5445. RFC 2543 SIP: Session Initiation Protocol March 1999
  5446. D Using SRV DNS Records
  5447. The following procedure is experimental and relies on DNS SRV records
  5448. (RFC 2052 [14]). The steps listed below are used in place of the two
  5449. steps in section 1.4.2.
  5450. If a step elicits no addresses, the client continues to the next
  5451. step. However if a step elicits one or more addresses, but no SIP
  5452. server at any of those addresses responds, then the client concludes
  5453. the server is down and doesn't continue on to the next step.
  5454. When SRV records are to be used, the protocol to use when querying
  5455. for the SRV record is "sip". SRV records contain port numbers for
  5456. servers, in addition to IP addresses; the client always uses this
  5457. port number when contacting the SIP server. Otherwise, the port
  5458. number in the SIP URI is used, if present. If there is no port number
  5459. in the URI, the default port, 5060, is used.
  5460. 1. If the host portion of the Request-URI is an IP address,
  5461. the client contacts the server at the given address. If the
  5462. host portion of the Request-URI is not an IP address, the
  5463. client proceeds to the next step.
  5464. 2. The Request-URI is examined. If it contains an explicit
  5465. port number, the next two steps are skipped.
  5466. 3. The Request-URI is examined. If it does not specify a
  5467. protocol (TCP or UDP), the client queries the name server
  5468. for SRV records for both UDP (if supported by the client)
  5469. and TCP (if supported by the client) SIP servers. The
  5470. format of these queries is defined in RFC 2052 [14]. The
  5471. results of the query or queries are merged together and
  5472. ordered based on priority. Then, the searching technique
  5473. outlined in RFC 2052 [14] is used to select servers in
  5474. order. If DNS doesn't return any records, the user goes to
  5475. the last step. Otherwise, the user attempts to contact
  5476. each server in the order listed. If no server is
  5477. contacted, the user gives up.
  5478. 4. If the Request-URI specifies a protocol (TCP or UDP) that
  5479. is supported by the client, the client queries the name
  5480. server for SRV records for SIP servers of that protocol
  5481. type only. If the client does not support the protocol
  5482. specified in the Request-URI, it gives up. The searching
  5483. technique outlined in RFC 2052 [14] is used to select
  5484. servers from the DNS response in order. If DNS doesn't
  5485. Handley, et al. Standards Track [Page 146]
  5486. RFC 2543 SIP: Session Initiation Protocol March 1999
  5487. return any records, the user goes to the last step.
  5488. Otherwise, the user attempts to contact each server in the
  5489. order listed. If no server is contacted, the user gives up.
  5490. 5. The client queries the name server for address records for
  5491. the host portion of the Request-URI. If there were no
  5492. address records, the client stops, as it has been unable to
  5493. locate a server. By address record, we mean A RR's, AAAA
  5494. RR's, or their most modern equivalent.
  5495. A client MAY cache a successful DNS query result. A successful query
  5496. is one which contained records in the answer, and a server was
  5497. contacted at one of the addresses from the answer. When the client
  5498. wishes to send a request to the same host, it starts the search as if
  5499. it had just received this answer from the name server. The server
  5500. uses the procedures specified in RFC1035 [15] regarding cache
  5501. invalidation when the time-to-live of the DNS result expires. If the
  5502. client does not find a SIP server among the addresses listed in the
  5503. cached answer, it starts the search at the beginning of the sequence
  5504. described above.
  5505. For example, consider a client that wishes to send a SIP request. The
  5506. Request-URI for the destination is sip:user@company.com. The client
  5507. only supports UDP. It would follow these steps:
  5508. 1. The host portion is not an IP address, so the client goes
  5509. to step 2 above.
  5510. 2. The client does a DNS query of QNAME="sip.udp.company.com",
  5511. QCLASS=IN, QTYPE=SRV. Since it doesn't support TCP, it
  5512. omits the TCP query. There were no addresses in the DNS
  5513. response, so the client goes to the next step.
  5514. 3. The client does a DNS query for A records for
  5515. "company.com". An address is found, so that client attempts
  5516. to contact a server at that address at port 5060.
  5517. Handley, et al. Standards Track [Page 147]
  5518. RFC 2543 SIP: Session Initiation Protocol March 1999
  5519. E IANA Considerations
  5520. Section 4.4 describes a name space and mechanism for registering SIP
  5521. options.
  5522. Section 6.41 describes the name space for registering SIP warn-codes.
  5523. Handley, et al. Standards Track [Page 148]
  5524. RFC 2543 SIP: Session Initiation Protocol March 1999
  5525. F Acknowledgments
  5526. We wish to thank the members of the IETF MMUSIC WG for their comments
  5527. and suggestions. Detailed comments were provided by Anders
  5528. Kristensen, Jim Buller, Dave Devanathan, Yaron Goland, Christian
  5529. Huitema, Gadi Karmi, Jonathan Lennox, Keith Moore, Vern Paxson, Moshe
  5530. J. Sambol, and Eric Tremblay.
  5531. This work is based, inter alia, on [37,38].
  5532. G Authors' Addresses
  5533. Mark Handley
  5534. AT&T Center for Internet Research at ISCI (ACIRI)
  5535. 1947 Center St., Suite 600
  5536. Berkeley, CA 94704-119
  5537. USA
  5538. Email: mjh@aciri.org
  5539. Henning Schulzrinne
  5540. Dept. of Computer Science
  5541. Columbia University
  5542. 1214 Amsterdam Avenue
  5543. New York, NY 10027
  5544. USA
  5545. Email: schulzrinne@cs.columbia.edu
  5546. Eve Schooler
  5547. Computer Science Department 256-80
  5548. California Institute of Technology
  5549. Pasadena, CA 91125
  5550. USA
  5551. Email: schooler@cs.caltech.edu
  5552. Jonathan Rosenberg
  5553. Lucent Technologies, Bell Laboratories
  5554. Rm. 4C-526
  5555. 101 Crawfords Corner Road
  5556. Holmdel, NJ 07733
  5557. USA
  5558. Email: jdrosen@bell-labs.com
  5559. Handley, et al. Standards Track [Page 149]
  5560. RFC 2543 SIP: Session Initiation Protocol March 1999
  5561. H Bibliography
  5562. [1] Pandya, R., "Emerging mobile and personal communication systems,"
  5563. IEEE Communications Magazine , vol. 33, pp. 44--52, June 1995.
  5564. [2] Braden, B., Zhang, L., Berson, S., Herzog, S. and S. Jamin,
  5565. "Resource ReSerVation protocol (RSVP) -- version 1 functional
  5566. specification", RFC 2205, October 1997.
  5567. [3] Schulzrinne, H., Casner, S., Frederick, R. and V. Jacobson, "RTP:
  5568. a transport protocol for real-time applications", RFC 1889,
  5569. Internet Engineering Task Force, Jan. 1996.
  5570. [4] Schulzrinne, H., Lanphier, R. and A. Rao, "Real time streaming
  5571. protocol (RTSP)", RFC 2326, April 1998.
  5572. [5] Handley, M., "SAP: Session announcement protocol," Internet
  5573. Draft, Internet Engineering Task Force, Nov. 1996. Work in
  5574. progress.
  5575. [6] Handley, M. and V. Jacobson, "SDP: session description protocol",
  5576. RFC 2327, April 1998.
  5577. [7] International Telecommunication Union, "Visual telephone systems
  5578. and equipment for local area networks which provide a non-
  5579. guaranteed quality of service," Recommendation H.323,
  5580. Telecommunication Standardization Sector of ITU, Geneva,
  5581. Switzerland, May 1996.
  5582. [8] International Telecommunication Union, "Control protocol for
  5583. multimedia communication," Recommendation H.245,
  5584. Telecommunication Standardization Sector of ITU, Geneva,
  5585. Switzerland, Feb. 1998.
  5586. [9] International Telecommunication Union, "Media stream
  5587. packetization and synchronization on non-guaranteed quality of
  5588. service LANs," Recommendation H.225.0, Telecommunication
  5589. Standardization Sector of ITU, Geneva, Switzerland, Nov. 1996.
  5590. [10] Bradner, S., "Key words for use in RFCs to indicate requirement
  5591. levels", BCP 14, RFC 2119, Mardch 1997.
  5592. [11] Fielding, R., Gettys, J., Mogul, J., Nielsen, H. and T.
  5593. Berners-Lee, "Hypertext transfer protocol -- HTTP/1.1", RFC
  5594. 2068, January 1997.
  5595. [12] Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform resource
  5596. identifiers (URI): generic syntax", RFC 2396, August 1998.
  5597. Handley, et al. Standards Track [Page 150]
  5598. RFC 2543 SIP: Session Initiation Protocol March 1999
  5599. [13] Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform resource
  5600. locators (URL)", RFC 1738, December 1994.
  5601. [14] Gulbrandsen, A. and P. Vixie, "A DNS RR for specifying the
  5602. location of services (DNS SRV)", RFC 2052, October 1996.
  5603. [15] Mockapetris, P., "Domain names - implementation and
  5604. specification", STD 13, RFC 1035, Noveberm 1997.
  5605. [16] Hamilton, M. and R. Wright, "Use of DNS aliases for network
  5606. services", RFC 2219, October 1997.
  5607. [17] Zimmerman, D., "The finger user information protocol", RFC 1288,
  5608. December 1991.
  5609. [18] Williamson, S., Kosters, M., Blacka, D., Singh, J. and K.
  5610. Zeilstra, "Referral whois (rwhois) protocol V1.5", RFC 2167,
  5611. June 1997.
  5612. [19] Yeong, W., Howes, T. and S. Kille, "Lightweight directory access
  5613. protocol", RFC 1777, March 1995.
  5614. [20] Schooler, E., "A multicast user directory service for
  5615. synchronous rendezvous," Master's Thesis CS-TR-96-18, Department
  5616. of Computer Science, California Institute of Technology,
  5617. Pasadena, California, Aug. 1996.
  5618. [21] Yergeau, F., "UTF-8, a transformation format of ISO 10646", RFC
  5619. 2279, January 1998.
  5620. [22] Stevens, W., TCP/IP illustrated: the protocols , vol. 1.
  5621. Reading, Massachusetts: Addison-Wesley, 1994.
  5622. [23] Mogul, J. and S. Deering, "Path MTU discovery", RFC 1191,
  5623. November 1990.
  5624. [24] Crocker, D., "Standard for the format of ARPA internet text
  5625. messages", RFC STD 11, RFC 822, August 1982.
  5626. [25] Meyer, D., "Administratively scoped IP multicast", RFC 2365,
  5627. July 1998.
  5628. [26] Schulzrinne, H., "RTP profile for audio and video conferences
  5629. with minimal control", RFC 1890, January 1996
  5630. [27] Eastlake, D., Crocker, S. and J. Schiller, "Randomness
  5631. recommendations for security", RFC 1750, December 1994.
  5632. Handley, et al. Standards Track [Page 151]
  5633. RFC 2543 SIP: Session Initiation Protocol March 1999
  5634. [28] Hoffman, P., Masinter, L. and J. Zawinski, "The mailto URL
  5635. scheme", RFC 2368, July 1998.
  5636. [29] Braden, B., "Requirements for internet hosts - application and
  5637. support", STD 3, RFC 1123, October 1989.
  5638. [30] Palme, J., "Common internet message headers", RFC 2076, February
  5639. 1997.
  5640. [31] Alvestrand, H., "IETF policy on character sets and languages",
  5641. RFC 2277, January 1998.
  5642. [32] Elkins, M., "MIME security with pretty good privacy (PGP)", RFC
  5643. 2015, October 1996.
  5644. [33] Atkins, D., Stallings, W. and P. Zimmermann, "PGP message
  5645. exchange formats", RFC 1991, August 1996.
  5646. [34] Atkinson, R., "Security architecture for the internet protocol",
  5647. RFC 2401, November 1998.
  5648. [35] Allen, C. and T. Dierks, "The TLS protocol version 1.0," RFC
  5649. 2246, January 1999.
  5650. [36] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
  5651. Leach, P., Luotonen, A. and L. Stewart, "HTTP authentication:
  5652. Basic and digest access authentication," Internet Draft,
  5653. Internet Engineering Task Force, Sept. 1998. Work in progress.
  5654. [37] Schooler, E., "Case study: multimedia conference control in a
  5655. packet-switched teleconferencing system," Journal of
  5656. Internetworking: Research and Experience , vol. 4, pp. 99--120,
  5657. June 1993. ISI reprint series ISI/RS-93-359.
  5658. [38] Schulzrinne, H., "Personal mobility for multimedia services in
  5659. the Internet," in European Workshop on Interactive Distributed
  5660. Multimedia Systems and Services (IDMS) , (Berlin, Germany), Mar.
  5661. 1996.
  5662. Handley, et al. Standards Track [Page 152]
  5663. RFC 2543 SIP: Session Initiation Protocol March 1999
  5664. Full Copyright Statement
  5665. Copyright (C) The Internet Society (1999). All Rights Reserved.
  5666. This document and translations of it may be copied and furnished to
  5667. others, and derivative works that comment on or otherwise explain it
  5668. or assist in its implementation may be prepared, copied, published
  5669. and distributed, in whole or in part, without restriction of any
  5670. kind, provided that the above copyright notice and this paragraph are
  5671. included on all such copies and derivative works. However, this
  5672. document itself may not be modified in any way, such as by removing
  5673. the copyright notice or references to the Internet Society or other
  5674. Internet organizations, except as needed for the purpose of
  5675. developing Internet standards in which case the procedures for
  5676. copyrights defined in the Internet Standards process must be
  5677. followed, or as required to translate it into languages other than
  5678. English.
  5679. The limited permissions granted above are perpetual and will not be
  5680. revoked by the Internet Society or its successors or assigns.
  5681. This document and the information contained herein is provided on an
  5682. "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  5683. TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  5684. BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  5685. HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  5686. MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  5687. Handley, et al. Standards Track [Page 153]