mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-26 02:06:42 +00:00
RingRTC v2.4.0 Release Integration.
Co-authored-by: Peter Thatcher <peter@signal.org>
This commit is contained in:
committed by
Greyson Parrelli
parent
550b121990
commit
a942293a74
@@ -683,24 +683,51 @@ public class SignalServiceMessageSender {
|
||||
|
||||
if (callMessage.getOfferMessage().isPresent()) {
|
||||
OfferMessage offer = callMessage.getOfferMessage().get();
|
||||
builder.setOffer(CallMessage.Offer.newBuilder()
|
||||
.setId(offer.getId())
|
||||
.setDescription(offer.getDescription())
|
||||
.setType(offer.getType().getProtoType()));
|
||||
CallMessage.Offer.Builder offerBuilder = CallMessage.Offer.newBuilder()
|
||||
.setId(offer.getId())
|
||||
.setType(offer.getType().getProtoType());
|
||||
|
||||
if (offer.getOpaque() != null) {
|
||||
offerBuilder.setOpaque(ByteString.copyFrom(offer.getOpaque()));
|
||||
}
|
||||
|
||||
if (offer.getSdp() != null) {
|
||||
offerBuilder.setSdp(offer.getSdp());
|
||||
}
|
||||
|
||||
builder.setOffer(offerBuilder);
|
||||
} else if (callMessage.getAnswerMessage().isPresent()) {
|
||||
AnswerMessage answer = callMessage.getAnswerMessage().get();
|
||||
builder.setAnswer(CallMessage.Answer.newBuilder()
|
||||
.setId(answer.getId())
|
||||
.setDescription(answer.getDescription()));
|
||||
CallMessage.Answer.Builder answerBuilder = CallMessage.Answer.newBuilder()
|
||||
.setId(answer.getId());
|
||||
|
||||
if (answer.getOpaque() != null) {
|
||||
answerBuilder.setOpaque(ByteString.copyFrom(answer.getOpaque()));
|
||||
}
|
||||
|
||||
if (answer.getSdp() != null) {
|
||||
answerBuilder.setSdp(answer.getSdp());
|
||||
}
|
||||
|
||||
builder.setAnswer(answerBuilder);
|
||||
} else if (callMessage.getIceUpdateMessages().isPresent()) {
|
||||
List<IceUpdateMessage> updates = callMessage.getIceUpdateMessages().get();
|
||||
|
||||
for (IceUpdateMessage update : updates) {
|
||||
builder.addIceUpdate(CallMessage.IceUpdate.newBuilder()
|
||||
.setId(update.getId())
|
||||
.setSdp(update.getSdp())
|
||||
.setSdpMid(update.getSdpMid())
|
||||
.setSdpMLineIndex(update.getSdpMLineIndex()));
|
||||
CallMessage.IceUpdate.Builder iceBuilder = CallMessage.IceUpdate.newBuilder()
|
||||
.setId(update.getId())
|
||||
.setMid("audio")
|
||||
.setLine(0);
|
||||
|
||||
if (update.getOpaque() != null) {
|
||||
iceBuilder.setOpaque(ByteString.copyFrom(update.getOpaque()));
|
||||
}
|
||||
|
||||
if (update.getSdp() != null) {
|
||||
iceBuilder.setSdp(update.getSdp());
|
||||
}
|
||||
|
||||
builder.addIceUpdate(iceBuilder);
|
||||
}
|
||||
} else if (callMessage.getHangupMessage().isPresent()) {
|
||||
CallMessage.Hangup.Type protoType = callMessage.getHangupMessage().get().getType().getProtoType();
|
||||
|
||||
@@ -591,15 +591,15 @@ public final class SignalServiceContent {
|
||||
|
||||
if (content.hasOffer()) {
|
||||
SignalServiceProtos.CallMessage.Offer offerContent = content.getOffer();
|
||||
return SignalServiceCallMessage.forOffer(new OfferMessage(offerContent.getId(), offerContent.getDescription(), OfferMessage.Type.fromProto(offerContent.getType())), isMultiRing, destinationDeviceId);
|
||||
return SignalServiceCallMessage.forOffer(new OfferMessage(offerContent.getId(), offerContent.hasSdp() ? offerContent.getSdp() : null, OfferMessage.Type.fromProto(offerContent.getType()), offerContent.hasOpaque() ? offerContent.getOpaque().toByteArray() : null), isMultiRing, destinationDeviceId);
|
||||
} else if (content.hasAnswer()) {
|
||||
SignalServiceProtos.CallMessage.Answer answerContent = content.getAnswer();
|
||||
return SignalServiceCallMessage.forAnswer(new AnswerMessage(answerContent.getId(), answerContent.getDescription()), isMultiRing, destinationDeviceId);
|
||||
return SignalServiceCallMessage.forAnswer(new AnswerMessage(answerContent.getId(), answerContent.hasSdp() ? answerContent.getSdp() : null, answerContent.hasOpaque() ? answerContent.getOpaque().toByteArray() : null), isMultiRing, destinationDeviceId);
|
||||
} else if (content.getIceUpdateCount() > 0) {
|
||||
List<IceUpdateMessage> iceUpdates = new LinkedList<>();
|
||||
|
||||
for (SignalServiceProtos.CallMessage.IceUpdate iceUpdate : content.getIceUpdateList()) {
|
||||
iceUpdates.add(new IceUpdateMessage(iceUpdate.getId(), iceUpdate.getSdpMid(), iceUpdate.getSdpMLineIndex(), iceUpdate.getSdp()));
|
||||
iceUpdates.add(new IceUpdateMessage(iceUpdate.getId(), iceUpdate.hasOpaque() ? iceUpdate.getOpaque().toByteArray() : null, iceUpdate.hasSdp() ? iceUpdate.getSdp() : null));
|
||||
}
|
||||
|
||||
return SignalServiceCallMessage.forIceUpdates(iceUpdates, isMultiRing, destinationDeviceId);
|
||||
|
||||
@@ -4,18 +4,24 @@ package org.whispersystems.signalservice.api.messages.calls;
|
||||
public class AnswerMessage {
|
||||
|
||||
private final long id;
|
||||
private final String description;
|
||||
private final String sdp;
|
||||
private final byte[] opaque;
|
||||
|
||||
public AnswerMessage(long id, String description) {
|
||||
this.id = id;
|
||||
this.description = description;
|
||||
public AnswerMessage(long id, String sdp, byte[] opaque) {
|
||||
this.id = id;
|
||||
this.sdp = sdp;
|
||||
this.opaque = opaque;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
public String getSdp() {
|
||||
return sdp;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public byte[] getOpaque() {
|
||||
return opaque;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,30 +4,24 @@ package org.whispersystems.signalservice.api.messages.calls;
|
||||
public class IceUpdateMessage {
|
||||
|
||||
private final long id;
|
||||
private final String sdpMid;
|
||||
private final int sdpMLineIndex;
|
||||
private final byte[] opaque;
|
||||
private final String sdp;
|
||||
|
||||
public IceUpdateMessage(long id, String sdpMid, int sdpMLineIndex, String sdp) {
|
||||
this.id = id;
|
||||
this.sdpMid = sdpMid;
|
||||
this.sdpMLineIndex = sdpMLineIndex;
|
||||
this.sdp = sdp;
|
||||
}
|
||||
|
||||
public String getSdpMid() {
|
||||
return sdpMid;
|
||||
}
|
||||
|
||||
public int getSdpMLineIndex() {
|
||||
return sdpMLineIndex;
|
||||
}
|
||||
|
||||
public String getSdp() {
|
||||
return sdp;
|
||||
public IceUpdateMessage(long id, byte[] opaque, String sdp) {
|
||||
this.id = id;
|
||||
this.opaque = opaque;
|
||||
this.sdp = sdp;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public byte[] getOpaque() {
|
||||
return opaque;
|
||||
}
|
||||
|
||||
public String getSdp() {
|
||||
return sdp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,17 +6,19 @@ import org.whispersystems.signalservice.internal.push.SignalServiceProtos;
|
||||
public class OfferMessage {
|
||||
|
||||
private final long id;
|
||||
private final String description;
|
||||
private final String sdp;
|
||||
private final Type type;
|
||||
private final byte[] opaque;
|
||||
|
||||
public OfferMessage(long id, String description, Type type) {
|
||||
this.id = id;
|
||||
this.description = description;
|
||||
this.type = type;
|
||||
public OfferMessage(long id, String sdp, Type type, byte[] opaque) {
|
||||
this.id = id;
|
||||
this.sdp = sdp;
|
||||
this.type = type;
|
||||
this.opaque = opaque;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
public String getSdp() {
|
||||
return sdp;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
@@ -27,6 +29,10 @@ public class OfferMessage {
|
||||
return type;
|
||||
}
|
||||
|
||||
public byte[] getOpaque() {
|
||||
return opaque;
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
AUDIO_CALL("audio_call", SignalServiceProtos.CallMessage.Offer.Type.OFFER_AUDIO_CALL),
|
||||
VIDEO_CALL("video_call", SignalServiceProtos.CallMessage.Offer.Type.OFFER_VIDEO_CALL);
|
||||
|
||||
@@ -49,21 +49,29 @@ message CallMessage {
|
||||
// 2 is reserved, removed OFFER_NEED_PERMISSION
|
||||
}
|
||||
|
||||
optional uint64 id = 1;
|
||||
optional string description = 2;
|
||||
optional Type type = 3;
|
||||
optional uint64 id = 1;
|
||||
// Legacy/deprecated; replaced by 'opaque'
|
||||
optional string sdp = 2;
|
||||
optional Type type = 3;
|
||||
optional bytes opaque = 4;
|
||||
}
|
||||
|
||||
message Answer {
|
||||
optional uint64 id = 1;
|
||||
optional string description = 2;
|
||||
optional uint64 id = 1;
|
||||
// Legacy/deprecated; replaced by 'opaque'
|
||||
optional string sdp = 2;
|
||||
optional bytes opaque = 3;
|
||||
}
|
||||
|
||||
message IceUpdate {
|
||||
optional uint64 id = 1;
|
||||
optional string sdpMid = 2;
|
||||
optional uint32 sdpMLineIndex = 3;
|
||||
optional string sdp = 4;
|
||||
optional uint64 id = 1;
|
||||
// Legacy/deprecated; remove when old clients are gone.
|
||||
optional string mid = 2;
|
||||
// Legacy/deprecated; remove when old clients are gone.
|
||||
optional uint32 line = 3;
|
||||
// Legacy/deprecated; replaced by 'opaque'
|
||||
optional string sdp = 4;
|
||||
optional bytes opaque = 5;
|
||||
}
|
||||
|
||||
message Busy {
|
||||
|
||||
Reference in New Issue
Block a user