2

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="friendsUsername@beta.myCompany.co.uk/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="myUsername@beta.myCompany.co.uk/d04f6694" 
    from="friendsUsername@beta.myCompany.co.uk/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>
Andy A
  • 4,191
  • 7
  • 38
  • 56
  • 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 Apr 25 '12 at 15:02
  • I got the same issue..! after a specifica time interval getting fail error. did you solved the issue? – KETAN May 01 '12 at 05:19
  • Not yet. Let me know if you find an answer, there's a big shiny green tick waiting for you! – Andy A May 01 '12 at 08:14
  • and can you post the code to retrive the resource path of perticular JID? i tried jid.resource but it is null – KETAN May 01 '12 at 08:58
  • 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 May 01 '12 at 09:08
  • no in [jid full] there isnt any resource, but when I check the sqlite of core data, there is /resource attached – KETAN May 01 '12 at 09:09
  • I don't know. Maybe ask a new question here on Stack Overflow. – Andy A May 01 '12 at 09:50
  • Hello Andy A, How do you do:), Any success with turnsocket connection. – Splendid May 03 '12 at 11:22
  • Not yet. I've put the project on hold and started attempting file transfer on android instead (much easier than iOS!) – Andy A May 03 '12 at 11:30
  • can u send image from device to spark client and spark client to device ? if u can do then plz give me brief introduction – jeet parmar Oct 06 '16 at 12:52

1 Answers1

1

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

Andy A
  • 4,191
  • 7
  • 38
  • 56
  • I have installed open fire on my one of machine of local network. So, what should be the value of xmpp.proxy.externalip this property.can you please elaborate – Iducool Aug 28 '12 at 08:32
  • In my case I have put the ip address of the server, but having done a quick search on the internet, people are saying you should put the address which external clients can access the server like this - proxy.chat.somedomain.com – Andy A Aug 28 '12 at 08:52
  • But as i told i have installed it on one of machine of local network so how can I get publicly accessible IP of it – Iducool Aug 28 '12 at 09:10
  • I'm not sure I have no experience of this stuff. If you feel my Stack Overflow question doesn't solve your problem, you need to either search for a question that does or start a new question. – Andy A Aug 28 '12 at 09:29
  • 'xmpp.proxy.externalip which IP ?? when i have used 1 server openfire install in that server now want to connect 2 1 android and 1 ios user with xmpp in that and then send image but the message is service unavailbe type 503 occur – jeet parmar Oct 06 '16 at 12:31
  • i m developing chat app in android with xmpp and server open fire using smack library Spark to device image transfer is success but when transfer image from device to Spark service unavabile error occur is there is any configuration in openfire ???? if any one know then please help me – jeet parmar Oct 06 '16 at 12:40