solomax commented on a change in pull request #92:
URL: https://github.com/apache/openmeetings/pull/92#discussion_r427916671
##########
File path:
openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KurentoHandler.java
##########
@@ -337,7 +337,10 @@ JSONArray getTurnServers(final boolean test) {
mac.init(new
SecretKeySpec(turnSecret.getBytes(), HMAC_SHA1_ALGORITHM));
StringBuilder user = new StringBuilder()
.append((test ? 60 :
turnTtl * 60) + System.currentTimeMillis() / 1000L);
- if (!Strings.isEmpty(turnUser)) {
+ final String uid = c.getUid();
Review comment:
sorry for double-review wasn't concentrated enough :(((
later on you are calling this method with `c == null`
I would change this line to be
`final String uid = c == null ? null : c.getUid();`
##########
File path:
openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KurentoHandler.java
##########
@@ -346,9 +349,18 @@ JSONArray getTurnServers(final boolean test) {
turn.put("username", turnUser)
.put("credential", turnSecret);
}
- final String fturnUrl = "turn:" + turnUrl;
- turn.put("url", fturnUrl); // old-school
- turn.put("urls", fturnUrl);
+
+ JSONArray urls = new JSONArray();
+ final String[] turnUrls = turnUrl.split(",");
+ for (String url : turnUrls) {
+ if (!url.startsWith("stun:") &&
!url.startsWith("stuns:") && !url.startsWith("turn:") &&
!url.startsWith("turns:")) {
Review comment:
could you also change this fragment to be:
```
if (url.startsWith("stun:") || url.startsWith("stuns:") ||
url.startsWith("turn:") || url.startsWith("turns:")) {
urls.put(url);
} else {
urls.put("turn:" + url);
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]