I m going to build webrtc android client with my kamilio/freeswitch.
I m using resiprocate for p2p connection between clients.
How can I set freeswitch and TURN server when using resiprocate ?
The turn server is independent of the sip server. You don't have to setup anything about TURN on freeswitch. You just have to set your turn server address for your webrtc client.
Related
I was curious on why a client cannot directly to a machine running webrtc server but can do that via turn server. Both turn & webrtc are in same VPC of AWS.
Could be a lot of things.
Assuming you have the TURN configuration file correct, and as you are noting both AWS instances have public IPs, then it's possible that on the instance with the TURN server, you do not have all the firewall ports opened needed related to the TURN server: https://stackoverflow.com/a/59212004/8201657
Or, maybe it's a DNS issue and the domain of your TURN server is unknown to your peer, so it is not able to access it.
Or, maybe you are attempting to connect via WebRTC but not securely. WebRTC requires a secure connnection (https).
I am working on a WebRtc application to broadcast video to my clients. I use Kurento as the WebRtc media server and use Spring Boot to build my signaling server. There is only media data that flows from my media server to clients but no media data in the opposite direction. So the media server's public address is not needed while clients's public addresses are required. That is I need to find ICE candidates that contains public address for my clients.
I know clients can setup up an extra stun server to achieve this. But since the clients are already talking to my signaling server, is it possible that I just use my signaling server to find ICE candidates for the clients?
A stun server lets the client figure out a UDP port where other clients can connect. This is different from the TCP connection the client uses to connect to your signaling server.
If you client is only talking to your media server, that is not needed. However, you may need a TURN server to allow connections from networks that block UDP (unless your media server supports ICE-TCP)
Is it possible to have Asterisk as the signaling server for WebRTC enabled mobile app. I have found that I need to create the signaling server in node.js. I was wondering whether Asterisk can do the job for me.
Also, does the WebRTC media pass through the signaling server (or) is it direct device to device media transfer.
Any help is appreciated. Thank you. :)
If you want WebRTC signal switching alone then you can use some websocket server like socket.io but it won't handle STUN or TURN.
If you want WebRTC signalling along with STUN,TURN and media recording then you can go with Kurento, Freeswitch, asterisk etc.
If you carry media over signalling server then you might consume more CPU and memory processing on server side. Try to keep peer-peer direct media to get better audio and video.
But in all these case you need to register your endpoints to the signalling server. So if you call B from A. the signalling server knows where B is!
Is it possible to have Asterisk as the signalling server for WebRTC enabled mobile app?
Of course. Just use SIP over websocket (RFC 7118). See this Asterisk WebRTC setup guide for the details. If you already have an Asterisk server, then there is no need to implement a separate signaling server in node.js.
Also, does the WebRTC media pass through the signaling server (or) is it direct device to device media transfer.
This is handled automatically by ICE. Ideally your goal should be to have as many peer to peer media as possible to minimize the server load. However in some situations a relay is required which can be the Asterisk server itself or a separate TURN server. Also make sure to set the STUN correctly (that is required for STUN to find the direct path)
I have developed a p2p video chat using Webrtc. I am aware that STUN or TURN server is required to identify the public IP behind NAT. Currently am using Google's STUN server.
I have the application installed in the server connected to the LAN which will not have internet access, do I need to install the STUN server in my server to make Webrtc video chat work within the LAN?
Peers should be able to connect within a LAN (on the same side of a NAT) without STUN, i.e. using the host candidates. Try it out!
In general, you won't need a STUN server. However, depending on the firewall configuration, you may actually need STUN (and even TURN). For example, at the SFHTML5 WebRTC Hackathon, we were on a corporate guest WiFi network that blocked local UDP and TCP traffic. Making successful calls required a TURN server in this case.
I read that WebRTC uses relay servers, if the direct peer connection doesn't work because of firewalls.
Is there a way to check, if this is the case?
When you establishing WebRTC connection, you set STUN and/or TURN for a web browser to use. If you informed a web browser with the both options, web browser will start trying to use STUN first. Then, in case of unsuccess it will try to use TURN.
The 'relay server' is a TURN-server.
As I know, there is no standard way to know out which option a web browser decided to use: STUN or TURN.
In other hand, if you're the owner of TURN server, you can see whether web client does use it or not, and then send this information to the client.
UPDATED
This is my code: https://github.com/fycth/webrtcexample/blob/master/www/js/rtc_lib.js
You can see there I use just STUN server, so it is p2p or nothing, and no relay.
In chrome. go to chrome://webrtc-internals, go to succeeded connection-googCandidate pair(in black letters) check if googLocalcandidatetype is relay, then webrtc uses relay connection . If googLocalcandidatetype is local, then it uses peer to peer connection
In firefox, go to about:webrtc, if the succeeded connection contains any candidate as relayed-udp, then webrtc uses relay connection