xep-0166中的xmpp协议jingle中文帮助文档内容摘要:

ms:xml:ns:xmppstanzas39。 / /error /iq 如果接收方希望转向另一个地址,它 应该 返回一个 redirect/错误。 例 4. 接收 方转向 iq type=39。 error39。 /balcony39。 /orchard39。 id=39。 jingle139。 error type=39。 cancel39。 redirect xmlns=39。 urn:ietf:params:xml:ns:xmppstanzas39。 xmpp:m/redirect /error /iq 如果接收方不支持 Jingle,则 必须 返回一个错误。 例 5. 接收方不支持 Jingle iq type=39。 error39。 /balcony39。 /orchard39。 id=39。 jingle139。 error type=39。 cancel39。 serviceunavailable xmlns=39。 urn:ietf:params:xml:ns:xmppstanzas39。 / /error /iq 如果接收方不支持任何一种指定的内容 描述格式,它 必须 返回一个 featurenotimplemented/错误,和具有 Jingle 特性的出错条件的 unsupportedcontent。 例 6. 接收方不支持任何内容描述格式 iq type=39。 error39。 /balcony39。 /orchard39。 id=39。 jingle139。 error type=39。 cancel39。 featurenotimplemented xmlns=39。 urn:ietf:params:xml:ns:xmppstanzas39。 / unsupportedcontent xmlns=39。 /error /iq 如果接收方不支持任何一种指定的内容传输方法,它 必须 返回一个 featurenotimplemented/错误,和具有 Jingle 特性的出错条件的 unsupportedtransports。 例 7. 接收方不支持任何内容传输方法 iq type=39。 error39。 /balcony39。 /orchard39。 id=39。 jingle139。 error type=39。 cancel39。 featurenotimplemented xmlns=39。 urn:ietf:params:xml:ns:xmppstanzas39。 / unsupportedtransports xmlns=39。 /error /iq 如果发起请求的格式错误,接收方 必须 返回一个 badrequest/错误。 例 8. 发起请求的格式错误 iq type=39。 error39。 /balcony39。 /orchard39。 id=39。 jingle139。 error type=39。 cancel39。 badrequest xmlns=39。 urn:ietf:params:xml:ns:xmppstanzas39。 / /error /iq 拒绝 为拒绝会话发起请求,接收方 必须 响应收到的会话发起请求,然后按 中止 中描述的方法中止会话。 协商 一般情况下,双方在达成可接受的一系列内容类型、内容描述格式和内容传输方法前,协商是必要的。 可能要协商的这些参数的组合是很多的,这里并没有列出全部(有些在各种内容描述格式和内容传输方法规范中列出)。 一个会话级的协商是移除一种内容类型。 例如,让我们设想,有一天朱丽叶的心情很糟糕,她当然不想在和罗密欧的 Jingle 会话中包含视频,所以她给罗密欧发送了一个 “内容移除 ”请求: 例 9. 内容类型移除 iq /balcony39。 /orchard39。 id=39。 reduce139。 type=39。 set39。 jingle xmlns=39。 action=39。 contentremove39。 /orchard39。 sid=39。 a73sjjvkla37jfea39。 content creator=39。 initiator39。 name=39。 thisisthevideocontent39。 / /jingle /iq 实体收到了这个会话缩减请求,然后响应这个请求: 例 10. 响应 iq /orchard39。 /balcony39。 id=39。 reduce139。 type=39。 result39。 / 如果缩减的结果是会话不再有任何内容类型,收到会话缩减的实体 应该 向另一方发送会话中止动作(因为没有内容类型的会话是无效的)。 另一个会话级 的协商是增加一个内容类型;然而,这个动作 必不能 在会话处于 阻塞 状态时来做,只有在会话处于 活动 状态时才可以。 接受 协商过内容传输方法和内容描述格式后,如果接收方确定能够建立连接,它将向发起方法送确定接受: 例 11. 接收方确定接受呼叫 iq type=39。 set39。 /balcony39。 /orchard39。 id=39。 accept139。 jingle xmlns=39。 action=39。 sessionaccept39。 /orchard39。 /balcony39。 sid=39。 a73sjjvkla37jfea39。 content creator=39。 initiator39。 name=39。 thisistheaudiocontent39。 description xmlns=39。 … /description transport xmlns=39。 candidate .../ /transport /content /jingle /iq jingle/元素 必须 包含一个或多个 content/元素,后者 必须 包含一个 description元素和一个 transport/元素。 jingle/元素 应该 有 „responder‟属性,以明确指明响应实体的完整 JID,有关当前 Jingle 会话的所有通讯,发起方应该向这个 JID 发送。 然后发起方响应接收方的确认接受: 例 12. 发起方响应确认接受 iq type=39。 result39。 /balcony39。 /orchard39。 id=39。 accept139。 / 此时,发起方和接收方可以通过协商好的连接开始发送内容了。 如果一方无法找到合适的内容传输方法,它 应该 下面描述的那样中止会话。 修改活动会话 为修改一个活动会话,任一方都可向另一方发送 contentremove、 contentadd、 contentmodify, descriptionmodify、 transportmodify 动作。 然后接收方发送恰当的accept或 decline动作,也可能首先发送一个 info动作。 如果双方同时发送了修改消息,那么会话发起方的修改消息 必须 胜过接收方的修改消息,发起方 应该 返回一个 unexpectedrequest/错误。 修改活动会话的一个例子是增加一个会话内容。 例如,设想一下朱丽叶的心情好了,现在想加入视频。 于是向罗密欧发送 contentadd请求: 例 13. 增加一个内容类型 iq /balcony39。 /orchard39。 id=39。 add139。 type=39。 set39。 jingle xmlns=39。 action=39。 contentadd39。 /orchard39。 sid=39。 a73sjjvkla37jfea39。 content creator=39。 responder39。 name=39。 videoisback39。 description xmlns=39。 … /description transport xmlns=39。 candidate .../ /transport /content /jingle /iq 实体接收到会话扩展请 求,响应这个请求,如果可接受,返回一个内容接受: The entity receiving the session extension request then acknowledges the request and, if it is acceptable, returns a contentaccept: 例 14. 响应 iq /orchard39。 /balcony39。 id=39。 add139。 type=39。 result39。 / 例 15. 内容接受 iq /orchard39。 /balcony39。 id=39。 add239。 type=39。 set39。 jingle xmlns=。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。