0

I am developing one video calling application. Currently using Xirsys's stun and turn server. I am using the result of https://service.xirsys.com/ice as my configurations. Is it the right username and credential to use in the Javascript page or anything else. If it is wrong then please guide me where will I get the correct iceServers values. iceServers = [ { "url": "stun:turn01.uswest.xirsys.com" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turn:turn01.uswest.xirsys.com:80?transport=udp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turn:turn01.uswest.xirsys.com:3478?transport=udp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turn:turn01.uswest.xirsys.com:80?transport=tcp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turn:turn01.uswest.xirsys.com:3478?transport=tcp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turns:turn01.uswest.xirsys.com:443?transport=tcp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" }, { "username": "0xxxxxx8-fxxc-1xx6-bxxb-bxxxxxxxxxx8", "url": "turns:turn01.uswest.xirsys.com:5349?transport=tcp", "credential": "0xxxxxxe-fxxc-1xx6-axx0-axxxxxxxxxx9" } ];
Note: Its working in the same network but not in different network. Even in different network I can get the incomming call but after receiving the call iceConnectionState gets failed.
I have also raised similar question here where I was using numb as stun and turn server.

Thanks in advance.

Community
  • 1
  • 1
Amrendra
  • 511
  • 8
  • 18

1 Answers1

2

The ICE string should be used 'as-is' in the ice configuration for your WebRTC application. Note, however, that the ICE credentials are only valid for 30 seconds. You need to request a fresh ICE string immediately before each connection.

Local network connections will work WITHOUT a valid ICE string, because your NAT translation will NOT use TURN / STUN. This is because your NAT translates your local IP's itself. Therefore, local network connections will always work (unless you have a non-common NAT situation). If you were using the ICE credentials without refreshing them before each call, that will certainly be why your external connections were failing (or certainly will contribute to the problem).

Lee

Lee Sylvester
  • 183
  • 1
  • 7
  • Thanks Lee! for this crystal clear explanation of my problem. I have one more doubt. I can request a fresh ice string before calling. But, do I need the same at the receiver end? Or is there any other way by which I can configure at the server end (Peer-server). Please elaborate. Thanks again. – Amrendra Mar 02 '17 at 10:10
  • I modified my code as you suggested. Now it gets ice string just before starting the call in caller side. And in receiver side no config property is set. But, Still the problem exists. I am providing ice string as: _config:{data.d}_ . – Amrendra Mar 02 '17 at 13:27
  • The ICE string is only required (as it is shared via signalling) by the client (the caller). You just need to pass the value of data.d, which it looks like you're doing. Can you supply a dump of chrome://webrtc-internals? This will show you what TURN / STUN servers are in use and will help us work out if you're simply not getting the ICE string into your app properly, or if the issue is elsewhere. – Lee Sylvester Mar 03 '17 at 10:22
  • Thanks Lee! Now it's working like charm. I just configured it in the caller side and left ice configuration in receiver end. Thanks again. – Amrendra Mar 07 '17 at 06:48
  • @LeeSylvester can you add any example code to send `ICE candidate` i m also having same issue – Kamlesh Paul Jan 14 '22 at 06:13