src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java
/**
     * Detects and adds SDES available encryption method present in the
     * description given in parameter.
     *
     * @param isInitiator True if the local call instance is the initiator of
     * the call. False otherwise.
     * @param description The DESCRIPTION element of the JINGLE element which
     * contains the PAYLOAD-TYPE and (more important here) the ENCRYPTION.
     * @param mediaType The type of media (AUDIO or VIDEO).
     */
Detects and adds SDES available encryption method present in the
description given in parameter.

@param isInitiator True if the local call instance is the initiator of
the call. False otherwise.
@param description The DESCRIPTION element of the JINGLE element which
contains the PAYLOAD-TYPE and (more important here) the ENCRYPTION.
@param mediaType The type of media (AUDIO or VIDEO).
Detects and adds SDES available encryption method present in the description given in parameter . @param isInitiator True if the local call instance is the initiator of the call . False otherwise . @param description The DESCRIPTION element of the JINGLE element which contains the PAYLOAD - TYPE and ( more important here ) the ENCRYPTION . @param mediaType The type of media ( AUDIO or VIDEO ) .
private void addSDesAdvertisedEncryptions(
        boolean isInitiator,
        RtpDescriptionPacketExtension description,
        MediaType mediaType)
    {
        CallPeer peer = getPeer();
        if (peer.getCall().getConference().isJitsiVideobridge())
            return;
        EncryptionPacketExtension encryptionPacketExtension
            = description.getFirstChildOfType(
                    EncryptionPacketExtension.class);
        if(encryptionPacketExtension != null)
        {
            AccountID accountID = peer.getProtocolProvider().getAccountID();
            if(accountID.getAccountPropertyBoolean(
                        ProtocolProviderFactory.DEFAULT_ENCRYPTION,
                        true)
                    && accountID.isEncryptionProtocolEnabled(
                            SrtpControlType.SDES))
            {
                SrtpControls srtpControls = getSrtpControls();
                SDesControl sdesControl
                    = (SDesControl)
                        srtpControls.getOrCreate(
                                mediaType,
                                SrtpControlType.SDES);
                SrtpCryptoAttribute selectedSdes
                    = selectSdesCryptoSuite(
                            isInitiator,
                            sdesControl,
                            encryptionPacketExtension);
                if(selectedSdes != null)
                {
                    removeAndCleanupOtherSrtpControls(
                            mediaType,
                            SrtpControlType.SDES);
                    addAdvertisedEncryptionMethod(SrtpControlType.SDES);
                }
                else
                {
                    sdesControl.cleanup(null);
                    srtpControls.remove(mediaType, SrtpControlType.SDES);
                }
            }
        }
        else if(isInitiator)
        {
            SrtpControl sdesControl
                = getSrtpControls().remove(mediaType, SrtpControlType.SDES);
            if (sdesControl != null)
                sdesControl.cleanup(null);
        }
    }
private void addSDesAdvertisedEncryptions ( boolean isInitiator , RtpDescriptionPacketExtension description , MediaType mediaType ) { CallPeer peer = getPeer ( ) ; if ( peer . getCall ( ) . getConference ( ) . isJitsiVideobridge ( ) ) return ; EncryptionPacketExtension encryptionPacketExtension = description . getFirstChildOfType ( EncryptionPacketExtension . class ) ; if ( encryptionPacketExtension != null ) { AccountID accountID = peer . getProtocolProvider ( ) . getAccountID ( ) ; if ( accountID . getAccountPropertyBoolean ( ProtocolProviderFactory . DEFAULT_ENCRYPTION , true ) && accountID . isEncryptionProtocolEnabled ( SrtpControlType . SDES ) ) { SrtpControls srtpControls = getSrtpControls ( ) ; SDesControl sdesControl = ( SDesControl ) srtpControls . getOrCreate ( mediaType , SrtpControlType . SDES ) ; SrtpCryptoAttribute selectedSdes = selectSdesCryptoSuite ( isInitiator , sdesControl , encryptionPacketExtension ) ; if ( selectedSdes != null ) { removeAndCleanupOtherSrtpControls ( mediaType , SrtpControlType . SDES ) ; addAdvertisedEncryptionMethod ( SrtpControlType . SDES ) ; } else { sdesControl . cleanup ( null ) ; srtpControls . remove ( mediaType , SrtpControlType . SDES ) ; } } } else if ( isInitiator ) { SrtpControl sdesControl = getSrtpControls ( ) . remove ( mediaType , SrtpControlType . SDES ) ; if ( sdesControl != null ) sdesControl . cleanup ( null ) ; } }
Detects and adds SDES available encryption method present in the
 description given in parameter.
Detects and adds SDES available encryption method present in the description given in parameter .
// SDES is not supported in telephony conferences utilizing the // server-side technology Jitsi Videobridge yet. // Conforming to XEP-0167 schema there is 0 or 1 ENCRYPTION element for // a given DESCRIPTION. // SDES //found an SDES answer, remove all other controls // If we were initiating the encryption, and the remote peer does not // manage it, then we must remove the unusable SDES srtpControl. // SDES