react-native-pjsip
react-native-pjsip copied to clipboard
How can i test connection quality to SIP server?
You can use RTCP statistics, but there are no bindings from RN wrapper yet. Going to add it in the feature.
@datso I'm really looking forward to you adding this feature. I will follow the changes.
@datso can you please explain to me more about this feature? I can work on it, I just want some more details on it.
@rcorrie So currently it is not possible to access RTCP statistics of the call. It would be great if Endpoint will have readCallRtcpStats method that will return all RTCP statistics for each stream of the call.
Here is the example of Android impl
Call.java
public JSONArray rtcpInfoToJson() {
JSONArray result = new JSONArray();
try {
CallInfo callInfo = getInfo();
CallMediaInfoVector media = callInfo.getMedia();
try {
long size = media.size();
JSONObject json = new JSONObject();
for (int i=0; i < size; i++) {
CallMediaInfo info = media.get(i);
StreamStat streamStat = getStreamStat(info.getIndex());
RtcpStreamStat rxStat = streamStat.getRtcp().getRxStat();
JSONObject rxStatJson = new JSONObject();
rxStatJson.put("update", rxStat.getUpdate().getSec());
rxStatJson.put("updateCount", rxStat.getUpdateCount());
rxStatJson.put("pkt", rxStat.getPkt());
rxStatJson.put("bytes", rxStat.getBytes());
rxStatJson.put("discard", rxStat.getDiscard());
rxStatJson.put("loss", rxStat.getLoss());
rxStatJson.put("lossPeriod", rxStat.getLossPeriodUsec().getMin());
JSONObject rxLossType = new JSONObject();
rxLossType.put("burst", rxStat.getLossType().getBurst());
rxLossType.put("random", rxStat.getLossType().getRandom());
rxStatJson.put("lossType", rxLossType);
rxStatJson.put("reorder", rxStat.getReorder());
rxStatJson.put("dup", rxStat.getDup());
json.put("tx", rxStatJson);
json.put("rx", "TODO, same as for TX");
json.put("jitter", "TODO, pass all info from streamStat.getJbuf()");
result.put(json);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
return result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
how about this feature? can I receive some call quality information currently?