diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar index 0ca138182..678238271 100644 Binary files a/lib/installer-exclude/libjitsi.jar and b/lib/installer-exclude/libjitsi.jar differ diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java index e0955cfb7..b2fe0ee2d 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallJabberImpl.java @@ -1126,12 +1126,10 @@ private boolean addDtlsAdvertisedEncryptions( if (dtlsControl != null) { - /* - * Jitsi Videobridge is a server-side endpoint and thus is supposed - * to have a public IP so it makes sense to start the DTLS-SRTP - * endpoint represented by this Call as a client. - */ - dtlsControl.setDtlsProtocol(DtlsControl.DTLS_CLIENT_PROTOCOL); + dtlsControl.setSetup( + peer.isInitiator() + ? DtlsControl.Setup.ACTIVE + : DtlsControl.Setup.PASSIVE); } IceUdpTransportPacketExtension remoteTransport = channel.getTransport(); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java index 314cd1ebb..29b04bfd8 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java @@ -2340,7 +2340,7 @@ boolean addDtlsAdvertisedEncryptions( } DtlsControl dtlsControl; - int dtlsProtocol; + DtlsControl.Setup setup; if (isInitiator) { @@ -2349,7 +2349,7 @@ boolean addDtlsAdvertisedEncryptions( srtpControls.get( mediaType, SrtpControlType.DTLS_SRTP); - dtlsProtocol = DtlsControl.DTLS_SERVER_PROTOCOL; + setup = DtlsControl.Setup.PASSIVE; } else { @@ -2358,12 +2358,12 @@ boolean addDtlsAdvertisedEncryptions( srtpControls.getOrCreate( mediaType, SrtpControlType.DTLS_SRTP); - dtlsProtocol = DtlsControl.DTLS_CLIENT_PROTOCOL; + setup = DtlsControl.Setup.ACTIVE; } if (dtlsControl != null) { - dtlsControl.setDtlsProtocol(dtlsProtocol); dtlsControl.setRemoteFingerprints(remoteFingerprints); + dtlsControl.setSetup(setup); removeAndCleanupOtherSrtpControls( mediaType, SrtpControlType.DTLS_SRTP); @@ -2531,12 +2531,12 @@ private boolean setDtlsEncryptionOnContent( if (dtlsControl != null) { - int dtlsProtocol + DtlsControl.Setup setup = (remoteContent == null) - ? DtlsControl.DTLS_SERVER_PROTOCOL - : DtlsControl.DTLS_CLIENT_PROTOCOL; + ? DtlsControl.Setup.PASSIVE + : DtlsControl.Setup.ACTIVE; - dtlsControl.setDtlsProtocol(dtlsProtocol); + dtlsControl.setSetup(setup); b = true; setDtlsEncryptionOnTransport( diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/RTPLevelRelayType.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/RTPLevelRelayType.java index 257a2a5e1..f804bf0e4 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/RTPLevelRelayType.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/colibri/RTPLevelRelayType.java @@ -30,12 +30,28 @@ public enum RTPLevelRelayType */ TRANSLATOR; + /** + * Parses a String into an RTPLevelRelayType enum value. + * The specified String to parse must be in a format as produced by + * {@link #toString()}; otherwise, the method will throw an exception. + * + * @param s the String to parse into an RTPLevelRelayType + * enum value + * @return an RTPLevelRelayType enum value on which + * toString() produces the specified s + * @throws IllegalArgumentException if none of the + * RTPLevelRelayType enum values produce the specified s + * when toString() is invoked on them + * @throws NullPointerException if s is null + */ public static RTPLevelRelayType parseRTPLevelRelayType(String s) { - for (RTPLevelRelayType value : RTPLevelRelayType.values()) + if (s == null) + throw new NullPointerException("s"); + for (RTPLevelRelayType v : values()) { - if (s.equals(value.toString())) - return value; + if (v.toString().equalsIgnoreCase(s)) + return v; } throw new IllegalArgumentException(s); } @@ -46,14 +62,6 @@ public static RTPLevelRelayType parseRTPLevelRelayType(String s) @Override public String toString() { - switch (this) - { - case MIXER: - return "mixer"; - case TRANSLATOR: - return "translator"; - default: - return super.toString(); - } + return name().toLowerCase(); } } diff --git a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java index 28dcb8eb3..9713ff77a 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java @@ -44,14 +44,8 @@ public class CallPeerMediaHandlerSipImpl */ private static final String DTLS_SRTP_FINGERPRINT_ATTR = "fingerprint"; - private static final String DTLS_SRTP_SETUP_ACTIVE = "active"; - - private static final String DTLS_SRTP_SETUP_ACTPASS = "actpass"; - private static final String DTLS_SRTP_SETUP_ATTR = "setup"; - private static final String DTLS_SRTP_SETUP_PASSIVE = "passive"; - /** * Our class logger. */ @@ -820,12 +814,14 @@ private boolean updateMediaDescriptionForDtls( Vector attrs = localMd.getAttributes(true); // setup - String setup + DtlsControl.Setup setup = (remoteMd == null) - ? DTLS_SRTP_SETUP_ACTPASS - : DTLS_SRTP_SETUP_ACTIVE; + ? DtlsControl.Setup.ACTPASS + : DtlsControl.Setup.ACTIVE; Attribute setupAttr - = SdpUtils.createAttribute(DTLS_SRTP_SETUP_ATTR, setup); + = SdpUtils.createAttribute( + DTLS_SRTP_SETUP_ATTR, + setup.toString()); attrs.add(setupAttr); @@ -840,12 +836,7 @@ private boolean updateMediaDescriptionForDtls( attrs.add(fingerprintAttr); - int dtlsProtocol - = DTLS_SRTP_SETUP_ACTIVE.equals(setup) - ? DtlsControl.DTLS_CLIENT_PROTOCOL - : DtlsControl.DTLS_SERVER_PROTOCOL; - - dtlsControl.setDtlsProtocol(dtlsProtocol); + dtlsControl.setSetup(setup); if (remoteMd != null) // answer updateSrtpControlsForDtls(mediaType, localMd, remoteMd); @@ -921,11 +912,8 @@ private void updateSrtpControlsForDtls( { setup = null; } - if (DTLS_SRTP_SETUP_PASSIVE.equals(setup)) - { - dtlsControl.setDtlsProtocol( - DtlsControl.DTLS_CLIENT_PROTOCOL); - } + if (DtlsControl.Setup.PASSIVE.toString().equals(setup)) + dtlsControl.setSetup(DtlsControl.Setup.ACTIVE); } // fingerprint