Hi,
i dont know how to connect two clients, when they are on seperate machine. Im using custom websocket for signaling:
IAWebRTC.connection.openSignalingChannel = function (config) {
var channel = config.channel || this.channel;
IAWebRTC.onMessageCallbacks[channel] = config.onmessage;
if (config.onopen) setTimeout(config.onopen, 10);
return {
send: function (data) {
var iaObject = new IAObject();
iaObject.Function = "IAWebRTC.ConnectStream";
iaObject.SetObject.channel = config.channel;
iaObject.SetObject.message = data;
iaObject.SetObject.sender = IAWebRTC.connection.userid;
if (notifyUser != undefined && notifyUser != null) iaObject.SetObject.callUser = notifyUser;
SendToServer(iaObject);
},
channel: channel
};
};
so the message is sended to server, than to second user on seperate machine. Second user is getting this message but got all the time "Unable to reach initiator. Trying again...".
I can see that another message is going from second user to initiator with message:
{
"messageFor": "cxj5wmqu5qxgvi",
"presenceState": "checking",
"_config": {
"userid": "cxj5wmqu5qxgvi",
"extra": {},
"sessionid": "http12700111011",
"session": {
"audio": true,
"video": true
}
},
"userid": "9m89zjlwims4i",
"extra": {}
}
But i really dont know how to create peer connection beetwen them. Here is also mine onmessage function:
ConnectStream: function (htmlObject) {
if (!IAWebRTC.isReady) IAWebRTC.CreateConnection(htmlObject.GetObject.SenderId);
if (htmlObject.GetObject.sender != IAWebRTC.connection.userid && IAWebRTC.onMessageCallbacks[htmlObject.GetObject.channel]) {
IAWebRTC.onMessageCallbacks[htmlObject.GetObject.channel](htmlObject.GetObject.message);
}
if (!IAWebRTC.isOpen) {
IAWebRTC.connection.join(JSON.parse(htmlObject.GetObject.message));
IAWebRTC.isOpen = true;
}
},