https://tools.ietf.org/html/rfc3261


http://lukiji.egloos.com/v/3208737


개인 정리용이므로

아래의 내용보다는 위의 출처의 글을 보는것이 

더 도움이 될 수 있다.

Method에 대해 결정이 되면

그 다음에는 Header 필드에 필요한 정보를 채워서 

호를 처리하게 된다. 

이하 호 처리에 사용되는 Header에 대해서 정리한다.


한줄은 최대 998글자를 사용할 수 있고 78자 사용하는 것을 권고한다. (RFC 2822 2.1.1)

길면 멀티라인으로 표현할 수 있다. (RFC 2822 2.2.3)

멀티라인으로 표현되는 Header는 연속되어 있어야 하고, 한개만 사용할 수 있는 Header들도 있어서 주의해야함


2.1.1. Line Length Limits


   There are two limits that this standard places on the number of

   characters in a line. Each line of characters MUST be no more than

   998 characters, and SHOULD be no more than 78 characters, excluding

   the CRLF.


...

2.2.3. Long Header Fields


   Each header field is logically a single line of characters comprising

   the field name, the colon, and the field body.  For convenience

   however, and to deal with the 998/78 character limitations per line,

   the field body portion of a header field can be split into a multiple

   line representation; this is called "folding".  The general rule is

   that wherever this standard allows for folding white space (not

   simply WSP characters), a CRLF may be inserted before any WSP.  For

   example, the header field:


           Subject: This is a test


   can be represented as:


           Subject: This

            is a test

...



사용하는 해더 필드에서 각 열에 있는 정보에 대한 설명 "where", "proxy", "각 method" 3가지 영역

 

where 열

- R : Request만 사용

- r : Response만 사용

- 2xx, 4xx, etc : 지정된 Response Code만 사용

- c : Request Message 값을 COPY해서 Response에 사용

- 표시 없음: Request, Response 모두 사용


proxy 열

- a : Proxy에서 해더필드 정보를 ADD, CONCATENATE 할수 있음

- m : Proxy에서 해더필드 정보를 MODIFY 할 수 있음

- d : Proxy에서 헤더필드 정보를 DELETE 할 수 있음

- r : Proxy에서 헤더필드 정보를 READ 할 수 있음 (cannot be encrypted)


각 method 열

- c : Conditional 하게 메시지에 따라 조절

- m : Mandatory 필수

- m* : SHOULD be sent, Client, Server 모두 Message에 이 Header가 없어도 처리함

- o : Optional 있어도되고 없어도되고

- t : TCP같은 Stream-based Protocol을 사용하면 MUST 사용

* : SIP Message Body가 있으면 필요함

- : 적용 불가 해더 (사용하지 말라)




해더 정보

Example:


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Accept                  R            -   o   -   o   m*  o

      Accept                 2xx           -   -   -   o   m*  o

      Accept                 415           -   c   -   c   c   c

      Accept-Encoding         R            -   o   -   o   o   o

      Accept-Encoding        2xx           -   -   -   o   m*  o

      Accept-Encoding        415           -   c   -   c   c   c

      Accept-Language         R            -   o   -   o   o   o

      Accept-Language        2xx           -   -   -   o   m*  o

      Accept-Language        415           -   c   -   c   c   c

      Alert-Info              R      ar    -   -   -   o   -   -

      Alert-Info             180     ar    -   -   -   o   -   -

      Allow                   R            -   o   -   o   o   o

      Allow                  2xx           -   o   -   m*  m*  o

      Allow                   r            -   o   -   o   o   o

      Allow                  405           -   m   -   m   m   m

      Authentication-Info    2xx           -   o   -   o   o   o

      Authorization           R            o   o   o   o   o   o

      Call-ID                 c       r    m   m   m   m   m   m

      Call-Info                      ar    -   -   -   o   o   o

      Contact                 R            o   -   -   m   o   o

      Contact                1xx           -   -   -   o   -   -

      Contact                2xx           -   -   -   m   o   o

      Contact                3xx      d    -   o   -   o   o   o

      Contact                485           -   o   -   o   o   o

      Content-Disposition                  o   o   -   o   o   o

      Content-Encoding                     o   o   -   o   o   o

      Content-Language                     o   o   -   o   o   o

      Content-Length                 ar    t   t   t   t   t   t

      Content-Type                         *   *   -   *   *   *

      CSeq                    c       r    m   m   m   m   m   m

      Date                            a    o   o   o   o   o   o

      Error-Info           300-699    a    -   o   o   o   o   o

      Expires                              -   -   -   o   -   o

      From                    c       r    m   m   m   m   m   m

      In-Reply-To             R            -   -   -   o   -   -

      Max-Forwards            R      amr   m   m   m   m   m   m

      Min-Expires            423           -   -   -   -   -   m

      MIME-Version                         o   o   -   o   o   o

      Organization                   ar    -   -   -   o   o   o


             Table 2: Summary of header fields, A--O




   Header field              where       proxy ACK BYE CAN INV OPT REG

   ___________________________________________________________________

   Priority                    R          ar    -   -   -   o   -   -

   Proxy-Authenticate         407         ar    -   m   -   m   m   m

   Proxy-Authenticate         401         ar    -   o   o   o   o   o

   Proxy-Authorization         R          dr    o   o   -   o   o   o

   Proxy-Require               R          ar    -   o   -   o   o   o

   Record-Route                R          ar    o   o   o   o   o   -

   Record-Route             2xx,18x       mr    -   o   o   o   o   -

   Reply-To                                     -   -   -   o   -   -

   Require                                ar    -   c   -   c   c   c

   Retry-After          404,413,480,486         -   o   o   o   o   o

                            500,503             -   o   o   o   o   o

                            600,603             -   o   o   o   o   o

   Route                       R          adr   c   c   c   c   c   c

   Server                      r                -   o   o   o   o   o

   Subject                     R                -   -   -   o   -   -

   Supported                   R                -   o   o   m*  o   o

   Supported                  2xx               -   o   o   m*  m*  o

   Timestamp                                    o   o   o   o   o   o

   To                        c(1)          r    m   m   m   m   m   m

   Unsupported                420               -   m   -   m   m   m

   User-Agent                                   o   o   o   o   o   o

   Via                         R          amr   m   m   m   m   m   m

   Via                        rc          dr    m   m   m   m   m   m

   Warning                     r                -   o   o   o   o   o

   WWW-Authenticate           401         ar    -   m   -   m   m   m

   WWW-Authenticate           407         ar    -   o   -   o   o   o


   Table 3: Summary of header fields, P--Z; (1): copied with possible

   addition of tag




상세 정보는 여기부터 시작함

다시한번 출처는 : http://lukiji.egloos.com/v/3208737

아래는 그분의 도움을 이어받아서 작성함


== Accept == 

Accept 할 수 있는 Body Type 정보

Accept Header가 존재 하지 않는다면 UAS는 Default값인 "application/sdp"를 Accept한다고 판단

Accept 해더 필드가 empty라면 수락할 수있는 format이 없음

(An empty Accept header field means that no formats are acceptable.)


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ____________________________________________________________________________

      Accept                  R                          -     o      -     o     m*  o

      Accept                 2xx                        -     -      -     o     m*  o

      Accept                 415                        -     c      -    c     c     c


ex = "Accept : application/sdp, text/plain"


Accept       = "Accept" ":" #( media-range [ accept-params ] )

media-range      = ( "*/*" | ( type "/" "*" ) | ( type "/" subtype ) )

                        *( ";" parameter )

parameter     = attribute "=" value

attribute     = token

value         = token | quoted-string

accept-params    = ";" "q" "=" qvalue *( accept-extension )

accept-extension = ";" token [ "=" ( token | quoted-string ) ]

qvalue         = ( "0" [ "." 0*3DIGIT ] ) | ( "1" [ "." 0*3("0") ] )





== Accept-Encoding Header == 

받아 들일 수 있는 Body의 Encoding Type



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Accept-Encoding         R               -       o      -    o      o     o

      Accept-Encoding        2xx             -       -      -    o      m*   o

      Accept-Encoding        415              -       c     -    c      c      c


ex = "Accept-Encoding : gzip"


Accept-Encoding  = "Accept-Encoding" ":" #( content-coding )

content-coding   = token





== Accept-Language Header ==

받아들일 수 있는 Reason phrases, Session Descriptions(SDP), Response의 Body등의 Language.

Header가 없다면 UAS는 UAC에서 모든 Language들을 받아 들일 수 있는 것으로 판단



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Accept-Language        R               -       o      -    o      o     o

      Accept-Language       2xx             -       -      -    o      m*   o

      Accept-Language       415              -       c     -    c      c      c


ex = "Accept-Language : da, en-gb;q-0.8"


Accept-Language = "Accept-Language" ":" 1#( language-range [ ";" "q" "=" qvalue ] )

language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )




== Alert-Info Header ==

INVITE에 있으면 UAS에서 Ring에, 180 Response에 있으면 UAC에서 Ring back tone에 사용할 음원정보를 표현



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Alert-Info              R           ar         -      -      -     o     -     -

      Alert-Info             180        ar         -       -     -      o     -     -


ex = "Alert-Info : <http://www.example.com/sounds/moo.wav>"


Alert-Info     =  "Alert-Info" ":" # ( "<" URI ">" *( ";" generic-param ))

generic-param  =  token [ "=" ( token | host | quoted-string ) ]




== Allow Header ==

UA가 받아 들일 수 있고, 처리할 수 있는 Method의 List를 표현

다른 SIP Element들과 통신 할 경우 처리가 불가능한 Method는 보내지 않도록 하는 예외처리 할 때 사용

예를 들어 Session-Timer를 사용하려고 할 때, UPDATE가 Allow Header에 없다면 Re-INVITE를 사용하고, UPDATE가 있다면, UPDATE를 사용하여 Session Refresh를 할 수 있도록 한다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Allow                    R                       -      o      -    o     o      o

      Allow                   2xx                     -      o      -    m*   m*   o

      Allow                    r                       -      o      -    o     o      o

      Allow                   405                   -      m     -    m    m    m


ex = "Allow : INVITE, ACK, CANCEL, BYE"


Allow  =  "Allow" ":" 1#Method

Method            =  "INVITE" | "ACK" | "OPTIONS" | "BYE"

                          | "CANCEL" | "REGISTER" | extension-method




== Authentication-Info Header ==

HTTP Digest로 상호인증을 할 때 사용된다. 

UAS에서 Request의 Authorization Header field 값을 기본으로 

Digest 인증에 성공한다면 2xx Response때 이 Header Field를 넣어야 한다. 



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

 Authentication-Info      2xx                 -      o      -     o     o     o


ex = "Authentication-Info : nextnonce="468761df3s4df54sd51f351"


Authentication-Info = "Authentication-Info" HCOLON ainfo *(COMMA ainfo) 

ainfo = nextnonce / message-qop / response-auth / cnonce / nonce-count  

nextnonce = "nextnonce" EQUAL nonce-value  

response-auth = "rspauth" EQUAL response-digest  

response-digest = LDQUOT *LHEX RDQUOT 





== Authorization Header ==


UA의 인증처리를 위한 정보를 가진다.

멀티라인 규칙을 지키지 않는다. 한줄로 합치지 않는다.


----------------------------  Header  사용 정보 -------------------------

      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     Authorization           R                   o      o      o     o     o    o


ex = Authorization: Digest username="Alice", realm="atlanta.com",

       nonce="84a4cc6f3082121f32b42a2187831a9e",

       response="7587245234b3434cc3412213e5f113a5432


Authorization    =  "Authorization" ":" "pgp" # pgp-response

pgp-response     =  realm | pgp-version | pgp-signature | signed-by | nonce

realm        =  "realm" "=" realm-value

realm-value      =  quoted-string

pgp-signature    =  "signature" "=" quoted-string

signed-by        =  "signed-by" "=" <"> URI <">




== Call-ID Header ==

Call 식별자

이 값으로 Dialog구분, Unique한 값 사용

하지만 이값이 항상 Unique하다는 것은 아니다. 

그래서 Dialog나 Transaction을 찾을 때는, 이 값 이외에 

Via branch, To/From Value와 Tag, CSeq 등도 같이 사용하여 찾는다.


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     Call-ID                     c          r      m      m    m    m    m    m


ex = "Call-ID: f81d4fae-7dec-11d0-a765-00a0c91e6bf6@biloxi.com

      i:f81d4fae-7dec-11d0-a765-00a0c91e6bf6@192.0.2.4"


Call-ID = ( "Call-ID" / "i" ) HCOLON callid

callid = word [ "@" word ]





== Call-Info Header ==

Call-Info Header는 Caller나 Callee에 대한 추가적인 정보를 제공하기 위해 사용


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

    Call-Info                               ar       -      -       -    o     o     o


ex = "Call-Info: <http://example.com/alice/photo.jpg>;purpose=icon,<http://example.com/alice/>;purpose=info"


Call-Info   =  "Call-Info" ":" # ( "<" URI ">" *( ";" info-param) )

info-param  =  "purpose" "=" ( "icon" | "info" | "card" | token ) |   generic-param




== Contact Header ==

Contact Header는 호를 위한 여러가지 정보를 가진다.

 - 호가 성립된 이후 자신이 받아 들일 수 있는 접속정보 (INVITE 등)

 - 레지 상태가 만료 되기까지 유지되는 시간 정보 (REGISTER)

 - 자신이 지원하는 미디어 정보 (REGISTER, INVITE 등)


호가 성립될 때 각각의 UA는 자신의 접속정보를 Contact Header에 보내야 하며, 

성립된 이후에는 각각의 UA는 상대방의 접속정보인 Contact Header Field값의 정보를 기억해야 한다.

하지만 망마다, 또는 단말 마다 아래 Header사용정보대로 지키지 않는 곳들이 있기 때문에(Contact Header가 없으면 Fail을 주는 곳이 있다.) 망에 맞추어 사용해야 된다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Contact                 R                     o     -      -     m     o    o

      Contact                 1xx                   -     -      -     o      -    -

      Contact                 2xx                  -     -      -     m     o    o

      Contact                 3xx        d        -     o      -     o      o    o

      Contact                 485                 -     o      -     o      o    o


ex = "Contact: "Mr. Watson" <sip:watson@worcester.bell-telephone.com>

         ;q=0.7; expires=3600,

         "Mr. Watson" <mailto:watson@bell-telephone.com> ;q=0.1

      m: <sips:bob@192.0.2.4>;expires=60"


Contact           = ( "Contact" | "m" ) ":"

                    ("*" | (1# (( name-addr | addr-spec )

                    *( ";" contact-params ) )))


name-addr         = [ display-name ] "<" addr-spec ">"

addr-spec         = SIP-URL | URI

display-name      = *token | quoted-string

contact-params    = "q" "=" qvalue | "action" "=" "proxy" | "redirect" | "expires" "=" delta-seconds | <"> SIP-date <"> |  contact-extension


qvalue            = ( "0" [ "." 0*3DIGIT ] ) | ( "1" [ "." 0*3("0") ] )

contact-extension = generic-param

generic-param     = token [ "=" ( token | host | quoted-string ) ]




== Content-Disposition Header ==

Message Body를 UA, US가 어떻게 해석할지에 대한 방법을 설명한 필드

예를 들어 "session"이라는 Type값이 있다면, Body가 Session용 이다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Content-Disposition                      o     o     -       o    o     o


ex = "Content-Disposition : session"


Content-Disposition   =  "Content-Disposition" ":" disposition-type *( ";" disposition-param )

disposition-type      =  "render" | "session" | "icon" | "alert" | disp-extension-token

disposition-param     =  "handling" "=" ( "optional" | "required" | other-handling ) |   generic-param

other-handling        =  token

disp-extension-token  =  token




== Content-Encoding Header ==

Content-Encoding Header는 Body의 압축 인코딩 방식 설명

일반적인 호의 Body는 망에서는 최대 500~600 Byte를 넘지 않고, 비압축 하여 사용되기 때문에 미사용

MMS나 이미지같이 큰 데이터를 압축해서 전송할 때 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Content-Encoding                        o      o     -     o     o     o


ex = "Content-Encoding : gzip"

Content-Encoding  =  ( "Content-Encoding" | "e" ) ":" 1#content-coding

content-coding   = token




== Content-Language Header ==

권고안에서는 H14.12절을 보라고만 되어있는데

body의 content를 구성하는 언어에 대한 설명으로 보인다.


----------------------------  Header  사용 정보 -------------------------

      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Content-Language                       o     o       -     o     o     o


ex = "Content-Language : fr"


Content-Language  = "Content-Language" ":" 1#language-tag

language-tag  = primary-tag *( "-" subtag )

primary-tag   = 1*8ALPHA

subtag        = 1*8ALPHA



== Content-Length Header ==

Content-Length Header는 Message Body의 길이

주의점은 이 Header는 TCP같은 Stream-base Protocol 에서는 반드시 필요

UDP같은 Protocol에서는 Body가 없을 때는 이 Header가 메시지에 없어도 됨



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Content-Length                  ar       t       t      t      t      t      t


ex = "Content-Length : 341"

Content-Length  =  ( "Content-Length" | "l" ) ":" 1*DIGIT




== Content-Type Header ==

Content-Type Header는 Body Type

Body가 있으면 반드시 Message 안에 있어야하고, Body가 없다면 없어도 무방



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Content-Type                               *     *     -     *      *     *


ex = "Content-Type: application/sdp"


Content-Type  =  ( "Content-Type" | "c" ) ":" media-type

media-type    = type "/" subtype *( ";" parameter )

type          = token

subtype       = token

parameter     = attribute "=" value

attribute     = token

value         = token | quoted-string



== CSeq Header ==

현재 메시지의 Sequence Number와 Method의 정보

이 값을 이용하여 Transaction과 Dialog를 판별하며, 

루핑같이 뒤늦게 들어오는 Message를 Discard하는 등의 용도로 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      CSeq                       c         r      m     m     m     m   m   m


ex = "CSeq: 1290481 INVITE"


CSeq     =  "CSeq" ":" 1*DIGIT Method




== Date Header ==

Date Header는 가장 처음 request or response 전송한 시간 

그래서 retransimssions(재전송) 할 때 Date 해더 필드를 보면 original 메시지와 값이 같다.


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Date                                   a      o       o     o     o     o     o


ex = "Date: Sat, 13 Nov 2010 23:29:00 GMT" 

Date      =  "Date" ":" SIP-date

SIP-date  =  rfc1123-date

* RFC 1123 

5.2.14  RFC-822 Date and Time Specification: RFC-822 Section 5

              The syntax for the date is hereby changed to:

               date = 1*2DIGIT month 2*4DIGIT


* RFC 822

date-time   =  [ day "," ] date time 

day         =  "Mon"  / "Tue" /  "Wed"  / "Thu" /  "Fri"  / "Sat" /  "Sun"

date        =  1*2DIGIT month 2DIGIT

month       =  "Jan"  /  "Feb" /  "Mar"  /  "Apr"

                                /  "May"  /  "Jun" /  "Jul"  /  "Aug"

                 /  "Sep"  /  "Oct" /  "Nov"  /  "Dec"

time        =  hour zone                    ; ANSI and Military

hour        =  2DIGIT ":" 2DIGIT [":" 2DIGIT]   ; 00:00:00 - 23:59:59

zone        =  "UT"  / "GMT" / "EST"/ "EDT" / "CST"/"CDT" /"MST"/ "MDT" / "PST"/ "PDT"/ 1ALPHA 

                           / ( ("+" / "-") 4DIGIT ) 




== Error-Info Header ==

Error-Info Header는 error status response의 추가적인 정보를 표현하기 위하여 정의

하지만, 망에서는 Reason 해더를 주로 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Error-Info           300-699      a       -      o      o    o      o     o


ex = "Error-Info: <sip:not-in-service-recording@atlanta.com"


Error-Info  =  "Error-Info" ":" # ( "<" URI ">" *( ";" generic-param ))

generic-param     = token [ "=" ( token | host | quoted-string ) ]\




== Expires Header ==

Message가 Expires 되는 시간이고 단위는 sec

범위는 0 ~ 4294967295 (2^32 -1) 

최대 136.19년



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Expires                                       -      -     -     o      -     o


ex = "Expires : 60"


Expires  =  "Expires" ":" ( SIP-date | delta-seconds )


 


== From Header ==

Message의 발송자

Caller, Callee를 의미 하는 것이 아닌 

현재 메시지의 Request를 생성 및 발송한 UA를 표현 

호의 Initial 메시지와 그 이후 Subsequent 메시지에서 From의 값이 다를 수 있다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      From                      c           r       m     m    m    m    m    m


ex="From: "A. G. Bell" <sip:agb@bell-telephone.com> ;tag=a48s

      From: sip:+12125551212@server.phone2net.com;tag=887s

      f: Anonymous <sip:c8oqz84zk7z@privacy.org>;tag=hyh8"


From        =  ( "From" | "f" ) ":" ( name-addr | addr-spec ) * ( ";" from-param )

from-param  =  tag-param | generic-param

tag-param   =  "tag" "=" token



== In-Reply-To Header ==

이 Header를 이용하여 여러 개의 Call-ID값을 Cache하고, 이 값으로 Call을 Filtering한다고는 한다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     In-Reply-To              R                  -     -      -     o     -     -


ex = "In-Reply-To: 70710@saturn.bell-tel.com, 17320@saturn.bell-tel.com"

In-Reply-To  =  "In-Reply-To" ":" 1# callid




== Max-Forwards Header ==

SIP Message가 최대 Forward되는 횟수

이 값을 이용하여 Looping을 방지하는데 사용되는데 

각 Server는 Forward 할 때 마다 값을 확인하고, 1씩 감소한 값으로 변경

값의 범위는 0 ~ 255이고, 추천하는 시작 값은 70


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     Max-Forwards            R      amr    m    m     m    m   m     m

 

ex = "Max-Forwards : 70"


Max-Forwards : "Max-Forwards" HCOLON 1*DIGIT




== Min-Expires Header ==

Refresh Interval의 최소 값

423 응답 코드는 (Interval Too Brief)


      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     Min-Expires            423                 -      -     -      -     -    m



ex = "Min-Expires : 70"

Min-Expires : "Min-Expires" HCOLON 1*DIGIT




== MIME-Version Header ==

권고안에서는 H19.4.1절을 보라

MIME-Version Header는 Message의 MIME-formatted를 표현



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     MIME-Version                              o      o      -    o     o     o


ex = "MIME-Version : 1.0"


MIME-Version = "MIME-Version" HCOLON 1*DIGIT "." 1*DIGIT



== Organization Header ==

일반적으로 개발한 사람/조직의 정보 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Organization                      ar       -      -      -     o     o    o


ex = "Organization: Boxes by Bob"

Organization : "Organization" HCOLON [TEXT-UTF8-TRIM]




== Priority Header ==

SIP Message의 우선순위를 두어 긴급한 메시지 처리에 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

      Priority                    R          ar     -      -      -     o     -    -


ex 

      Subject: A tornado is heading our way!

      Priority: emergency

   or

      Subject: Weekend plans

      Priority: non-urgent


Priority = "Priority" HCOLON priority-value

priority-value = "emergency" / "urgent" / "nomal" / "non-urgent" / other-priority

other-pritority = token




== Proxy-Authenticate Header ==

인증처리를 하는 Proxy를 위하여 사용

Proxy-Authorization Header와 같이 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      ___________________________________________________________

     Proxy-Authenticate    407      ar      -     m     -      m   m    m

     Proxy-Authenticate    401      ar      -      o     o      o    o     o


ex = "Proxy-Authenticate: Digest realm="atlanta.com",

       domain="sip:ss1.carrier.com", qop="auth",

       nonce="f84f1cec41e6cbe5aea9c8e88d359",

       opaque="", stale=FALSE, algorithm=MD5"


Proxy-Authenticate = "Proxy-Authenticate" HCOLON challenge   

challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) / other-challenge  

other-challenge = auth-scheme / auth-param *(COMMA auth-param)  

digest-cln = realm / domain / nonce / opaque / stale / algorithm  / qop-options / auth-param  

realm = "realm" EQUAL realm-value  

realm-value = quoted-string  

domain = "domain" EQUAL LDQUOT URI *( 1*SP URI ) RDQUOT  

URI = absoluteURI / abs-path  

opaque = "opaque" EQUAL quoted-string  

stale = "stale" EQUAL ( "true" / "false" )  

qop-options = "qop" EQUAL LDQUOT qop-value *("," qop-value) RDQUOT  

qop-value = "auth" / "auth-int" / token 





== Proxy-Authorization Header ==

Proxy에서 인증을 요구 하는경우 Client에서 생성하여 전달

인증에 관련된 정보가 이 Header에 값으로 사용된다.


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

    Proxy-Authorization    R        dr       o      o      -    o     o    o



ex = "Proxy-Authorization: Digest username="Alice", realm="atlanta.com",

        nonce="c60f3082ee1212b402a21831ae",

        response="245f23415f11432b3434341c022"


Proxy-Authorization  =  "Proxy-Authorization" HCOLON credentials

credentials       =  ("Digest" LWS digest-response)  / other-response

digest-response   =  dig-resp *(COMMA dig-resp)

dig-resp          =  username / realm / nonce / digest-uri  / dresponse / algorithm / cnonce

                                                  / opaque / message-qop  / nonce-count / auth-param


username          =  "username" EQUAL username-value

username-value    =  quoted-string

digest-uri        =  "uri" EQUAL LDQUOT digest-uri-value RDQUOT

digest-uri-value  =  rquest-uri ; Equal to request-uri as specified by HTTP/1.1

message-qop       =  "qop" EQUAL qop-value

cnonce            =  "cnonce" EQUAL cnonce-value

cnonce-value      =  nonce-value

nonce-count       =  "nc" EQUAL nc-value

nc-value          =  8LHEX

dresponse         =  "response" EQUAL request-digest

request-digest    =  LDQUOT 32LHEX RDQUOT

auth-param        =  auth-param-name EQUAL  ( token / quoted-string )

auth-param-name   =  token

other-response    =  auth-scheme LWS auth-param *(COMMA auth-param)

auth-scheme       =  token





== Proxy-Require Header ==

Proxy가 지원하고 사용하고자 하는 기능


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

    Proxy-Require            R         ar      -     o     -      o     o    o


ex = "Proxy-Require : foo"


Proxy-Require = "Proxy-Require" HCOLON option-tag * (COMMA option-tag)





== Record-Route Header ==

Record-Route Header는 Routing 정보를 UA에게 알려주기 위하여 사용


Bob                       A (Proxy)                  B (Proxy)                  Allice


         ---- INVITE --->

                                    ----- INVITE  ---->

                                    (Record-Route :  A )

                                                                   ----- INVITE  ---->

                                                                  (Record-Route :  A, B )

                                                                   <---- 200 Ok  -----

                                                                  (Record-Route :  A, B )

                                    <---- 200 Ok  -----

                                    (Record-Route :  A, B )

          <---- 200 Ok  -----

          (Record-Route :  A, B )


이 때 주의 할 점은 

UAS(Allice)는 Recored-Route의 값의 순서대로 이 Header값을 기억

UAC(Bob)은 역순으로 이 Header값을 기억해야 함

그리고, ACK나 CANCEL Request Message는 

Proxy에서 이 값과 관계없이 Down Stream을 기억하고 같은 곳으로 전달 해야 한다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

   Record-Route            R          ar       o      o     o      o    o     -

   Record-Route         2xx,18x    mr      -      o     o     o     o     -


ex = "Record-Route: <sip:server10.biloxi.com;lr>,<sip:bigbox3.site3.atlanta.com;lr>"


Record-Route = "Record-Route" HCOLON rec-route * (COMMA rec-route)

rec-route = name-addr * (SEMI rr-param)

rr-param = generic-param


 


== Reply-To Header ==

From Header와 다른 URI값을 가지고

이 Header의 값을 이용하여 다른 URI정보를 넘기는데 사용

망에서 가끔 발신자 정보를 변경하기 위하여 사용



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

   Reply-To                                        -     -      -     o     -     -


ex = "Reply-To: Bob <sip:bob@biloxi.com>"


Reply-To = "Reply-To" HCOLON rplyto-spec

rplyto-sepc = (name-addr / addr-spec) * (SEMI rplyto-param)

rplyto-param = generic-param

 



== Require Header ==

Require Header는 UAC와 UAS간에 사용하고자 하는 기능을 option-tag를 이용하여 사용

이 때, 지원하지 않는 기능을 요구하면 Fail Response를 수신

따라서 Supported로 지원되는 기능을 UAC에서 UAS에게 전달하여, 기능을 사용하거나 

OPTIONS 메쏘드를 이용하여 미리 지원되는 기능을 판단후에 Request Header에 사용


대표적은 예로 PRACK 사용하고자 하는 100rel option-tag다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

   Require                                 ar      -      c      -     c     c    c


ex = "Require : 100rel"


Require = "Require" HCOLON option-tag * (COMMMA option-tag)

option-tag = token




== Retry-After Header ==

UAS에 요청한 Message에 대해서 UAS에서 일정시간후 재 시도 하라는 정보를 알려줄 때 사용

SIP Protocol의 주는 호연결 이고, 주체는 사람이므로,  거의 사용 안함



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

       Retry-After      404,413,480,            -     o     o     o    o      o

       Retry-After      486,500,503             -     o     o     o    o      o

       Retry-After      600,603                   -     o     o     o   o      o


ex = "Retry-After: 18000;duration=3600

         Retry-After: 120 (I'm in a meeting)"


Retry-After = "Retry-After" HCOLON delta-seconds [comment] * (SEMI retry-param)

retry-param = ("duration" EQUAL delta-seconds) / generic-param




== Route Header ==

Request Message가 가야할 Routing정보

이 정보와 Request-URI값을 이용하여 Proxy가 Next Hop을 결정하여 Message를 전달

Message를 전달 할때는 자신의 정보를 삭제하고 전달 해야 한다. 

이때 이해해야 할 부분이 Strict-Routing과 Loose-Routing



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

       Route                      R       adr     c      c      c    c     c     c



ex = "Route: <sip:bigbox3.site3.atlanta.com;lr>,

             <sip:server10.biloxi.com;lr>"


Route = "Route" HCOLON route-param * (COMMA route-param)

route-param = naem-addr * (SEMI rr-param)




== Server Header ==

UAS의 software의 정보


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

      Server                      r                  -      o     o     o     o     o


ex = "Server : HomeServer v2"


Server = "Server" HCOLON server-val * (LWS server-val)

server-val = product / comment

product = token [SLASH product-version]

product-version = token

 


== Subject Header ==

호의 요약 정보를 나타냄

망에서 이 Header를 특별한 의미로 사용하는 것은 아직 본적이 없다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

      Subject                    R                 -      -      -     o     -    -


ex = "Subject: Need more boxes

        s: Tech Support"


Subject = ( "Subject" / "s" ) HCOLON [TEXT-UTF8-TRIM]




== Supported Header ==

UAC, UAS에서 지원하는 추가 기능을 다른 단말에 알려주려고 사용


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     Supported                 R                  -     o     o     m*   o     o

     Supported                2xx                -     o     o     m*   m*   o


ex = "Supported : 100rel"


Supported = ("Supported" / "k") HCOLON [option-tag * (COMMA option-tag)]




== Timestamp Header ==

UAC가 UAS에게 Request보낸 시점



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     Timestamp                                    o     o      o    o     o      o     

 


ex = "Timestamp: 54"


Timestamp = "Timestamp" HCOLON 1*(DIGIT) ["." *(DIGITI)] [LWS delay]

delay = *(DIGIT) ["." *(DIGITI]

 


== To Header ==

UAS 정보를 나타냄

형태는 From Header와 동일 하다. 

다른 점은 From Header는 UAC에서 tag를 생성하여 전달 하지만, To Header의 tag는 UAS에서 추가

이 tag값은 호가 종료되는 시점까지 변경되지 않는다.



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     To                         c(1)        r       m    m     m    m    m    m


ex: "To: The Operator <sip:operator@cs.columbia.edu>;tag=287447

        t: sip:+12125551212@server.phone2net.com"


To        =  ( "To" | "t" ) ":" ( name-addr | addr-spec ) *( ";" to-param )

to-param  =  tag-param | generic-param




== Unsupported Header ==

지원되지 않는 기능을 UAC에서 요구할 때 UAS에서 이를 알려주기 위해 사용된

지원하지 않는 기능을 Require Header를 이용하여 UAC에서 사용하자고 알려온다면, 

UAS는 Fail Response에 Unsupported Header에 지원하지 않는 기능들을 알려줄 수 있음

420 (Bad Extension)


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     Unsupported            420                 -     m    -     m    m    m


ex = "Unsupported: 100rel"


Unsupported = "Unsupported" HCOLON option-tag *(COMMA option-tag)



== User-Agent Header ==

요청을 생성한 UAC의 정보


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     User-Agent                                   o     o     o     o     o     o


ex = "User-Agent: Softphone Beta 1.5"


User-Agent = "User-Agent" HCOLN server-val *(LWS server-val)



== Via Header ==

Request 메시지가 거처간 SIP Element의 정보를 가지며, 

이 값을 사용하여 Response가 Routing될 정보로 사용


추가적으로 Transaction을 판단하는데 이 Header의 Branch Tag가 사용되며, 

그 외에도 여러 용도로 사용되는 중요 Header중에 하나이다. 

중요한 점은 Brach의 값이 magic cookie "z9hG4bK"로 시작해야 한다. 



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

      Via                         R        amr    m    m     m    m    m   m

       Via                        rc        dr      m    m     m    m    m   m



ex = "Via: SIP/2.0/UDP JS.SONG.proxy.com;brach=z9hG4bKa7c6a8dlze

   Via: SIP / 2.0 / UDP first.example.com: 4000;ttl=16;maddr=224.2.0.1 ;branch=z9hG4bKa7c6a8dlze.1"


Via          =   ( "Via" | "v" ) ":" 1#( sent-protocol sent-by *( ";" via-params ) [comment] )

sent-protocol    =   protocol-name "/" protocol-version "/" transport

protocol-name    =   "SIP" | token

protocol-version =   token

transport        =   "UDP" | "TCP" | token

sent-by      =   ( host [":" port] ) | ( concealed-host )

concealed-host   =   token

via-params       =   via-hidden | via-ttl | via-maddr | via-received | via-branch | via-extension

via-hidden       =   "hidden"

via-ttl      =   "ttl" "=" ttl

via-maddr        =   "maddr" "=" maddr

via-received     =   "received" "=" host

via-branch       =   "branch" "=" token

via-extension    =   generic-param

generic-param    =   token ["=" ( token | quoted-string )]

comment      =   "(" *( ctext | quoted-pair | comment ) ")"

quoted-pair      =   " \ " CHAR




== Warning Header ==

Response의 추가적인 정보를 제공


      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

     Warning                     r                  -     o      o     o     o     o


ex = Warning : 301 isi.edu "Incompatible network address type 'E.164'"


Warning = "Warning" HCOLON warning-value *(COMMA warning-value)

warning-value = warn-code SP warn-agent SP warn-text  

warn-code = 3DIGIT  

warn-agent = hostport / pseudonym  

warn-text = quoted-string  

pseudonym = token 




== WWW-Authenticate Header ==

인증관련된 정보를 표현



      Header field          where   proxy ACK BYE CAN INV OPT REG

      __________________________________________________________

   WWW-Authenticate      401       ar      -     m     -     m    m    m

   WWW-Authenticate      407       ar      -     o      -     o     o     o


 ex = "WWW-Authenticate: Digest realm="atlanta.example.com", 

                            qop="auth", nonce="84f1c1ae6cbe5ua9c8e88dfa3ecm3459", opaque="", 

                            stale=FALSE, algorithm=MD5 "


WWW-Authenticate = "WWW-Authenticate" HCOLON challenge  



http://lukiji.egloos.com/v/3208737

이분께서 현업을 토대로 작성해주셔서 도움이 많이 되었다.








반응형

+ Recent posts