Jingle-Android 文件传输

发布于 2024-12-09 18:01:39 字数 3828 浏览 0 评论 0原文

我正在尝试在我的应用程序中通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昔梦 2024-12-16 18:01:39

对于 Smack Jingle 文件传输,“服务不可用”意味着另一方无法接受请求。

For Smack Jingle file transfers a "Service unavailable" means the other party is unavailable to accept the request.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文