Print additional call message content

This commit is contained in:
AsamK 2021-02-07 18:47:21 +01:00
parent 23df85ff90
commit 0797217588

View file

@ -21,6 +21,7 @@ import org.whispersystems.signalservice.api.messages.calls.BusyMessage;
import org.whispersystems.signalservice.api.messages.calls.HangupMessage; import org.whispersystems.signalservice.api.messages.calls.HangupMessage;
import org.whispersystems.signalservice.api.messages.calls.IceUpdateMessage; import org.whispersystems.signalservice.api.messages.calls.IceUpdateMessage;
import org.whispersystems.signalservice.api.messages.calls.OfferMessage; import org.whispersystems.signalservice.api.messages.calls.OfferMessage;
import org.whispersystems.signalservice.api.messages.calls.OpaqueMessage;
import org.whispersystems.signalservice.api.messages.calls.SignalServiceCallMessage; import org.whispersystems.signalservice.api.messages.calls.SignalServiceCallMessage;
import org.whispersystems.signalservice.api.messages.multidevice.BlockedListMessage; import org.whispersystems.signalservice.api.messages.multidevice.BlockedListMessage;
import org.whispersystems.signalservice.api.messages.multidevice.ConfigurationMessage; import org.whispersystems.signalservice.api.messages.multidevice.ConfigurationMessage;
@ -282,6 +283,10 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
if (content.getCallMessage().isPresent()) { if (content.getCallMessage().isPresent()) {
System.out.println("Received a call message"); System.out.println("Received a call message");
SignalServiceCallMessage callMessage = content.getCallMessage().get(); SignalServiceCallMessage callMessage = content.getCallMessage().get();
if (callMessage.getDestinationDeviceId().isPresent()) {
final Integer deviceId = callMessage.getDestinationDeviceId().get();
System.out.println("Destination device id: " + deviceId);
}
if (callMessage.getAnswerMessage().isPresent()) { if (callMessage.getAnswerMessage().isPresent()) {
AnswerMessage answerMessage = callMessage.getAnswerMessage().get(); AnswerMessage answerMessage = callMessage.getAnswerMessage().get();
System.out.println("Answer message: " + answerMessage.getId() + ": " + answerMessage.getSdp()); System.out.println("Answer message: " + answerMessage.getId() + ": " + answerMessage.getSdp());
@ -307,6 +312,10 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
OfferMessage offerMessage = callMessage.getOfferMessage().get(); OfferMessage offerMessage = callMessage.getOfferMessage().get();
System.out.println("Offer message: " + offerMessage.getId() + ": " + offerMessage.getSdp()); System.out.println("Offer message: " + offerMessage.getId() + ": " + offerMessage.getSdp());
} }
if (callMessage.getOpaqueMessage().isPresent()) {
final OpaqueMessage opaqueMessage = callMessage.getOpaqueMessage().get();
System.out.println("Opaque message: size " + opaqueMessage.getOpaque().length);
}
} }
if (content.getReceiptMessage().isPresent()) { if (content.getReceiptMessage().isPresent()) {
System.out.println("Received a receipt message"); System.out.println("Received a receipt message");