본문 바로가기

SIP의 이해

[연재] 다시쓰는 SIP의 이해 - 20편 Chapter 7. 가끔 보는 SIP Method

Chapter 7. 가끔 보는 SIP Method



5. MESSAGE 메쏘드
MESSAGE 요청은 거의 실시간으로 사용자끼리 메세지를 송수신하기 위해 만들어진 메쏘드로 RFC 3428 SIP for Instant Messaging에 정의되어 있습니다. 


MESSAGE의 요청과 응답 프로세스는 아래 그림과 같습니다. MESSAGE 요청에 대한 200 OK 응답은 사용자가 메세지를 읽었다는 것을 의미하는 것이 아니라 요청을 정확히 수신 했음을 의미합니다. 





응답이 4xx 나 5xx 로 표시되면 메세지가 성공적으로 전달되지 않았음을 의미하며, 6xx 응답은 전달은 되었으나 사용자에 의해 거절되었음을 나타냅니다. 


각각의 메세지를 간단하게 살펴보겠습니다. 

  • MESSAGE
    앨리스와 밥은 별도의 다이얼로그를 생성하지 않고, 앨리스는 메세지를 전송합니다. 메세지의 크기는 1300 Bytes 를 초과할 수 없습니다. MESSAGE 요청의 내용은 "밥 프리젠테이션 죽이지 않아?" 입니다. 

     MESSAGE sip:bob@biloxi.com SIP/2.0 
     Via: SIP/2.0/TCP pc33.atlanta.com;branch=z9hG4bK776asegma
     Max-Forwards: 70
     To: Bob <sip:bob@biloxi.com
     From: Alice <sip:alice@atlanta.com>;tag=1928301774
     Call-ID: a84b4c76e66710@pc33.atlanta.com 
     CSeq: 22756 MESSAGE
     Content-Type: text/plain
     Content-Disposition: render
     Content-Length: 37

     
    Isn’t this a great presentation, Bob?


  • 200 OK
    MESSAGE를 정상수신 했음을 표시하기 위해 200 OK를 송신합니다. 

     
    SIP/2.0 200 OK
     Via: SIP/2.0/TCP pc33.atlanta.com;branch=z9hG4bKnashds7 ;received=10.1.3.33
     To: sip: sip:bob@biloxi.com>; tag=a6c85e3
     From: alice@atlanta.com ;tag=1928301774 
     Call-ID: a84b4c76e66710@pc33.atlanta.com
     CSeq: 22756 MESSAGE
     Content-Length: 0



6. Welcome Notice 예제 

RFC 3680 SIP Event Package for Registration 문서에는 등록 상태 정보를 이용한 몇가지 시나리오가 있습니다. 앞서 설명한 SUBSCRIBE와 NOIFY 메쏘드, 그리고 MESSAGE 메쏘드가 어떻게 동작되는 지를 살펴보기 위해 Welcome Notice 서비스 예제를 살펴보겠습니다. 



Welcome Notice는 사용자의 상태 및 위치정보를 인식하여 제공되는 서비스로 로밍폰으로 외국에서 전화기를 켜면, 사용자의 단말이 Welcome to the contry 메세지를 받게 하는 서비스입니다. 위 그림에서 Notifier는 Registrar 서버이며, Subsciber는 애플리케이션 서버입니다. 


  • SUBSCRIBE
    애플리케이션 서버는 원하는 사용자의 등록 이벤트 정보를 SIP Registrar 서버에게 요청합니다. 

       SUBSCRIBE sip:joe@example.com SIP/2.0
       Via: SIP/2.0/UDP app.example.com;branch=z9hG4bKnashds7
       From: sip:app.example.com;tag=123aa9
       To: sip:joe@example.com
       Call-ID: 9987@app.example.com
       CSeq: 9887 SUBSCRIBE
       Contact: sip:app.example.com
       Event: reg
       Max-Forwards: 70
      Accept: application/reginfo+xml


  • 200 OK
    Notifier인 Registrar 서버는 200 OK로 Subscriber의 SUBSCRIBE요청을 정확히 수신했음을 통지하면서 3600초 동안 Joe의 등록 상태 정보를 통지하겠다고 전달합니다. 

       SIP/2.0 200 OK
       Via: SIP/2.0/UDP app.example.com;branch=z9hG4bKnashds7;received=192.0.2.1
       From: sip:app.example.com;tag=123aa9
       To: sip:joe@example.com;tag=xyzygg
       Call-ID: 9987@app.example.com
       CSeq: 9987 SUBSCRIBE
       Contact: sip:server19.example.com
       Expires: 3600


  • NOTIFY
    Notifier인 Registrar 서버는 현재의 상태를 업데이트 합니다. 죠는 아직 등록 상태는 active 가 아닌 init 상태로 AoR에 정확한 Contact address가 바인딩되지 않았음을 나타냅니다. 

       NOTIFY sip:app.example.com SIP/2.0
       Via: SIP/2.0/UDP server19.example.com;branch=z9hG4bKnasaii
       From: sip:joe@example.com;tag=xyzygg
       To: sip:app.example.com;tag=123aa9
       Call-ID: 9987@app.example.com
       CSeq: 1288 NOTIFY
       Contact: sip:server19.example.com
       Event: reg
       Max-Forwards: 70
       Content-Type: application/reginfo+xml
       Content-Length: ...

       
    <?xml version="1.0"?>
          <reginfo xmlns="urn:ietf:params:xml:ns:reginfo"
                    version="0" state="full">
          <registration aor="sip:joe@example.com" id="a7" state="init" />
       </reginfo>


  • REGISTRER
    사용자 죠가 SIP Registrar 서버에 자신의 Contact 주소를 등록합니다.

       REGISTER sip:example.com SIP/2.0
       Via: SIP/2.0/UDP pc34.example.com;branch=z9hG4bKnaaff
       From: sip:joe@example.com;tag=99a8s
       To: sip:joe@example.com
       Call-ID: 88askjda9@pc34.example.com
       CSeq: 9976 REGISTER
       Contact: sip:joe@pc34.example.com



  • NOTIFY
    SIP Registrar 서버에 죠가 등록하자 마자 애플리케이션 서버에게 NOTIFY로 등록 상태 정보를 통지합니다.


       NOTIFY sip:app.example.com SIP/2.0
       Via: SIP/2.0/UDP server19.example.com;branch=z9hG4bKnasaij
       From: sip:joe@example.com;tag=xyzygg
       To: sip:app.example.com;tag=123aa9
       Call-ID: 9987@app.example.com
       CSeq: 1289 NOTIFY
       Contact: sip:server19.example.com
       Event: reg
       Max-Forwards: 70
       Content-Type: application/reginfo+xml
       Content-Length: ...

       
    <?xml version="1.0"?>
       <reginfo xmlns="urn:ietf:params:xml:ns:reginfo"
                 version="1" state="partial">
         <registration aor="sip:joe@example.com" id="a7" state="active">
               <contact id="76" state="active" event="registered"
                 duration-registered="0">
              <uri>sip:joe@pc34.example.com</uri>
           </contact>
         </registration>
       </reginfo>


  • MESSAGE
    애플리케이션 서버는 확보된 Contact 주소로 “Welcome to the example.com service”가 발송됩니다.

       MESSAGE sip:joe@pc34.example.com SIP/2.0
       Via: SIP/2.0/UDP app.example.com;branch=z9hG4bKnashds8
       From: sip:app.example.com;tag=123aa10
       To: sip:joe@example.com
       Call-ID: 9988@app.example.com
       CSeq: 82779 MESSAGE
       Max-Forwards: 70
       Content-Type: text/plain
       Content-Length: ...

       
    Welcome to the example.com service!



등록상태 정보를 이용한 상태정보를 송수신하는 과정을 예제로 살펴보았습니다. 지금까지는 단말 위주의 상태 정보였다면, 사용자 레벨에서 상태정보를 전달할 필요가 있습니다. 즉, 사용자가 다수의 단말을 사용할 경우에 각각 변하는 상태정보를 종합적으로 전달해야 합니다. 



마치며
다음 글에서는 사용자의 상태를 확인하기 위한 PUBLISH 메쏘드를 살펴보겠습니다. 






"다시쓰는 SIP의 이해" 연재의 다른 글  


2015/07/09 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 22편 Chapter 8. RTP의 이해


2015/07/09 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 21편 Chapter 7. 가끔 보는 SIP Method


2015/07/08 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 20편 Chapter 7. 가끔 보는 SIP Method


2015/05/20 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 19편 Chapter 7. 가끔 보는 SIP Method


2015/05/18 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 18편 Chapter 7. 가끔 보는 SIP Method


2015/05/07 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 17편 Chapter 6. SIP Method


2015/02/26 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 16편 Chapter 6. SIP Method


2015/02/23 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 15편 Chapter 6. SIP Method


2015/02/11 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 14편 Chapter 6. SIP Method

2015/01/30 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 13편 Chaper 5.SDP


2015/01/29 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 12편 Chapter 5. SDP


2015/01/05 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 11편 Chapter 5. SDP


2014/12/09 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 10편 Chapter 4. SIP Response


2014/12/04 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 9편 Chapter 3. SIP Method on RFC 3261


2014/12/03 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 8편 Chapter 3. SIP Method on RFC 3261


2014/12/02 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 7편 Chapter 3. SIP Method on RFC 3261


2014/11/26 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 6편 Chapter 2. SIP Overview


2014/11/21 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 5편 Chapter 2. SIP Overview


2014/11/19 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 4편 Chapter 1. VoIP의 이해 (3)


2014/11/11 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 3편 Chapter 1. VoIP의 이해 (2)


2014/11/05 - [SIP의 이해] - [연재] 다시쓰는 SIP의 이해 - 2편 Chapter 1. VoIP의 이해 (1)




라인하
트 유씨누스 (CCIEV #18487)
  --------------------------------------
ucwana@gmail.com (라인하트의 구글 이메일) 
http://twitter.com/nexpertnet (넥스퍼트 블로그의 트위터, 최신 업데이트 정보 및 공지 사항) 
http://groups.google.com/group/cciev (시스코 UC를 공부하는 사람들이 모인 구글 구룹스) 
http://groups.google.com/group/ucforum (UC를 공부하는 사람들이 모인 구글 구룹스) 
세상을 이롭게 하는 기술을 지향합니다. ______________________________________________