Hi,
I'm having a problem in our production system, and I'm trying to isolate & debug some things in a lab setup. It seems like many of our calls are using TURN to relay. Sometimes, when there are two calls in a row between two peers, one call uses relay & the next will not, even though the network environment is the same. I'm digging into why we're using relay more often than we used to.
I'm making calls between an android application, and a browser. Both devices are on the same network.
In the android app, I modified my code to drop all local ice candidates, so I won't just go peer-to-peer on the LAN. Only reflexive (stun) and relay (turn) are used. The app won't send local candidates to the browser, and it will drop local candidates from the browser without adding them to the peer connection. (the android app won't allow anything other than relay or reflexive.)
When I do this, I can make a call. One side of the call is always using relay/turn, and one side is always using reflexive/stun. So, if my network can work with reflexive candidates, why can't both legs of the call be reflexive?
I added some more debugging, and caused the app to drop all relay candidates as well. It only passes reflexive candidates. When I do this, I can't make a call. At the top of chrome://webrtc-internals/, I can see:
..
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (srflx)
icecandidate (srflx)
icecandidate (srflx)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (host)
icecandidate (relay)
icecandidate (relay)
icecandidate (relay)
...
addIceCandidate (srflx)
...
but down in the "Stats Tables" section of the webrtc internals, I can see 3 candidate sections like this:
Cand-qNNkk9NR (localcandidate)
Cand-wT61B++e (localcandidate)
Cand-2vKQb3Ms (remotecandidate)
the first is "candidateType host", and the second is "candidateType relayed" and the third is the app & it is "candidateType serverreflexive"/
So, I think that the browser has 3 stun candidates, and it got 1 stun candidate from the android app. Shouldn't I be able to make a call like this? It'll just have to use Stun? in the call before I made these changes (to drop all but reflexive), one leg used stun, so my router/nat must be "stun capable", if that makes sense.
Should there be a "candidateType serverreflexive" for the browser in the stats tables? I have got the candidates above. Are they not in use?
I expected to see that, since that's the one that I send from the android app. I just don't know why I don't have a serverreflexive candidate for the browser. I grabbed a chrome debug log ... I don't see anything that I understand in there. Can anyone tell me where to look next? Or am I off the mark here, and there's something that I don't understand about the stun & turn that's causing my issues?
Thanks,
Doug