SHA256
Звонки: расширенная диагностика + экран настроек разработчика + обновление TURN-конфига
This commit is contained in:
+18
-1
@@ -36,11 +36,16 @@ public class Net_CallDeliveryReport_Handler implements JsonMessageHandler {
|
||||
long serverTs = System.currentTimeMillis();
|
||||
String line = String.format(
|
||||
Locale.ROOT,
|
||||
"%s | type=%s | login=%s | remote=%s | value=%s%n",
|
||||
"%s | type=%s | op=%s | requestId=%s | login=%s | sessionId=%s | authenticated=%s | remote=%s | userAgent=%s | value=%s%n",
|
||||
Instant.ofEpochMilli(serverTs),
|
||||
clip(req.getType(), 80),
|
||||
clip(req.getOp(), 80),
|
||||
clip(req.getRequestId(), 120),
|
||||
clip(ctx != null ? ctx.getLogin() : "", 80),
|
||||
clip(ctx != null ? ctx.getSessionId() : "", 160),
|
||||
ctx != null && ctx.isAuthenticatedUser(),
|
||||
clip(remoteAddress(ctx), 200),
|
||||
clip(userAgent(ctx), 300),
|
||||
clip(req.getValue(), 8000)
|
||||
);
|
||||
|
||||
@@ -88,6 +93,18 @@ public class Net_CallDeliveryReport_Handler implements JsonMessageHandler {
|
||||
return value == null ? "" : value.trim();
|
||||
}
|
||||
|
||||
private static String userAgent(ConnectionContext ctx) {
|
||||
if (ctx == null) return "";
|
||||
Session ws = ctx.getWsSession();
|
||||
if (ws == null) return "";
|
||||
try {
|
||||
String value = ws.getUpgradeRequest() != null ? ws.getUpgradeRequest().getHeader("User-Agent") : "";
|
||||
return safe(value);
|
||||
} catch (Exception ignored) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static String clip(String value, int maxLen) {
|
||||
String cleaned = safe(value).replace('\n', ' ').replace('\r', ' ');
|
||||
if (cleaned.length() <= maxLen) return cleaned;
|
||||
|
||||
Reference in New Issue
Block a user