Closed dbkr closed 9 years ago
I should add, the TURN server in question is a coturn.
Also, logs with libnice debug turned on are at https://gist.github.com/dbkr/51134314ed483b9b9f74#file-gistfile1-txt
It's only affected by adding a turn url with transport=udp. Adding A turn URI with transport=tcp or turns transport=tcp does not trigger the bug (presumably because they're just not supported?)
@alessandrod do you know if this is a bug in libnice?
Not sure if it is a bug or just that only TURN TCP is supported. I have a feeling it is the latter but would need to check.
The latest version of our app with OpenWebRTC fixes is now live at http://matrix.org/beta/
I have specifically not included a workaround for this issue, so you can see this bug in action by placing a call there.
@alessandrod or @sdroege do you know?
libnice definitely supports TURN UDP. It supports most of rfc 5466 TURN except for the TLS part. But we don't actually support real TURN TCP (RFC 6062, creating TCP-like connections), but that part is not used by WebRTC.
I've been using libnice successfully with turnserver.org, the google TURN server and rfc5466-turn-server, of which coturn is a derivative. So in theory, coturn should "just work", but I haven't tested it. I've also seen reports of people having issues with libnice and coturn. So unless you feel like debugging libnice, I'd recommend another TURN server.
Yeah, it's certainly trying to talk TURN UDP to the coturn. I've just verified again and got the same though: if I specify the UDP TURN URI, OpenWebRTC never connects (even though they don't need TURN. If I remove it, it connects fine (ie. not using a TURN server). It also works if I change the password to be invalid so the fact that it connects to the coturn somehow breaks its ability to connect a call.
I expect @pererikb or @ocrete would know better but perhaps something is going amiss there and the gathering done signal is never fired. In which case, perhaps using trickle ICE could still work. Can we confirm that @pererikb?
@pererikb did this latest commit help with this specific issue?
https://github.com/EricssonResearch/openwebrtc/commit/605fbcdc734444a936dde73ddc19b300f59c7503
No. I am still investigating this issue.
The problem is that the socket replacement here http://cgit.freedesktop.org/libnice/libnice/tree/agent/agent.c#n3287 is not restricted to ICE-TCP and UDP-TURN-OVER-TCP sockets.
Hopefully this fixes it : http://cgit.freedesktop.org/libnice/libnice/commit/agent/agent.c?id=e4b8707d4ada89d09d9513775f165bd6c1481e1e
Let me know if it makes things better for you. Thanks.
@pererikb does this help? We're also including this change in the cerbero build then
If this fixes it, I'll make a new upstream release, we've accumulated a few bug fixes.
Yes, this fixes the issue
Just re-tested (sorry for the delay): I can confirm this does appear to fix the problem.
:+1:
Great. Thanks for the confirmation.
@kakaroto @ocrete let us know when there is a new release, thanks!
As an aside, since yesterday Cerbero includes a patch for using the latest code from git, so this isn't blocking us too much: https://github.com/nirbheek/cerbero/commit/478270572cdaa4c6dbdb9c7346c91db4266bf09a
Released libnice 0.1.9 which should include all of the patches
And 0.1.10 as well I see. :) we will update. Thanks @ocrete
Cerbero has been updated to 0.1.10: https://github.com/nirbheek/cerbero/commit/bcf4d9e74cb0b76eccaaf7f0311838188a17c864
Me and @superdump just confirmed that it is now possible to run OpenWebRTC (in Safari) -> Chrome using Matrix. Closing this issue, thanks for all the debug support.
If a working TURN server is supplied instead of just an stun server (or the empty array), OpenWebRTC fails to establish calls for me.
Test environment: Safari with OpenWebRTC extension calling Chrome (with Chrome native WebRTC). Both have a working TURN server configured in the iceservers parameter. Both browsers are on the same LAN and can communicate directly without the use of a STUN or TURN server.
Actual behaviour: Chrome fires events for the remote streams and its ICE state transitions to connecting. Safari never fires onaddstream. The two parties appear to be exchanging STUN and even get to DTLS negotiation on at least one channel.
Either replacing the TURN server with a STUN server or supplying the empty array as the iceservers parameter causes calls to connect successfully.