2
votes

Problem : I am attempting a TURNSocket (XEP-0065 - SOCKS5) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, in most scenarios, the receiver returns no response. I currently suspect the problem is to do with the OpenFire proxy server, which times out! This is set up on the local network, and I have edited the hosts file to point to it.

Note : The base of my code is from the following tutorial : http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/

XML and Error : The sender sends the following XML (after a few other XEP-0065 XML posts back and forth)...

<iq type="set" 
    to="[email protected]/spark" 
    id="DD96A581-BFA3-47BC-A3C0-D26AD48D7442">
    <query xmlns="http://jabber.org/protocol/bytestreams" 
        sid="DD96A581-BFA3-47BC-A3C0-D26AD48D7442" 
        mode="tcp">
        <streamhost xmlns="http://jabber.org/protocol/bytestreams"
            jid="proxy.beta.myCompany.co.uk" 
            host="127.0.1.1"
            port="7777"/>
    </query>
</iq>

If I chat to another instance of my app, I get the following error in the recipient when trying to use proxy.beta.myCompany.co.uk

Error Domain=GCDAsyncSocketErrorDomain Code=3 "Attempt to connect to host timed out"

So my main question is, why did it timeout?

Extra Info : If I have a chat between one instance of my app and an Adium IM Chat client, I get no response. However, if I chat to a Spark IM Chat Client, I get the following response ...

<iq xmlns="jabber:client" 
    id="9A34F268-9FC9-44F8-9662-4651A9E0B633" 
    to="[email protected]/d04f6694" 
    from="[email protected]/Spark 2.6.3" 
    type="error">
        <query xmlns="http://jabber.org/protocol/bytestreams"
            sid="9A34F268-9FC9-44F8-9662-4651A9E0B633"
            mode="tcp">
            <streamhost jid="proxy.beta.myCompany.co.uk" 
            host="127.0.1.1" 
            port="7777"/>
        </query>
    <error code="406" 
        type="MODIFY">
            <not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    </error>
</iq>
1
I have noticed that my sid and id are the same in the XML I send! However, it doesn't seem to fix the issue if I make a new sid. Is this relevant to the issue?Andy A
I got the same issue..! after a specifica time interval getting fail error. did you solved the issue?KETAN
Not yet. Let me know if you find an answer, there's a big shiny green tick waiting for you!Andy A
and can you post the code to retrive the resource path of perticular JID? i tried jid.resource but it is nullKETAN
If its null you probably have no resource. Try [jid full] to see the full jid. If there's no resouce on the end, there's no resource. Bare in mind that if you are using the code from the same tutorial I am using, it uses a hard coded jid with no resource. You may want to change the code so it uses the jid from the 'friend' you have clicked on when you started the chat.Andy A

1 Answers

1
votes

On OpenFire, I needed to set the ip of the proxy using a system property of 'xmpp.proxy.externalip'.