This article is from csdn lidp http://blog.csdn.net/perfectpdl. please refer to this article and thank you.
Rfc3265 is an extension of the SIP protocol. It defines a framework for implementing event subscription and notification on the SIP protocol. For example, you subscribe to the status of your friends, similar to QQ friends, your friend will notify you of his status. Of course, this involves servers, but the basic principle is as follows.
This framework involves subscribers and contacts. The basic process is as follows:
Subscriber notifier | ----- subscribe ----> | subscriber subscribes to the peer status | <------- 200 -------- | the recipient confirms the status after receiving the subscriber | <------ y ----- | the recipient returns the status of the subscribe to the peer immediately after confirmation | -------- 200 -------> | <------ y ----- | the subscriber returns the 200 OK message after receiving the message. | -------- 200 -------> |
Similar to the registration behavior in the SIP protocol, the subscription is refreshed, and the initial subscription has an expire header to specify the subscription expiration time. During this period, the subscriber will periodically send the subscription request, if the notification recipient does not receive the subscription refresh within the specified expire time, the notification recipient will not be notified of the status.
This specification introduces two new sip Methods: Subscribe and consumer Y. When a subscribe is initiated, its message header event identifies the event type to be subscribed to, such as the status (presence, RFC 3842 ), message-summary.
The subscribe-state in the message header specifies the subscriber status, which can be active, pending, and terminate.
Send specific event information through the message body, generally in XML format.
Similar to registration, a subscriber cancels the subscription by sending a subscribe with an expire of 0. The Subscriber immediately sends notify, And the subscribe-state header specifies the status as terminate to stop the subscription.
This Protocol is combined with RFC 3856 and rfc3428 defines simple ,(TheSession Initiation Protocol for instant messaging and presence leveraging extensionsIs the online status and instant messaging (IM) based on the SIP protocol ).
Refer:
Http://en.wikipedia.org/wiki/SIMPLE
Http://tools.ietf.org/html/rfc5638