SIP Presence (二)

SIP 消息流程,模糊了RLS 和PS 这些节点。 原来想和 (一)合在一起。还是单独写出来吧。 后面在继续一点XCAP部分,描述下RLS,PS 与XDMS 之间的业务和消息流程。

也就贴了下RFC 里的消息流程。


PUA                     PA                      WATCHER
         (EPA)                   (ESC)
           |                       |                         |
           |                       | <---- M1: SUBSCRIBE --- |
           |                       |                         |
           |                       | ----- M2: 200 OK -----> |
           |                       |                         |
           |                       | ----- M3: NOTIFY -----> |
           |                       |                         |
           |                       | <---- M4: 200 OK ------ |
           |                       |                         |
           |                       |                         |
           | ---- M5: PUBLISH ---> |                         |
           |                       |                         |
           | <--- M6: 200 OK ----  |                         |
           |                       |                         |
           |                       | ----- M7: NOTIFY -----> |
           |                       |                         |
           |                       | <---- M8: 200 OK ------ |
           |                       |                         |
           | ---- M9: PUBLISH ---> |                         |
           |                       |                         |
           | <--- M10: 200 OK ---  |                         |
           |                       |                         |
           |                       |                         |
           | --- M11: PUBLISH ---> |                         |
           |                       |                         |
           | <-- M12: 200 OK ----  |                         |
           |                       |                         |
           |                       | ----- M13: NOTIFY ----> |
           |                       |                         |
           |                       | <---- M14: 200 OK ----- |
           |                       |                         |


   Event State: State information for a resource, associated with an event package and an address-of-record.

   Event Publication Agent (EPA): The User Agent Client (UAC) that issues PUBLISH requests to publish event state.

   Event State Compositor (ESC): The User Agent Server (UAS) that processes PUBLISH requests, and is responsible for compositing event state into a complete, composite event state of a resource.

     A User Agent Client (UAC) that publishes event state is labeled an Event Publication Agent (EPA).  For presence, this is the familiar Presence User Agent

   (PUA) role. The entity that processes the PUBLISH request is known as an Event State Compositor

  

M1: The watcher initiates a new subscription to the
      presentity@example.com's presence agent.

      SUBSCRIBE sip:presentity@example.com SIP/2.0
      Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7
      To: <sip:presentity@example.com>
      From: <sip:watcher@example.com>;tag=12341234
      Call-ID: 12345678@host.example.com
      CSeq: 1 SUBSCRIBE
      Max-Forwards: 70
      Expires: 3600
      Event: presence            ( 如果是Watcher information 的SUBSCRIBER,Event: present.winfo)
      Contact: sip:user@host.example.com
      Content-Length: 0

   M2: The presence agent for presentity@example.com processes the
      subscription request and creates a new subscription.  A 200 (OK)
      response is sent to confirm the subscription.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7
       ;received=192.0.2.1
      To: <sip:presentity@example.com>;tag=abcd1234
      From: <sip:watcher@example.com>;tag=12341234
      Call-ID: 12345678@host.example.com
      CSeq: 1 SUBSCRIBE
      Contact: sip:pa.example.com
      Expires: 3600

 


   M3: In order to complete the process, the presence agent sends the
      watcher a NOTIFY with the current presence state of the
      presentity.

     NOTIFY sip:user@host.example.com SIP/2.0
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 1 NOTIFY
      Max-Forwards: 70
      Event: presence
      Subscription-State: active; expires=3599
      Contact: sip:pa.example.com
      Content-Type: application/pidf+xml
      Content-Length: ...

      <?xml version="1.0" encoding="UTF-8"?>
      <presence xmlns="urn:ietf:params:xml:ns:pidf"
                entity="pres:presentity@example.com">
         <tuple id="mobile-phone">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T16:49:29Z</timestamp>
         </tuple>
         <tuple id="gwewg991">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T12:21:29Z</timestamp>
         </tuple>
      </presence>

   M4: The watcher confirms receipt of the NOTIFY request.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2
       ;received=192.0.2.2
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 1 NOTIFY

   M5: A presence user agent for the presentity initiates a PUBLISH to
      the presentity's presence agent in order to update it with new
      presence information.  The Expires header indicates the desired
      duration of this soft state.

      PUBLISH sip:presentity@example.com SIP/2.0
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK652hsge
      To: <sip:presentity@example.com>
      From: <sip:presentity@example.com>;tag=1234wxyz
      Call-ID: 81818181@pua.example.com
      CSeq: 1 PUBLISH
      Max-Forwards: 70
      Expires: 3600
      Event: presence
      Content-Type: application/pidf+xml
      Content-Length: ...

      <?xml version="1.0" encoding="UTF-8"?>
      <presence xmlns="urn:ietf:params:xml:ns:pidf"
                entity="pres:presentity@example.com">
         <tuple id="efeef223">
            <status>
               <basic>closed</basic>
            </status>
            <timestamp>2003-02-01T17:00:19Z</timestamp>
         </tuple>
      </presence>

   M6: The presence agent receives, and accepts the presence
      information.  The published data is incorporated into the
      presentity's presence document.  A 200 (OK) response is sent to
      confirm the publication.  The 200 (OK) response contains an
      SIP-ETag header field with an entity-tag.  This is used to
      identify the published event state in subsequent PUBLISH requests.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK652hsge
       ;received=192.0.2.3
      To: <sip:presentity@example.com>;tag=1a2b3c4d
      From: <sip:presentity@example.com>;tag=1234wxyz
      Call-ID: 81818181@pua.example.com
      CSeq: 1 PUBLISH
      SIP-ETag: dx200xyz
      Expires: 1800

   M7: The presence agent determines that a reportable change has been
      made to the presentity's presence document, and sends another
      notification to those watching the presentity to update their
      information regarding the presentity's current presence status.
      
      NOTIFY sip:user@host.example.com SIP/2.0
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK4cd42a
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 2 NOTIFY
      Max-Forwards: 70
      Event: presence
      Subscription-State: active; expires=3400
      Contact: sip:pa.example.com
      Content-Type: application/pidf+xml
      Content-Length: ...

      <?xml version="1.0" encoding="UTF-8"?>
      <presence xmlns="urn:ietf:params:xml:ns:pidf"
                entity="pres:presentity@example.com">
         <tuple id="efeef223">
            <status>
               <basic>closed</basic>
            </status>
            <timestamp>2003-02-01T17:00:19Z</timestamp>
         </tuple>
         <tuple id="gwewg991">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T12:21:29Z</timestamp>
         </tuple>
      </presence>

   M8: The watcher confirms receipt of the NOTIFY request.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK4cd42a
       ;received=192.0.2.2
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 2 NOTIFY
      Content-Length: 0

   M9: The PUA determines that the event state it previously published
      is about to expire, and refreshes that event state.

      PUBLISH sip:presentity@example.com SIP/2.0
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK771ash02
      To: <sip:presentity@example.com>
      From: <sip:presentity@example.com>;tag=1234kljk
      Call-ID: 98798798@pua.example.com
      CSeq: 1 PUBLISH
      Max-Forwards: 70
      SIP-If-Match: dx200xyz
      Expires: 3600
      Event: presence
      Content-Length: 0

   M10: The presence agent receives, and accepts the publication
      refresh.  The timers regarding the expiration of the specific
      event state identified by the entity-tag are updated.  As always,
      the ESC returns an entity-tag in the response to a successful
      PUBLISH.  Note that no actual state change has occured, so the
      watchers will receive no NOTIFYs.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bK771ash02
       ;received=192.0.2.3
      To: <sip:presentity@example.com>;tag=2affde434
      From: <sip:presentity@example.com>;tag=1234kljk
      Call-ID: 98798798@pua.example.com
      CSeq: 1 PUBLISH
      SIP-ETag: kwj449x
      Expires: 1800

   M11: The PUA of the presentity detects a change in the user's
      presence state.  It initiates a PUBLISH request to the presence
      agent to modify the published presence information with the recent
      change.
      
      PUBLISH sip:presentity@example.com SIP/2.0
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bKcdad2
      To: <sip:presentity@example.com>
      From: <sip:presentity@example.com>;tag=54321mm
      Call-ID: 5566778@pua.example.com
      CSeq: 1 PUBLISH
      Max-Forwards: 70
      SIP-If-Match: kwj449x
      Expires: 3600
      Event: presence
      Content-Type: application/pidf+xml
      Content-Length: ...

      <?xml version="1.0" encoding="UTF-8"?>
      <presence xmlns="urn:ietf:params:xml:ns:pidf"
                entity="pres:presentity@example.com">
         <tuple id="efeef223">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T19:15:15Z</timestamp>
         </tuple>
      </presence>

   M12: The presence agent receives, and accepts the publication
      modification.  The timers regarding the expiration of the specific
      event state identified by the entity-tag are updated, and the
      published data is incorporated into the presentity's presence
      document.  Note that the document delivered in this modification
      will replace the previous document.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pua.example.com;branch=z9hG4bKcdad2
       ;received=192.0.2.3
      To: <sip:presentity@example.com>;tag=effe22aa
      From: <sip:presentity@example.com>;tag=54321mm
      Call-ID: 5566778@pua.example.com
      CSeq: 1 PUBLISH
      SIP-ETag: qwi982ks
      Expires: 3600

   M13: The presence agent determines that a reportable change has been
      made to the presentity's presence document, and sends another
      notification to those watching the presentity to update their
      information regarding the presentity's current presence status.

  NOTIFY sip:user@host.example.com SIP/2.0
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK32defd3
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 2 NOTIFY
      Max-Forwards: 70
      Event: presence
      Subscription-State: active; expires=3400
      Contact: sip:pa.example.com
      Content-Type: application/pidf+xml
      Content-Length: ...

      <?xml version="1.0" encoding="UTF-8"?>
      <presence xmlns="urn:ietf:params:xml:ns:pidf"
                entity="pres:presentity@example.com">
         <tuple id="efeef223">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T19:15:15Z</timestamp>
         </tuple>
         <tuple id="gwewg991">
            <status>
               <basic>open</basic>
            </status>
            <timestamp>2003-02-01T12:21:29Z</timestamp>
         </tuple>
      </presence>

   M14: The watcher confirms receipt of the NOTIFY request.

      SIP/2.0 200 OK
      Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK32defd3
       ;received=192.0.2.3
      To: <sip:watcher@example.com>;tag=12341234
      From: <sip:presentity@example.com>;tag=abcd1234
      Call-ID: 12345678@host.example.com
      CSeq: 2 NOTIFY
      Content-Length: 0


RFC 3265 - Session Initiation Protocol (SIP)-Specific Event Notification

在NOTIFY 中, 通过Subscription-State header 来决定当前的SUBSCRIBER是否成功。200 OK 只是在transaction 层面上对于SUBSCRIBER的一个response,并不能说明SUBSCRIBER是否成功,需要后续的NOTIFY消息来告知。

   If the "Subscription-State" header value is "active", it means that
   the subscription has been accepted and (in general) has been
   authorized.  If the header also contains an "expires" parameter, the
   subscriber SHOULD take it as the authoritative subscription duration
   and adjust accordingly.  The "retry-after" and "reason" parameters
   have no semantics for "active".

   If the "Subscription-State" value is "pending", the subscription has
   been received by the notifier, but there is insufficient policy
   information to grant or deny the subscription yet.  If the header
   also contains an "expires" parameter, the subscriber SHOULD take it
   as the authoritative subscription duration and adjust accordingly.
   No further action is necessary on the part of the subscriber.  The
   "retry-after" and "reason" parameters have no semantics for
   "pending".

   If the "Subscription-State" value is "terminated", the subscriber
   should consider the subscription terminated.  The "expires" parameter
   has no semantics for "terminated".  If a reason code is present, the
   client should behave as described below.  If no reason code or an
   unknown reason code is present, the client MAY attempt to re-
   subscribe at any time (unless a "retry-after" parameter is present,
   in which case the client SHOULD NOT attempt re-subscription until
   after the number of seconds specified by the "retry-after"
   parameter).  The defined reason codes are:

   deactivated: The subscription has been terminated, but the subscriber
      SHOULD retry immediately with a new subscription.  One primary use
      of such a status code is to allow migration of subscriptions
      between nodes.  The "retry-after" parameter has no semantics for
      "deactivated".

   probation: The subscription has been terminated, but the client
      SHOULD retry at some later time.  If a "retry-after" parameter is
      also present, the client SHOULD wait at least the number of
      seconds specified by that parameter before attempting to re-
      subscribe.

   rejected: The subscription has been terminated due to change in
      authorization policy.  Clients SHOULD NOT attempt to re-subscribe.
      The "retry-after" parameter has no semantics for "rejected".

   timeout: The subscription has been terminated because it was not
      refreshed before it expired.  Clients MAY re-subscribe
      immediately.  The "retry-after" parameter has no semantics for
      "timeout".

   giveup: The subscription has been terminated because the notifier
      could not obtain authorization in a timely fashion.  If a "retry-
      after" parameter is also present, the client SHOULD wait at least
      the number of seconds specified by that parameter before
      attempting to re-subscribe; otherwise, the client MAY retry
      immediately, but will likely get put back into pending state.

   noresource: The subscription has been terminated because the resource
      state which was being monitored no longer exists.  Clients SHOULD
      NOT attempt to re-subscribe.  The "retry-after" parameter has no
      semantics for "noresource".

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
### 回答1: 联想 checking media presence 是指联想电脑正在检查是否有可用的媒体设备,例如硬盘、光驱或USB设备等。这通常会在电脑启动时出现,如果检查失败,可能会导致电脑无法启动或无法识别外部设备。 ### 回答2: “联想 checking media presence”是在联想电脑开机时出现的提示信息,表示联想电脑正在检查某种介质的存在。事实上,“checking media presence”通常是用来检查联网设备(如网卡)和启动优先级硬件设备是否有电源供应、是否与电脑连接正常等。需要注意的是,如果出现此提示,且没有出现错误信息或其他异常情况,那么就说明联想电脑的硬件设备是正常工作的。 在联想电脑开机时,很多硬件设备需要判断其是否能正常连接和运行,因此出现“checking media presence”信息时有一点点等候时间是正常的。此时,我们通常只需要等待片刻,直到启动的硬件设备被检测无误,就会自动进入下一步操作。如果“checking media presence”信息长时间显示并导致电脑无法启动,我们可以考虑以下解决方法: 1. 检查电脑连接:检查电源线、VGA线、HDMI线、网线等是否插紧,确保物理连接良好。 2. 检查启动优先级:确保电脑的启动优先级设置正确,先检测硬盘,然后是光驱或USB存储设备。 3. 检查BIOS:进入BIOS设置界面,检查硬件设备是否被启用,检查所有设备的配置选项是否正确。 如果上述方法无法解决,可能是该硬件设备出现了故障,需要找专业技术人员进行进一步检修和维护。 最后要提醒的是,在使用电脑时,我们要养成良好的使用习惯,安装系统和软件的时候选择正规途径,避免使用恶意程序或下载病毒,以保证硬件设备健康运行。 ### 回答3: “联想checking media presence”是一个启动引导过程中的错误信息。它几乎在所有PC和笔记本电脑中出现,而且会一直闪现,占用了大多数CPU的时间和资源。 这个错误信息的意思是,计算机正在试图检测某个连接到计算机的存储设备,例如硬盘驱动器、光驱或USB设备。计算机正在检查这些设备是否与计算机连接,并是否能够被计算机完全识别。 一些原因会导致“联想checking media presence”错误信息的出现,例如: 1. 损坏的硬盘驱动器或USB设备。 2. BIOS设置错误或过时。 3. 电缆插头未连接好或松动。 解决此问题有几种方法: 1. 检查所有存储设备和电缆是否正确连接。确保电缆没有松动或损坏。 2. 减少启动设备数量,只保留必须的设备。 3. 修改BIOS设置以使计算机从正确的启动设备启动。 4. 如果问题仍然存在,请考虑更改硬盘驱动器或USB设备。 总的来说,“联想checking media presence”的错误信息并不是什么严重的问题。只需按照上述步骤进行一些检查和修改设置即可轻松解决问题。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值