Jingle-Android Filetransfer

1.6k views Asked by At

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>
1

There are 1 answers

1
Ganesh Krishnan On

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