Pass sender device id to ice handler

This commit is contained in:
AsamK 2026-04-01 21:56:12 +02:00
parent 7919a0f4aa
commit d1106299fe
2 changed files with 3 additions and 2 deletions

View File

@ -286,7 +286,7 @@ public class CallManager implements AutoCloseable {
logger.debug("Received answer for call {}", callIdUnsigned(callId)); logger.debug("Received answer for call {}", callIdUnsigned(callId));
} }
public void handleIncomingIceCandidate(final long callId, final byte[] opaque) { public void handleIncomingIceCandidate(final long callId, final byte[] opaque, final int deviceId) {
var state = activeCalls.get(callId); var state = activeCalls.get(callId);
if (state == null) { if (state == null) {
logger.debug("Received ICE candidate for unknown call {}", callIdUnsigned(callId)); logger.debug("Received ICE candidate for unknown call {}", callIdUnsigned(callId));
@ -296,6 +296,7 @@ public class CallManager implements AutoCloseable {
// Forward to subprocess as receivedIce // Forward to subprocess as receivedIce
var iceMsg = mapper.createObjectNode(); var iceMsg = mapper.createObjectNode();
iceMsg.put("type", "receivedIce"); iceMsg.put("type", "receivedIce");
iceMsg.put("senderDeviceId", deviceId);
var candidates = iceMsg.putArray("candidates"); var candidates = iceMsg.putArray("candidates");
candidates.add(java.util.Base64.getEncoder().encodeToString(opaque)); candidates.add(java.util.Base64.getEncoder().encodeToString(opaque));
sendControlMessage(state, writeJson(iceMsg)); sendControlMessage(state, writeJson(iceMsg));

View File

@ -433,7 +433,7 @@ public final class IncomingMessageHandler {
callMessage.getIceUpdateMessages().ifPresent(iceUpdates -> { callMessage.getIceUpdateMessages().ifPresent(iceUpdates -> {
for (var ice : iceUpdates) { for (var ice : iceUpdates) {
callManager.handleIncomingIceCandidate(ice.getId(), ice.getOpaque()); callManager.handleIncomingIceCandidate(ice.getId(), ice.getOpaque(), deviceId);
} }
}); });