Jingle-Android 文件传输
我正在尝试在我的应用程序中通过 jingle 实现文件传输。有人可以帮
我解决这个错误吗?我不明白为什么当服务器可以
使用 Spark 处理文件传输时它说服务不可用,所以我想我可能忘记了有关
应该添加的提供程序或扩展的信息。
我已经有了这个:
pm.addIQProvider("jingle", "http://jabber.org/protocol/jingle",
new org.jivesoftware.smackx.provider.JingleProvider());
pm.addExtensionProvider("description", "http://jabber.org/protocol/jingle/description/audio",
new org.jivesoftware.smackx.provider.JingleContentDescriptionProvider.Audio());
pm.addExtensionProvider("description", "http://jabber.org/protocol/jingle/description/audio",
new org.jivesoftware.smackx.provider.JingleContentDescriptionProvider.Audio());
pm.addExtensionProvider("transport", "http://jabber.org/protocol/jingle/transport/ice",
new org.jivesoftware.smackx.provider.JingleTransportProvider.Ice());
pm.addExtensionProvider("transport", "http://jabber.org/protocol/jingle/transport/raw-udp",
new org.jivesoftware.smackx.provider.JingleTransportProvider.RawUdp());
pm.addExtensionProvider("busy", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Busy());
pm.addExtensionProvider("hold", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Hold());
pm.addExtensionProvider("mute", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Mute());
pm.addExtensionProvider("queued", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Queued());
pm.addExtensionProvider("ringing", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Ringing());
日志显示:
D/SMACK (19570): 07:57:35 PM RCV (1079353408):
<iq type="error" id="u63Ey-6"
from="[email protected]/Smack"
to="[email protected]/Smack">
<jingle xmlns="urn:xmpp:jingle:1"
initiator="[email protected]/Smack"
responder="[email protected]/Smack"
action="transport-info" sid="4522287730196205154">
<content creator="initiator" name="JingleMediaManager">
<description xmlns="urn:xmpp:jingle:apps:rtp:1">
<payload-type id="0" name="PCMU" channels="1" clockrate="16000"/>
<payload-type id="3" name="gsm" channels="1" clockrate="0"/>
<payload-type id="4" name="g723" channels="1" clockrate="0"/>
</description>
<transport xmlns="http://www.xmpp.org/extensions/xep-0177.html#ns"/>
<transport xmlns="http://www.xmpp.org/extensions/xep-0177.html#ns">
<candidate generation="0" ip="192.168.123.102" port="10562"/>
</transport>
</content>
</jingle>
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error></iq>
I am trying to implement a file transfer via jingle in my app. Can anybody please help
me with this error? I dont why it says service-unavailable when the server can handle file
transfer using spark, so i guess i might forgot something about the providers or extensions
that should be added.
I already have this:
pm.addIQProvider("jingle", "http://jabber.org/protocol/jingle",
new org.jivesoftware.smackx.provider.JingleProvider());
pm.addExtensionProvider("description", "http://jabber.org/protocol/jingle/description/audio",
new org.jivesoftware.smackx.provider.JingleContentDescriptionProvider.Audio());
pm.addExtensionProvider("description", "http://jabber.org/protocol/jingle/description/audio",
new org.jivesoftware.smackx.provider.JingleContentDescriptionProvider.Audio());
pm.addExtensionProvider("transport", "http://jabber.org/protocol/jingle/transport/ice",
new org.jivesoftware.smackx.provider.JingleTransportProvider.Ice());
pm.addExtensionProvider("transport", "http://jabber.org/protocol/jingle/transport/raw-udp",
new org.jivesoftware.smackx.provider.JingleTransportProvider.RawUdp());
pm.addExtensionProvider("busy", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Busy());
pm.addExtensionProvider("hold", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Hold());
pm.addExtensionProvider("mute", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Mute());
pm.addExtensionProvider("queued", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Queued());
pm.addExtensionProvider("ringing", "http://jabber.org/protocol/jingle/info/audio",
new org.jivesoftware.smackx.provider.JingleContentInfoProvider.Audio.Ringing());
The logs says:
D/SMACK (19570): 07:57:35 PM RCV (1079353408):
<iq type="error" id="u63Ey-6"
from="[email protected]/Smack"
to="[email protected]/Smack">
<jingle xmlns="urn:xmpp:jingle:1"
initiator="[email protected]/Smack"
responder="[email protected]/Smack"
action="transport-info" sid="4522287730196205154">
<content creator="initiator" name="JingleMediaManager">
<description xmlns="urn:xmpp:jingle:apps:rtp:1">
<payload-type id="0" name="PCMU" channels="1" clockrate="16000"/>
<payload-type id="3" name="gsm" channels="1" clockrate="0"/>
<payload-type id="4" name="g723" channels="1" clockrate="0"/>
</description>
<transport xmlns="http://www.xmpp.org/extensions/xep-0177.html#ns"/>
<transport xmlns="http://www.xmpp.org/extensions/xep-0177.html#ns">
<candidate generation="0" ip="192.168.123.102" port="10562"/>
</transport>
</content>
</jingle>
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error></iq>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 Smack Jingle 文件传输,“服务不可用”意味着另一方无法接受请求。
For Smack Jingle file transfers a "Service unavailable" means the other party is unavailable to accept the request.