src/net/java/sip/communicator/impl/protocol/sip/CallPeerMediaHandlerSipImpl.java
/**
     * Determines whether a specific <tt>MediaDescription</tt> selects DTLS-SRTP
     * as the encryption protocol i.e. checks whether the <tt>proto</tt> of the
     * specified <tt>mediaDescription</tt> is supported by DTLS-SRTP and
     * whether the specified <tt>mediaDescription</tt> assigns non-empty values
     * to the SDP attributes <tt>fingerprint</tt> and <tt>setup</tt>.
     *
     * @param mediaDescription the <tt>MediaDescription</tt> to be analyzed
     * @return <tt>true</tt> if the specified <tt>mediaDescription</tt> selects
     * DTLS-SRTP as the encryption protocol; otherwise, <tt>false</tt>
     */
Determines whether a specific MediaDescription selects DTLS-SRTP
as the encryption protocol i.e. checks whether the proto of the
specified mediaDescription is supported by DTLS-SRTP and
whether the specified mediaDescription assigns non-empty values
to the SDP attributes fingerprint and setup.

@param mediaDescription the MediaDescription to be analyzed
@return true if the specified mediaDescription selects
DTLS-SRTP as the encryption protocol; otherwise, false
Determines whether a specific MediaDescription selects DTLS - SRTP as the encryption protocol i . e . checks whether the proto of the specified mediaDescription is supported by DTLS - SRTP and whether the specified mediaDescription assigns non - empty values to the SDP attributes fingerprint and setup . @param mediaDescription the MediaDescription to be analyzed @return true if the specified mediaDescription selects DTLS - SRTP as the encryption protocol ; otherwise false
private boolean isDtlsMediaDescription(MediaDescription mediaDescription)
    {
        boolean dtls = false;
        if (mediaDescription != null)
        {
            Media media = mediaDescription.getMedia();
            if (media != null)
            {
                try
                {
                    String proto = media.getProtocol();
                    if (DtlsControl.UDP_TLS_RTP_SAVP.equals(proto)
                            || DtlsControl.UDP_TLS_RTP_SAVPF.equals(proto)
                            || SrtpControl.RTP_SAVPF.equals(proto))
                    {
                        String fingerprint
                            = mediaDescription.getAttribute(
                                    DTLS_SRTP_FINGERPRINT_ATTR);
                        if ((fingerprint != null)
                                && (fingerprint.length() != 0))
                        {
                            String setup
                                = mediaDescription.getAttribute(
                                        DTLS_SRTP_SETUP_ATTR);
                            if ((setup != null) && (setup.length() != 0))
                                dtls = true;
                        }
                    }
                }
                catch (SdpParseException e)
                {
                    /*
                     * Well, if the protocol of the Media cannot be parsed, then
                     * surely we do not want to have anything to do with it.
                     */
                }
            }
        }
        return dtls;
    }
private boolean isDtlsMediaDescription ( MediaDescription mediaDescription ) { boolean dtls = false ; if ( mediaDescription != null ) { Media media = mediaDescription . getMedia ( ) ; if ( media != null ) { try { String proto = media . getProtocol ( ) ; if ( DtlsControl . UDP_TLS_RTP_SAVP . equals ( proto ) || DtlsControl . UDP_TLS_RTP_SAVPF . equals ( proto ) || SrtpControl . RTP_SAVPF . equals ( proto ) ) { String fingerprint = mediaDescription . getAttribute ( DTLS_SRTP_FINGERPRINT_ATTR ) ; if ( ( fingerprint != null ) && ( fingerprint . length ( ) != 0 ) ) { String setup = mediaDescription . getAttribute ( DTLS_SRTP_SETUP_ATTR ) ; if ( ( setup != null ) && ( setup . length ( ) != 0 ) ) dtls = true ; } } } catch ( SdpParseException e ) { /*
                     * Well, if the protocol of the Media cannot be parsed, then
                     * surely we do not want to have anything to do with it.
                     */ } } } return dtls ; }
Determines whether a specific <tt>MediaDescription</tt> selects DTLS-SRTP
 as the encryption protocol i.e.
Determines whether a specific <tt > MediaDescription< / tt > selects DTLS - SRTP as the encryption protocol i . e .