Looking through the documentation, it seems that it should be possible using kurento-client to get the chosen pair of ICE candidates for a WebRtcEndpoint, along with each candidate's details, such as IP, port, etc. However, I have not been able to find any way to query for this type of information. The only method I've found for getting stats on an endpoint is getStats(), which returns some good statistics, but no obvious link to the ICE candidates. See below for an example output of WebRtcEndpoint.getStats() for a connected endpoint.
If I want to get to the portNumber of local selected ICE candidate, the object hierarchy as described in core.kmd.json is:
RTCOutboundRTPStreamStats (transportId) -> RTCTransportStats (selectedCandidatePairId) -> RTCIceCandidatePairStats (localCandidateId) -> RTCIceCandidateAttributes -> portNumber
In the example output below, you can see that the RTCOutboundRTPStreamStats is mostly populated (inbound is 0 because it's an outgoing connection). However, the transportId that could be used to find the RTCTransportStats is a blank string.
Looking through the kurento-client-core that is in my node_modules, it appears to have all of the necessary classes to support what I've described, I just can't seem to find a way to make it work.
Has anyone else been able to use getStats() in a similar way? Is this a feature that's not yet implemented, or am I missing something?
I'm using the javascript client, pulled in using this line in my package.json:
"dependencies": {
"kurento-client": "Kurento/kurento-client-js"
}
# kurento-media-server --version
Version: 6.0.0
Found modules:
Module: 'core' version '6.0.0'
Module: 'elements' version '6.0.0'
Module: 'filters' version '6.0.0'
Example result of WebRtcEndpoint.getStats('VIDEO'):
{
"62ef3e93-0b47-41e6-8f7b-e6d339551597": {
"__module__": "kurento",
"__type__": "RTCInboundRTPStreamStats",
"associateStatsId": "",
"bytesReceived": 0,
"codecId": "",
"firCount": 0,
"fractionLost": 0,
"id": "62ef3e93-0b47-41e6-8f7b-e6d339551597",
"isRemote": false,
"jitter": 0,
"mediaTrackId": "",
"nackCount": 0,
"packetsLost": 0,
"packetsReceived": 0,
"pliCount": 0,
"remb": 0,
"sliCount": 0,
"ssrc": "1",
"timestamp": 1440525380,
"transportId": "",
"type": "inboundrtp"
},
"a46de5f6-dcad-4c65-bb80-53dc49554033": {
"__module__": "kurento",
"__type__": "RTCOutboundRTPStreamStats",
"associateStatsId": "",
"bytesSent": 588177701,
"codecId": "",
"firCount": 0,
"fractionLost": 0,
"id": "a46de5f6-dcad-4c65-bb80-53dc49554033",
"isRemote": false,
"mediaTrackId": "",
"nackCount": 338,
"packetsLost": 455,
"packetsSent": 459072,
"pliCount": 0,
"remb": 3210192,
"roundTripTime": 0.0062103271484375,
"sliCount": 0,
"ssrc": "372923134",
"targetBitrate": 2011204,
"timestamp": 1440525380,
"transportId": "",
"type": "outboundrtp"
}
}