一个典型的Jingle XMPP stanza:
<iq from='romeo@montague.lit/orchard'
id='xs51r0k4'
to='juliet@capulet.lit/balcony'
type='set'>
<jingle xmlns='urn:xmpp:jingle:1'
action='session-initiate'
initiator='romeo@montague.lit/orchard'
sid='a73sjjvkla37jfea'>
<content creator='initiator' name='voice'>
<description xmlns='urn:xmpp:jingle:apps:rtp:1' media='audio'>
<payload-type id='96' name='speex' clockrate='16000'/>
<payload-type id='97' name='speex' clockrate='8000'/>
<payload-type id='18' name='G729'/>
<payload-type id='0' name='PCMU' />
<payload-type id='103' name='L16' clockrate='16000' channels='2'/>
<payload-type id='98' name='x-ISAC' clockrate='8000'/>
</description>
<transport xmlns='urn:xmpp:jingle:transports:ice-udp:1'
pwd='asd88fgpdd777uzjYhagZg'
ufrag='8hhy'>
<candidate component='1'
foundation='1'
generation='0'
id='el0747fg11'
ip='10.0.1.1'
network='1'
port='8998'
priority='2130706431'
protocol='udp'
type='host'/>
<candidate component='1'
foundation='2'
generation='0'
id='y3s2b30v3r'
ip='192.0.2.3'
network='1'
port='45664'
priority='1694498815'
protocol='udp'
rel-addr='10.0.1.1'
rel-port='8998'
type='srflx'/>
</transport>
</content>
</jingle>
</iq>
从XEP-0166的XML Schema可以看出, <jingle>元素下的<content>元素minOccurs为0, maxOccurs为无限. 而<content>元素下的子元素未定义, 需要到别的XEP去看, minOccurs为0, maxOccurs为无限.
从XEP-0167的XML Schema可以看出, <description>元素下的<payload-type>元素minOccurs为0, maxOccurs为无限.
从XEP-0176的XML Schema可以看出, <transport>元素下的<candidate>元素minOccurs为1, maxOccurs为无限.
结合起来, 意味着<jingle>元素作为<iq>元素的子元素, 其下面可以包含任意多个<content>子元素, 而<content>子元素下面可以包含任意的<description>元素和<transport>元素.
所以, Libjingle在实现Jingle协议的时候, 设计了对应的数据结构来实现各种可能的情况, 导致代码看起来很晦涩, 其实对照Jingle的XML Schema来看, 就很容易理解了.
分享到:
相关推荐
XMPP JINGLE Jar包 可以实现语音聊天功能
delphi xmpp jabber客户端 最新版2.3.1
beem -- 一款基于xmpp jingle 的一款android 聊天工具 eclipse android工程,IM系统自己用openfire搭建一个就行了。有什么疑问可以联系我。
开源项目AgsXMPP,在原来基础上参考XMPP官方文档进行了音视频扩展协议Jingle的实现,并对整个命名空间进行了规范化!
正在安装npm install stanza回声客户端演示import * as XMPP from 'stanza' ;const client = XMPP . createClient ( { jid : 'echobot@example.com' , password : 'hunter2' , // If you have a .well-known/host-...
关于xmpp的权威开发指南,网上电子书,如有侵权,请告知。
webrtc和jingle技术研究。语音和视频技术研究。
XEP-Jingle协议文档,来自XEP官方网站
webapp jingle 可以封装打包 有各种空间
jingle.js非常好的单页客户端框架,而且非常全面的编写html5手机客户端的框架 并有demo,集成了zeptp、iscroll、template等框架
野电话使用 Jingle 和 Smack API 的 XMPP VoIP 应用程序
openfire与libjingle都是即时通讯系统开发中的很牛的开源软件(库),openfire是支持java很好的jabber服务器,libjingle可以和gtalk通信,并实现了p2p以及电话等功能,由google公司release的。
非常好的,而且非常全面的编写html5手机客户端的框架 并有demo,集成了zeptp、iscroll、template等框架
组件包包括了Jingle和Jingle-Audio的google实现的源代码,它们是XMPP标准的推荐扩展,目前试验版可用。 我们发布此代码是为了让消费者们在实时通讯工具的选择和操作性更多些。Google的源码发布基于Berkeley协议,也...
shixy-Jingle
webrtc是一个很好的音视频操作库, 此代码包含WEBRTC中JNGLE部分的内容,方便集成和使用。
组件包包括了Jingle和Jingle-Audio的google实现的源代码,它们是XMPP标准的推荐扩展,目前试验版可用。 我们发布此代码是为了让消费者们在实时通讯工具的选择和操作性更多些。Google的源码发布基于Berkeley协议,也...
jeesite框架开发手机端功能,所使用的Jingle UI 帮助文档,页面布局说明,部分标签使用说明
beem source file! 用于asmack jingle 传输!