Presence协议介绍内容提要什么是PRESENCE及用途PRESENCE实现的基本框架内容格式及相关的协议介绍PRESENCE实现的扩展XCAP隐私策略数据的网络同步群组的管理什么是PRESENCEPresenceisameansforfinding,retrieving,andsubscribingtochangesinthepresenceinformation(e.g.“online”or“offline”)ofotherusers(RFC2779)Presence技术是伴随即时通信业务的发展而出现的Presence服务指依靠Presence技术反应通信对方的用户状态以及这种状态下该状态下能够提供什么样的通信方式,通信双方通过订阅对方的状态信息,选择最合适的通信方式,提高通信效率和质量.什么是PRESENCEQQMSNQQ个性签名PRESENCE用途即时通信中双方状态的获取.会议过程中各个与会代表状态的获取.目前presence主要用于即时通信系统中,随着通信技术的发展presence的作用已经不仅限于即时通信,包括多种通信方式例如会议等也会运用presence技术.研究现状目前研究Presence/IM业务的国际组织有IETF、3GPP、3GPP2、OMA等。被广泛认可的Presence/IM技术标准目前主要有两个:基于SIP扩展的SIMPLE和基于XML的XMPP协议,他们都是由IETF提出来并发展的,有着不同的支持者和用户群。PRESENCE实现的基本框架SIMPLE标准依据RFC2778和RFC2779规定了Presence服务的模型PRESENCE实现的基本框架PRESENCE实现的基本框架F1SUBSCRIBEwatcher-example.comserverSUBSCRIBEsip:resource@example.comSIP/2.0Via:SIP/2.0/TCPwatcherhost.example.com;branch=z9hG4bKnashds7To:sip:resource@example.comFrom:sip:user@example.com;tag=xfg9Call-ID:2010@watcherhost.example.comCSeq:17766SUBSCRIBEMax-Forwards:70Event:presenceAccept:application/pidf+xmlContact:sip:user@watcherhost.example.comExpires:600Content-Length:0PRESENCE实现的基本框架F2200OKexample.comserver-watcherSIP/2.0200OKVia:SIP/2.0/TCPwatcherhost.example.com;branch=z9hG4bKnashds7;received=192.0.2.1To:sip:resource@example.com;tag=ffd2From:sip:user@example.com;tag=xfg9Call-ID:2010@watcherhost.example.comCSeq:17766SUBSCRIBEExpires:600Contact:sip:server.example.comContent-Length:0PRESENCE实现的基本框架F3NOTIFYexample.comserver-watcherNOTIFYsip:user@watcherhost.example.comSIP/2.0Via:SIP/2.0/TCPserver.example.com;branch=z9hG4bKna998skFrom:sip:resource@example.com;tag=ffd2To:sip:user@example.com;tag=xfg9Call-ID:2010@watcherhost.example.comEvent:presenceSubscription-State:active;expires=599Max-Forwards:70CSeq:8775NOTIFYContact:sip:server.example.comContent-Type:application/pidf+xmlContent-Length:...[PIDFDocument]PRESENCE实现的基本框架F4200OKwatcher-example.comserverSIP/2.0200OKVia:SIP/2.0/TCPserver.example.com;branch=z9hG4bKna998sk;received=192.0.2.2From:sip:resource@example.com;tag=ffd2To:sip:user@example.com;tag=xfg9Call-ID:2010@watcherhost.example.comCSeq:8775NOTIFYContent-Length:0PRESENCE实现的基本框架以上的内容对应RFC2778,RFC2779RFC3265SIP-SpecificEventNotificationdefinestheSUBSCRIBEandNOTIFYmethodsforSIP,formingthecoreoftheSIPeventnotificationframework.RFC3856APresenceEventPackageforSIP描述了基于SIPsubscribe/notification事件框架的presence技术,这是SIPMLE协议的基础,这里更具体的定义了presence概念内容格式及相关协议Onceauserhasgeneratedasubscriptiontopresenceusingthecoreprotocolmachinery,theywillreceivenotifications(SIPNOTIFYrequests)whichcontainpresenceinformation.内容格式及相关协议相关的格式规范主要有RFC3863PIDF:PresenceInformationDataFormatRFC4479ADataModelforPresenceRFC4480RPID:RichPresenceExtensionstoPIDFRFC4481TimedPresenceExtensionstoPIDFRFC4482CIPID:ContactInformationforPIDF内容格式及相关协议--PIDF?xmlversion=1.0encoding=UTF-8?presencexmlns=urn:ietf:params:xml:ns:pidfxmlns:im=urn:ietf:params:xml:ns:pidf:imxmlns:myex==pres:someone@example.comtupleid=bs35r9statusbasicopen/basicim:imbusy/im:immyex:locationhome/myex:location/statuscontactpriority=0.8im:someone@mobilecarrier.net/contactnotexml:lang=enDon'tDisturbPlease!/notenotexml:lang=frNederangezpas,s'ilvousplait/notetimestamp2001-10-27T16:49:29Z/timestamp/tupletupleid=eg92n8statusbasicopen/basic/statuscontactpriority=1.0mailto:someone@example.com/contact/tuplenoteI'llbeinTokyonextweek/note/presence内容格式及相关协议—RFC4479按照RFC4479presencedatamodel的描述把presence信息分为三个部分:person,service,devices。内容格式及相关协议—RFC4479Person描述一个发布presence信息的用户,person信息主要包含该用户的特征,状态等等,特征可以包括用户的不变信息,比如身高,年龄,以及sipuri别名等等。状态信息是关于用户的动态信息的,比如在什么地方,在做什么,心情怎么样等等。通常情况下每个presentity只能包含一个person属性。Service:每个presentity可以有多个service属性,每个service属性描述一种与该用户联系的通信方式,比如可以使传统的电话,点击通,即时消息,短消息等等。Device:用来模拟service执行的物理环境,比如一个手机,PC,PDA,telephone等等。内容格式及相关协议—RFC4479EncodingTheexistingtupleelementinthePIDFdocumentisusedtorepresenttheservice.Thisspecificationintroducesthepersonelement,whichcanappearasachildtopresence.hisspecificationalsointroducesthedeviceelement,whichcanappearasachildtopresence.?xmlversion=1.0encoding=UTF-8?presencexmlns=urn:ietf:params:xml:ns:pidfxmlns:dm=urn:ietf:params:xml:ns:pidf:data-modelxmlns:rp=urn:ietf:params:xml:ns:pidf:rpidxmlns:caps=urn:ietf:params:xml:ns:pidf:capsxmlns:xsi==sg89aestatusbasicopen/basic/statusdm:deviceIDmac:8asd7d7d70/dm:deviceIDcaps:servcaps/caps:extensionscaps:methodscaps:supportedcaps:MESSAGE//caps:supported/caps:methods/caps:servcapscontactsip:someone@example.com/contact/tupledm:personid=p1rp:activitiesrp:on-the-phone//rp:activities/dm:persondm:deviceid=pc122rp:user-inputidle/rp:user-inputdm:deviceIDmac:8asd7d7d70/dm:deviceID/dm:device/presence内容格式及相关协议—RPIDRPID(RichPresenceExtensionstothePIDF,4480)addsadditionalattributestothepresencedocumentschema,againbuildinguponthemode