diff --git a/lib/installer-exclude/libjitsi.jar b/lib/installer-exclude/libjitsi.jar index 3b3eeb10b..92f9e0bdc 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/service/protocol/media/MediaAwareCallPeer.java b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallPeer.java index d9e1733b9..59c885c04 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallPeer.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaAwareCallPeer.java @@ -15,6 +15,7 @@ import org.jitsi.service.neomedia.*; import org.jitsi.service.neomedia.event.*; +import org.jitsi.service.protocol.event.*; /** * A utility class implementing media control code shared between current @@ -852,7 +853,9 @@ public void removeVideoPropertyChangeListener( * @param severity severity level */ public void securityMessageReceived( - String messageType, String i18nMessage, int severity) + String messageType, + String i18nMessage, + int severity) { fireCallPeerSecurityMessageEvent(messageType, i18nMessage, @@ -863,60 +866,72 @@ public void securityMessageReceived( * Indicates that the other party has timeouted replying to our * offer to secure the connection. * - * @param sessionType the type of the call session - audio or video. + * @param mediaType the MediaType of the call session * @param sender the security controller that caused the event */ - public void securityNegotiationStarted(int sessionType, SrtpControl sender) + public void securityNegotiationStarted( + MediaType mediaType, + SrtpControl sender) { - CallPeerSecurityNegotiationStartedEvent evt = - new CallPeerSecurityNegotiationStartedEvent(this, sessionType, sender); - fireCallPeerSecurityNegotiationStartedEvent(evt); + fireCallPeerSecurityNegotiationStartedEvent( + new CallPeerSecurityNegotiationStartedEvent( + this, + toSessionType(mediaType), + sender)); } /** * Indicates that the other party has timeouted replying to our * offer to secure the connection. * - * @param sessionType the type of the call session - audio or video. + * @param mediaType the MediaType of the call session */ - public void securityTimeout(int sessionType) + public void securityTimeout(MediaType mediaType) { - CallPeerSecurityTimeoutEvent evt = - new CallPeerSecurityTimeoutEvent(this, sessionType); - fireCallPeerSecurityTimeoutEvent(evt); + fireCallPeerSecurityTimeoutEvent( + new CallPeerSecurityTimeoutEvent( + this, + toSessionType(mediaType))); } /** * Sets the security status to OFF for this call peer. * - * @param sessionType the type of the call session - audio or video. + * @param mediaType the MediaType of the call session */ - public void securityTurnedOff(int sessionType) + public void securityTurnedOff(MediaType mediaType) { // If this event has been triggered because of a call end event and the // call is already ended we don't need to alert the user for // security off. if((call != null) && !call.getCallState().equals(CallState.CALL_ENDED)) { - CallPeerSecurityOffEvent event - = new CallPeerSecurityOffEvent( this, sessionType); - fireCallPeerSecurityOffEvent(event); + fireCallPeerSecurityOffEvent( + new CallPeerSecurityOffEvent( + this, + toSessionType(mediaType))); } } /** * Sets the security status to ON for this call peer. * - * @param sessionType the type of the call session - audio or video. + * @param mediaType the MediaType of the call session * @param cipher the cipher * @param sender the security controller that caused the event */ - public void securityTurnedOn(int sessionType, String cipher, - SrtpControl sender) + public void securityTurnedOn( + MediaType mediaType, + String cipher, + SrtpControl sender) { getMediaHandler().startSrtpMultistream(sender); fireCallPeerSecurityOnEvent( - new CallPeerSecurityOnEvent(this, sessionType, cipher, sender)); + new CallPeerSecurityOnEvent( + this, + toSessionType(mediaType), + cipher, + sender)); } /** @@ -1211,4 +1226,26 @@ public void removeConferenceMember(ConferenceMember conferenceMember) super.removeConferenceMember(conferenceMember); } + + /** + * Converts a specific MediaType into a sessionType value + * in the terms of the CallPeerSecurityStatusEvent class. + * + * @param mediaType the MediaType to be converted + * @return the sessionType value in the terms of the + * CallPeerSecurityStatusEvent class that is equivalent to the + * specified mediaType + */ + private static int toSessionType(MediaType mediaType) + { + switch (mediaType) + { + case AUDIO: + return CallPeerSecurityStatusEvent.AUDIO_SESSION; + case VIDEO: + return CallPeerSecurityStatusEvent.VIDEO_SESSION; + default: + throw new IllegalArgumentException("mediaType"); + } + } } diff --git a/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java b/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java index 4b5db9e3b..e4de1dfb6 100644 --- a/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java +++ b/src/net/java/sip/communicator/service/protocol/media/MediaHandler.java @@ -154,30 +154,30 @@ public void securityMessageReceived( } } - public void securityTimeout(int sessionType) + public void securityNegotiationStarted( + MediaType mediaType, SrtpControl sender) { for (SrtpListener listener : getSrtpListeners()) - listener.securityTimeout(sessionType); + listener.securityNegotiationStarted(mediaType, sender); } - public void securityTurnedOff(int sessionType) + public void securityTimeout(MediaType mediaType) { for (SrtpListener listener : getSrtpListeners()) - listener.securityTurnedOff(sessionType); + listener.securityTimeout(mediaType); } - public void securityTurnedOn( - int sessionType, String cipher, SrtpControl sender) + public void securityTurnedOff(MediaType mediaType) { for (SrtpListener listener : getSrtpListeners()) - listener.securityTurnedOn(sessionType, cipher, sender); + listener.securityTurnedOff(mediaType); } - public void securityNegotiationStarted(int sessionType, - SrtpControl sender) + public void securityTurnedOn( + MediaType mediaType, String cipher, SrtpControl sender) { for (SrtpListener listener : getSrtpListeners()) - listener.securityNegotiationStarted(sessionType, sender); + listener.securityTurnedOn(mediaType, cipher, sender); } };