src/net/java/sip/communicator/impl/protocol/jabber/CallPeerMediaHandlerJabberImpl.java
/**
     * Gathers local candidate addresses.
     *
     * @param remote the media descriptions received from the remote peer if any
     * or <tt>null</tt> if <tt>local</tt> represents an offer from the local
     * peer to be sent to the remote peer
     * @param local the media descriptions sent or to be sent from the local
     * peer to the remote peer. If <tt>remote</tt> is <tt>null</tt>,
     * <tt>local</tt> represents an offer from the local peer to be sent to the
     * remote peer
     * @param transportInfoSender the <tt>TransportInfoSender</tt> to be used by
     * this <tt>TransportManagerJabberImpl</tt> to send <tt>transport-info</tt>
     * <tt>JingleIQ</tt>s from the local peer to the remote peer if this
     * <tt>TransportManagerJabberImpl</tt> wishes to utilize
     * <tt>transport-info</tt>
     * @return the media descriptions of the local peer after the local
     * candidate addresses have been gathered as returned by
     * {@link TransportManagerJabberImpl#wrapupCandidateHarvest()}
     * @throws OperationFailedException if anything goes wrong while starting or
     * wrapping up the gathering of local candidate addresses
     */
Gathers local candidate addresses.
@param remote the media descriptions received from the remote peer if any
or null if local represents an offer from the local
peer to be sent to the remote peer
@param local the media descriptions sent or to be sent from the local
peer to the remote peer. If remote is null,
local represents an offer from the local peer to be sent to the
remote peer
@param transportInfoSender the TransportInfoSender to be used by
this TransportManagerJabberImpl to send transport-info
JingleIQs from the local peer to the remote peer if this
TransportManagerJabberImpl wishes to utilize
transport-info
@return the media descriptions of the local peer after the local
candidate addresses have been gathered as returned by
TransportManagerJabberImpl#wrapupCandidateHarvest()
@throws OperationFailedException if anything goes wrong while starting or
wrapping up the gathering of local candidate addresses
Gathers local candidate addresses . @param remote the media descriptions received from the remote peer if any or null if local represents an offer from the local peer to be sent to the remote peer @param local the media descriptions sent or to be sent from the local peer to the remote peer . If remote is null local represents an offer from the local peer to be sent to the remote peer @param transportInfoSender the TransportInfoSender to be used by this TransportManagerJabberImpl to send transport - info JingleIQs from the local peer to the remote peer if this TransportManagerJabberImpl wishes to utilize transport - info @return the media descriptions of the local peer after the local candidate addresses have been gathered as returned by TransportManagerJabberImpl#wrapupCandidateHarvest () @throws OperationFailedException if anything goes wrong while starting or wrapping up the gathering of local candidate addresses
private List<ContentPacketExtension> harvestCandidates(
            List<ContentPacketExtension> remote,
            List<ContentPacketExtension> local,
            TransportInfoSender transportInfoSender)
        throws OperationFailedException
    {
        long startCandidateHarvestTime = System.currentTimeMillis();
        TransportManagerJabberImpl transportManager = getTransportManager();
        if (remote == null)
        {
            /*
             * We'll be harvesting candidates in order to make an offer so it
             * doesn't make sense to send them in transport-info.
             */
            if (transportInfoSender != null)
                throw new IllegalArgumentException("transportInfoSender");
            transportManager.startCandidateHarvest(local, transportInfoSender);
        }
        else
        {
            transportManager.startCandidateHarvest(
                    remote,
                    local,
                    transportInfoSender);
        }
        long stopCandidateHarvestTime = System.currentTimeMillis();
        if (logger.isInfoEnabled())
        {
            long candidateHarvestTime
                = stopCandidateHarvestTime - startCandidateHarvestTime;
            logger.info(
                    "End candidate harvest within " + candidateHarvestTime
                        + " ms");
        }
        setDtlsEncryptionOnTransports(remote, local);
        if (transportManager.startConnectivityEstablishmentWithJitsiVideobridge)
        {
            Map<String,IceUdpTransportPacketExtension> map
                = new LinkedHashMap<String,IceUdpTransportPacketExtension>();
            for (MediaType mediaType : MediaType.values())
            {
                ColibriConferenceIQ.Channel channel
                    = transportManager.getColibriChannel(
                            mediaType,
                            true /* local */);
                if (channel != null)
                {
                    IceUdpTransportPacketExtension transport
                        = channel.getTransport();
                    if (transport != null)
                        map.put(mediaType.toString(), transport);
                }
            }
            if (!map.isEmpty())
            {
                transportManager
                    .startConnectivityEstablishmentWithJitsiVideobridge
                        = false;
                transportManager.startConnectivityEstablishment(map);
            }
        }
        /*
         * TODO Ideally, we wouldn't wrap up that quickly. We need to revisit
         * this.
         */
        return transportManager.wrapupCandidateHarvest();
    }
private List < ContentPacketExtension > harvestCandidates ( List < ContentPacketExtension > remote , List < ContentPacketExtension > local , TransportInfoSender transportInfoSender ) throws OperationFailedException { long startCandidateHarvestTime = System . currentTimeMillis ( ) ; TransportManagerJabberImpl transportManager = getTransportManager ( ) ; if ( remote == null ) { /*
             * We'll be harvesting candidates in order to make an offer so it
             * doesn't make sense to send them in transport-info.
             */ if ( transportInfoSender != null ) throw new IllegalArgumentException ( "transportInfoSender" ) ; transportManager . startCandidateHarvest ( local , transportInfoSender ) ; } else { transportManager . startCandidateHarvest ( remote , local , transportInfoSender ) ; } long stopCandidateHarvestTime = System . currentTimeMillis ( ) ; if ( logger . isInfoEnabled ( ) ) { long candidateHarvestTime = stopCandidateHarvestTime - startCandidateHarvestTime ; logger . info ( "End candidate harvest within " + candidateHarvestTime + " ms" ) ; } setDtlsEncryptionOnTransports ( remote , local ) ; if ( transportManager . startConnectivityEstablishmentWithJitsiVideobridge ) { Map < String , IceUdpTransportPacketExtension > map = new LinkedHashMap < String , IceUdpTransportPacketExtension > ( ) ; for ( MediaType mediaType : MediaType . values ( ) ) { ColibriConferenceIQ . Channel channel = transportManager . getColibriChannel ( mediaType , true /* local */ ) ; if ( channel != null ) { IceUdpTransportPacketExtension transport = channel . getTransport ( ) ; if ( transport != null ) map . put ( mediaType . toString ( ) , transport ) ; } } if ( ! map . isEmpty ( ) ) { transportManager . startConnectivityEstablishmentWithJitsiVideobridge = false ; transportManager . startConnectivityEstablishment ( map ) ; } } /*
         * TODO Ideally, we wouldn't wrap up that quickly. We need to revisit
         * this.
         */ return transportManager . wrapupCandidateHarvest ( ) ; }
Gathers local candidate addresses.
Gathers local candidate addresses .