OpenFire/XMPP 503 service-unavailable error (XEP-0065 using iOS XMPPFramework)

匿名 (未验证) 提交于 2019-12-03 01:48:02

问题:

Problem : I am attempting a TURN Connection (XEP-0065) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, I am receiving a 503 service-unavailable error.

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 Error :

I've debugged through TURNSocket.m. It goes into processRequestResponse and has the following XML. (If I am not mistaken, this has been sent from OpenFire to me, rather than vice versa?) ...

Why is there an error?

Update : XEP-0065 says the following. Even though this error looks a little different to mine, is it relevant? If so, what is the problem?

If the Proxy is unable to act as a StreamHost, the Proxy MUST return an error to the Requester, which SHOULD be .

Update : At the moment I'm looking into whether the inclusion or exclusion of a JID resource in the various sent and retrieved bits of XML is the problem. Or alternatively, I don't even have a 'from' in the following xml. the docs imply i need this. Is this the issue? I dont see a current way in the code to make a 'from' ...

Update 19/04/12 11:00 am : In response to Matt J's response, I am posting more XML. I'm not sure Matt requested the full XML log of what is sent and retrieved, but just in case, here it is. Note that these logs are not all from the same run-through (because when I debug it to get the XML logs, it causes timeouts so I have to start again)

Sent :

Response :

Sent :

Response :

Sent :

Response :

plus we also get a streamhost from the code from the query like this: NSXMLElement *streamhost = [query elementForName:@"streamhost"];

Sent :

This gives no response, but it looks ok to me when I compare to example 17 of XEP-0065. HOWEVER, if don't include a resource on the jID passed into TurnSocket.m (friendsUsername@beta.myCompany.co.uk rather than friendsUsername@beta.myCompany.co.uk/spark), then this send request changes appropriately

and the XML in my original question above is returned! (with the 503 error code). Furthermore, I notice that this xml contains 'streamhost', but at this stage should it actually contain 'streamhost-used'? Why is there an error? Should or shouldn't I include the resource in the 'to'?

Minor Update 19/04/2012 15:07 : I have added xmpp.proxy.transfer.required as false on OpenFire. This is due to these discussions: here and here. I didn't set up this server (my colleague did) and I don't understand what it means, but it doesn't seem to have made any difference to my problem.

Update 20/04/2012 10:00 : My 503 error I think is correctly there when I don't include the resource (according to this). Even if this is so though, I'm unsure why I get no response with a full jID.

回答1:

The 503 error was due to the fact that I was not providing the full JID. e.g I was providing friendsUsername@domain rather than friendsUsername@domain/resource.

However, I still haven't made a successful connection, and have opened a new question here



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!