robbiehanson/XMPPFramework — Issue #5: Unable to use GKVoiceChat with XMPPFramework
Author: jurico
Created: 2011-12-08 18:24:41+00:00
State: open

Hi,

I am trying to establish a GKVoiceChatService as described in
GKVoiceChatService.h header but at the last step, i am getting an
error saying peer-to-peer connection was not established:
------------------------------------------------------------------------------------------------------------------------------------------------
Implementation examples for an application that has uses a server to
establish connections between clients and wants to add peer-to-peer
voice chat. We'll use an XMPP chat client as an example.

XMPPClient xmppClientA;

vcService = [GKVoiceChatService defaultVoiceChatService];
vcService.client = xmppClientA;

*** During the init, the GKVoiceChatService will check to see if
@selector(sendRealTimeData:toParticipant:) method is implemented by
the client.
The Voice Chat Service will know to negotiate its own Peer To Peer
channel since our xmpp client does not implement this method.

*** Assume the xmppClient has a jabber id of clientA@jabber.foo.org
and wants to start a voice chat with clientB@jabber.foo.org ***

[xmppClientA.vcService startVoiceChatWithParticipantID:
@"clientB@jabber.foo.org"];

*** The Voice Chat Service will then try to send necessary connection
info to clientB@jabber.foo.org using the server channel that the XMPP
client implements.

[client voiceChatService:self sendData:(NSData *) data
toParticipantID: clientB@jabber.foo.org ];

*** xmppClientA will implement the sendConnectionData like this

[xmppClientA wrapAndSendData:(NSData *) data toJid:
clientB@jabber.foo.org]

*** On the remote side the xmppClient for clientB@jabber.foo.org
should

NSData *serviceData [xmppClientB unwrapData:(NSData *) data fromJid:
clientB@jabber.foo.org]
[xmppClientB.vcService receivedData: serviceData
fromParticipantID:participant];

*** Upon receiving this connection data. vcServiceForXMPPClientB
will do the following:
[client voiceChatService:self
receivedVoiceChatInvitationFromParticipant: clientA@jabber.foo.org
callID: 1]

*** Client B will then pop up a dialog. The user will choose to
accept. So B will notifiy the voice chat service.
[xmppClientB.vcService acceptConnection: (callid)];

*** The voice chat service on both sides will attempt to establish a
peer-to-peer connection. If they are successful then both voice chat
services will call
[client voiceChatService: self
didStartWithParticipantID:@"clientB(orA)@jabber.foo.org]

The sending and receiving of audio is then done transparently by the
GKVoiceChatService.

----------------------------------------------------------------------------------------------------------------------------------------

Here is detailed NSError object :
Error Domain=GKVoiceChatServiceErrorDomain Code=32002 "Network
conditions prevented connection." UserInfo=0x94a6a50
{NSErrorUserInfoDetailedError=204, NSFilePath=/SourceCache/
GameKitServices_Sim/GameKitServices-344.10/AVConference.subproj/
Sources/VCCallSession.m:2246, NSLocalizedFailureReason=No peer-to-peer
connection established., NSLocalizedDescription=Network conditions
prevented connection.}

I have tried both faceboook chat & google talk but both are giving
same problem.