use of org.whispersystems.signalservice.api.messages.calls.TurnServerInfo in project Signal-Android by WhisperSystems.
the class WebRtcCallService method retrieveTurnServers.
private ListenableFutureTask<List<PeerConnection.IceServer>> retrieveTurnServers() {
Callable<List<PeerConnection.IceServer>> callable = new Callable<List<PeerConnection.IceServer>>() {
@Override
public List<PeerConnection.IceServer> call() {
LinkedList<PeerConnection.IceServer> results = new LinkedList<>();
try {
TurnServerInfo turnServerInfo = accountManager.getTurnServerInfo();
for (String url : turnServerInfo.getUrls()) {
if (url.startsWith("turn")) {
results.add(new PeerConnection.IceServer(url, turnServerInfo.getUsername(), turnServerInfo.getPassword()));
} else {
results.add(new PeerConnection.IceServer(url));
}
}
} catch (IOException e) {
Log.w(TAG, e);
}
return results;
}
};
ListenableFutureTask<List<PeerConnection.IceServer>> futureTask = new ListenableFutureTask<>(callable, null, serviceExecutor);
networkExecutor.execute(futureTask);
return futureTask;
}
Aggregations