Which ICE candidate was accepted? (or, are we being relayed?)

553 views
Skip to first unread message

Rob Agar

unread,
Jun 9, 2014, 11:36:02 AM6/9/14
to discuss...@googlegroups.com
Hi all

Is there a way for a client (javascript or native C++) to discover which ICE candidate was finally accepted to open a connection?

Or more directly, can a client tell if the connection is being relayed through a TURN server?

Philipp Hancke

unread,
Jun 9, 2014, 12:33:24 PM6/9/14
to discuss...@googlegroups.com
through the getStats API.
Look for a report of type googCandidatePair whose .stat('googActiveConnection') equals 'true' (string value, not boolean
Then look at .stat('googLocalCandidateType') and .stat('remoteCandidateType') which may be of equal to 'relay'.


--

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

Rob Agar

unread,
Jun 10, 2014, 3:35:37 AM6/10/14
to discuss...@googlegroups.com, philipp...@googlemail.com
Thanks, but is that though PeerConnection::GetStats()?  A google search seems to indicate that it's deprecated and due for removal (see here), but it's still in there AFAICS.

André Susano Pinto

unread,
Jun 10, 2014, 4:21:21 AM6/10/14
to discuss...@googlegroups.com, philipp...@googlemail.com
The API is there in Javascript:

If you read that CL, you will see that it simply removed the old method:
 virtual bool GetStats(StatsObserver* observer, webrtc::MediaStreamTrackInterface* track);
Since it was not used by chromium, but it left:
virtual bool GetStats(StatsObserver* observer, webrtc::MediaStreamTrackInterface* track, StatsOutputLevel level);
Which is used in chromium in:




On Tue, Jun 10, 2014 at 9:35 AM, Rob Agar <ea.ro...@gmail.com> wrote:
Thanks, but is that though PeerConnection::GetStats()?  A google search seems to indicate that it's deprecated and due for removal (see here), but it's still in there AFAICS.

--

Rob Agar

unread,
Jun 10, 2014, 4:41:02 AM6/10/14
to discuss...@googlegroups.com, philipp...@googlemail.com
Ah OK, I understand now. Cheers André.

Reply all
Reply to author
Forward
0 new messages