Kurento and TURN server (can't get example to work)

2,978 views
Skip to first unread message

ian...@gmail.com

unread,
Aug 20, 2015, 5:59:04 AM8/20/15
to kurento
Hello,

I installed Kurento 6.0 along with the Coturn server on a Ubuntu 14.04 VM behind a NAT. In this case actually my machine and the kurento machine are in the same network, only the Kurento machine is in a DMZ.
I opened the ports 3478, 8888, 49152-65xxx like the FAQ said. Coturn works if I add my turn server to my current webrtc application without kurento.
I configured the turn server for Kurento, with an username and password

stunServerAddress=1Xx.xx.xxx.xx
stunServerPort=3478

turnURL=kurento:pa...@1Xx.xx.xxx.xx:3478

I downloaded and got the java example applications server running for the one-to-one call, only changing the url used to connect to kurento-media-server.
When i try to start a call, the other user accepts the call and then both will see the loading icons for the other users video.

I see stuff like this in coturn:
3165: session 000000000000000043: realm <xxxx.xx> user <kurento>: incoming packet REFRESH processed, success

But the connection doesn't go through...
Do you have any idea on what could be causing this?
I don't really know if this is a problem with my coturn server configuration, if i should change something on the example, or if there's something else i should look into.

Thanks in advance!


ian...@gmail.com

unread,
Aug 20, 2015, 8:07:37 AM8/20/15
to kurento, ian...@gmail.com
I got it to work. 
I commented this line on kurento config

turnURL=kurento:pa...@1Xx.xx.xxx.xx:3478   -> ; turnURL=kurento:pa...@1Xx.xx.xxx.xx:3478

I added my turn server as a stun client side:
index.js Line 236

var options = {
localVideo : videoInput,
remoteVideo : videoOutput,
onicecandidate : onIceCandidate,
onerror : onError,
configuration : { iceServers : [
   {"url":"stun:1Xx.xxx.xx.xx:3478"},
   ] }
}

And it works. But as soon as i add the TURN configuration to kurento media server, it stops working... Do you know why this happens?
It's weird since, communication doesn't need TURN in this case...

Ivan Gracia

unread,
Aug 20, 2015, 11:33:40 AM8/20/15
to Kurento Public, ian...@gmail.com
Maybe you can check your TURN installation here. If it's fine, you should be able to see the TURN candidates there. Let us know if the configuration is ok! 

Ivan Gracia



--
You received this message because you are subscribed to the Google Groups "kurento" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kurento+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ian...@gmail.com

unread,
Aug 20, 2015, 1:04:35 PM8/20/15
to kurento, ian...@gmail.com
Thank you for the answer.
I just tested the TURN server and it works:
 

TimeComponentTypeFoundationProtocolAddressPortPriority
0.0021host694132342udp192.168.1.4361003126 | 32542 | 255
0.0021host2679891035udp169.254.9.5461004126 | 32286 | 255
0.0022host694132342udp192.168.1.4361005126 | 32542 | 254
0.0022host2679891035udp169.254.9.5461006126 | 32286 | 254
0.0451srflx3746555810udp128.79.215.9461003100 | 32542 | 255
0.0482srflx3746555810udp128.79.215.9461005100 | 32542 | 254
0.1021host1742496390tcp192.168.1.43090 | 32542 | 255
0.1021host3510114475tcp169.254.9.54090 | 32286 | 255
0.1042host1742496390tcp192.168.1.43090 | 32542 | 254
0.1042host3510114475tcp169.254.9.54090 | 32286 | 254
0.1472relay4140318680udp194.xxx.xxx.xxx623372 | 32542 | 254
0.1471relay4140318680udp194.xxx.xxx.xxx581132 | 32542 | 255
9.553Done
 
 With no TURN server it works though. Why would it need relay candidates? That's what I don't understand.

 Do you think this maybe a firewall problem?

I got a weird thing happening for the advanced example... Call is recorded server side but the users don't see anything. I don't understand. If no recording is made the call goes through, but it won't while recording...
 Hello world works...
 The example with the magic mirror works... with a 4s delay. The vm is not very fast ;D
One on one call works...
Advanced one on one ( video recording works, call doesn't)


I don't know if this helps in any way ^^

Ivan Gracia

unread,
Aug 20, 2015, 2:41:15 PM8/20/15
to Kurento Public, ian...@gmail.com
It doesn't work when you are recording? That's even weirder... Could you check the load in the server when doing that?

About the TURN, it could be a firewall problem, but hard to tell from here. We'll try and run some tests next week with TURN, and see if that's working. Double check the ports in the firewall, just in case. You can also use tcpdump to see if there is some traffic being blocked.

Every bit of info that you can give us helps. Thanks a lot!

Ivan Gracia



--

leonard...@gmail.com

unread,
Aug 20, 2015, 6:19:14 PM8/20/15
to kurento, ian...@gmail.com
Hi,

Something similar here, I want to run a demo on Amazon AWS but instead of install coturn I'm using numb as TURN server but Firefox tries all options of ICE candidates but none of them works.

Ivan Gracia

unread,
Aug 21, 2015, 3:15:38 AM8/21/15
to Kurento Public, ian...@gmail.com
Could you check without TURN? Most of the time it's not needed, and it just adds extra time to the candidate harvesting process.

Ivan Gracia


ian...@gmail.com

unread,
Aug 21, 2015, 6:11:03 AM8/21/15
to kurento, ian...@gmail.com
Ok so, I found the problem. This morning things that were working yesterday didn't work anymore so i went looking for the problem again...  It turns out I was setting my turn and stun server only in:

function call(){}

stuff was going to kurento but not back from kurento, but when i set it up on

function incomingCall(message){}

It started working both ways. I added the TURN configuration to Kurento and it still works so I think it was just my fault ^^.

So due to the network configuration over here, to get it working I needed to:

Add my coturn to stun and turn server in kurento configurations,
add my stun and coturn server in the index.js file for these both functions... (call and incomingCall)

var options = {
localVideo : videoInput,
remoteVideo : videoOutput,
onicecandidate : onIceCandidate,
onerror : onError,
configuration :  { iceServers :  [
    {"url":"stun:turn.server.com:3478"},
    {"url":"turn:turn.server.com:3478",
 "username":"username",
 "credential":"password"}
    ] }
};

I haven't tested when outside of our network yet, but if i find there are still things that can be cleared I'll add to this post. Thank you for the help igracia.

Ivan Gracia

unread,
Aug 21, 2015, 6:50:57 AM8/21/15
to Kurento Public, ian...@gmail.com
Thank you for the feedback! Glad to know you got that working. Please also post when you finish testing outside your local network.

If you don't really know for certain that you'll be needing TURN, you can perfectly go without that, as it will only add time to the harvesting process, and they won't be used.

Cheers,

Ivan Gracia


leonard...@gmail.com

unread,
Aug 21, 2015, 11:55:35 AM8/21/15
to kurento, ian...@gmail.com
I tried with STUN server only and same error, this is what about:webrtc shows http://imgur.com/1gR44dC

P Govind Raj

unread,
Aug 21, 2015, 12:31:22 PM8/21/15
to kur...@googlegroups.com


Sent from my ASUS

speed...@gmail.com

unread,
Aug 21, 2015, 10:42:58 PM8/21/15
to kurento, ian...@gmail.com
Hello , ian...

i'm a web developer by using kurento.
I also have same problem,that remote stream fails.
so I can find this forum.
Then I ask one more.
You says ,that turn server add in kurento.conf.json and index.js.
    var options = {
localVideo : videoInput,
remoteVideo : videoOutput,
onicecandidate : onIceCandidate,
onerror : onError,
configuration :  { iceServers :  [
    {"url":"stun:turn.server.com:3478"},
    {"url":"turn:turn.server.com:3478",
 "username":"username",
 "credential":"password"}
    ] }
};

Here I ask. What is the turn.server.com?
is this public-stun server address?  I tried 208.97.25.20:3478.
but no fixed.    of course I installed coturn server and setted already.

help me, please.
Thanks.



 

Ivan Gracia

unread,
Aug 22, 2015, 5:53:46 AM8/22/15
to Kurento Public, ian...@gmail.com
There's normally no need to install a local TURN server, unless you know for certain you'll be needing one. I really don't know where turn.server.com:3478 came from, but I think it doesn't exist as nslookup gives nothing back. The other IP don't know what it is, but it's not giving back any candidates.

You can test your STUN/TURN servers here 






Ivan Gracia



--

ian...@gmail.com

unread,
Aug 22, 2015, 7:34:27 AM8/22/15
to kurento, ian...@gmail.com, speed...@gmail.com
I put turn.server.com, but this it's just a placeholder. Put whatever you need there. And Im with Ivan, most of the time turn is not needed so you should try to make it work without first. And as he said it's hard to say what is wrong if we don't have any information about your configuration.

Sandeep Kumar

unread,
Jan 30, 2018, 4:30:33 AM1/30/18
to kurento
Hi All,
I am new to webRTC and using kurento samples can any one help me with setting custom STUN/TURN configuration on client side in index.js to bypass already available ice-server list ?
thanks 
sandeep
Reply all
Reply to author
Forward
0 new messages