src/net/java/sip/communicator/impl/protocol/sip/IceTransportManagerSipImpl.java
/**
     * Starts transport candidate harvest. This method should complete rapidly
     * and, in case of lengthy procedures like STUN/TURN/UPnP candidate harvests
     * are necessary, they should be executed in a separate thread. Candidate
     * harvest would then need to be concluded in the
     * {@link #wrapupCandidateHarvest()} method which would be called once we
     * absolutely need the candidates.
     *
     * @param ourOffer the SDP that should tell us how many stream connectors we
     * actually need.
     * @param trickleCallback the callback that will be taking care of
     * candidates that we discover asynchronously or <tt>null</tt> in case we
     * wouldn't won't to use trickle ICE (either because it is disabled or,
     * potentially, because we are doing half trickle).
     * @param advertiseTrickle indicates whether we should be including the
     * ice-options:trickle attribute in the SDP. Note that this parameter is
     * ignored and considered <tt>true</tt> if <tt>trickleCallback</tt> is not
     * <tt>null</tt>.
     * @param useBundle indicates whether or not we are using bundle.
     * @param advertiseBundle indicates whether or not we should be advertising
     * bundle to the remote party ( assumed as <tt>true</tt> in case
     * <tt>useBundle</tt> is already set to <tt>true</tt>).
     * @param useRtcpMux indicates whether or not we are using rtcp-mux.
     * @param advertiseRtcpMux indicates whether or not we should be advertising
     * rtcp-mux to the remote party ( assumed as <tt>true</tt> in case
     * <tt>useRtcpMux</tt> is already set to <tt>true</tt>).
     *
     * @throws OperationFailedException if we fail to allocate a port number.
     */
Starts transport candidate harvest. This method should complete rapidly
and, in case of lengthy procedures like STUN/TURN/UPnP candidate harvests
are necessary, they should be executed in a separate thread. Candidate
harvest would then need to be concluded in the
#wrapupCandidateHarvest() method which would be called once we
absolutely need the candidates.

@param ourOffer the SDP that should tell us how many stream connectors we
actually need.
@param trickleCallback the callback that will be taking care of
candidates that we discover asynchronously or null in case we
wouldn't won't to use trickle ICE (either because it is disabled or,
potentially, because we are doing half trickle).
@param advertiseTrickle indicates whether we should be including the
ice-options:trickle attribute in the SDP. Note that this parameter is
ignored and considered true if trickleCallback is not
null.
@param useBundle indicates whether or not we are using bundle.
@param advertiseBundle indicates whether or not we should be advertising
bundle to the remote party ( assumed as true in case
useBundle is already set to true).
@param useRtcpMux indicates whether or not we are using rtcp-mux.
@param advertiseRtcpMux indicates whether or not we should be advertising
rtcp-mux to the remote party ( assumed as true in case
useRtcpMux is already set to true).

@throws OperationFailedException if we fail to allocate a port number.
Starts transport candidate harvest . This method should complete rapidly and in case of lengthy procedures like STUN / TURN / UPnP candidate harvests are necessary they should be executed in a separate thread . Candidate harvest would then need to be concluded in the #wrapupCandidateHarvest () method which would be called once we absolutely need the candidates . @param ourOffer the SDP that should tell us how many stream connectors we actually need . @param trickleCallback the callback that will be taking care of candidates that we discover asynchronously or null in case we wouldn ' t won ' t to use trickle ICE ( either because it is disabled or potentially because we are doing half trickle ) . @param advertiseTrickle indicates whether we should be including the ice - options : trickle attribute in the SDP . Note that this parameter is ignored and considered true if trickleCallback is not null . @param useBundle indicates whether or not we are using bundle . @param advertiseBundle indicates whether or not we should be advertising bundle to the remote party ( assumed as true in case useBundle is already set to true ) . @param useRtcpMux indicates whether or not we are using rtcp - mux . @param advertiseRtcpMux indicates whether or not we should be advertising rtcp - mux to the remote party ( assumed as true in case useRtcpMux is already set to true ) . @throws OperationFailedException if we fail to allocate a port number .
public void startCandidateHarvest(SessionDescription ourOffer,
                                      Object             trickleCallback,
                                      boolean            advertiseTrickle,
                                      boolean            useBundle,
                                      boolean            advertiseBundle,
                                      boolean            useRtcpMux,
                                      boolean            advertiseRtcpMux)
        throws OperationFailedException
    {
        iceAgent = createIceAgent();
        iceAgent.setControlling(true);
        iceAgent.setControlling(true);
        for(MediaDescription mLine
                : SdpUtils.extractMediaDescriptions(ourOffer))
        {
            createIceStream(SdpUtils.getMediaType(mLine).toString(), iceAgent);
        }
        IceSdpUtils.initSessionDescription(ourOffer, iceAgent);
    }
public void startCandidateHarvest ( SessionDescription ourOffer , Object trickleCallback , boolean advertiseTrickle , boolean useBundle , boolean advertiseBundle , boolean useRtcpMux , boolean advertiseRtcpMux ) throws OperationFailedException { iceAgent = createIceAgent ( ) ; iceAgent . setControlling ( true ) ; iceAgent . setControlling ( true ) ; for ( MediaDescription mLine : SdpUtils . extractMediaDescriptions ( ourOffer ) ) { createIceStream ( SdpUtils . getMediaType ( mLine ) . toString ( ) , iceAgent ) ; } IceSdpUtils . initSessionDescription ( ourOffer , iceAgent ) ; }
Starts transport candidate harvest.
Starts transport candidate harvest .
//obviously we ARE the controlling agent since we are the ones creating //the offer. //add the candidate attributes and set default candidates //now that our iceAgent is ready, reflect it on our offer.