src/net/java/sip/communicator/service/protocol/media/TransportManager.java
/**
     * Tries to set the ranges of the <tt>PortTracker</tt>s (e.g. default,
     * audio, video, data channel) to the values specified in the
     * <tt>ConfigurationService</tt>.
     */
Tries to set the ranges of the PortTrackers  to the values specified in the
ConfigurationService.
Tries to set the ranges of the PortTrackers to the values specified in the ConfigurationService .
protected synchronized static void initializePortNumbers()
    {
        ConfigurationService cfg
            = ProtocolMediaActivator.getConfigurationService();
        String minPort, maxPort;
        minPort
            = cfg.getString(
                    OperationSetBasicTelephony
                        .MIN_MEDIA_PORT_NUMBER_PROPERTY_NAME);
        if (minPort != null)
        {
            maxPort
                = cfg.getString(
                        OperationSetBasicTelephony
                            .MAX_MEDIA_PORT_NUMBER_PROPERTY_NAME);
            if (maxPort != null)
            {
                defaultPortTracker.tryRange(minPort, maxPort);
            }
        }
        minPort
            = cfg.getString(
                    OperationSetBasicTelephony
                        .MIN_VIDEO_PORT_NUMBER_PROPERTY_NAME);
        if (minPort != null)
        {
            maxPort
                = cfg.getString(
                        OperationSetBasicTelephony
                            .MAX_VIDEO_PORT_NUMBER_PROPERTY_NAME);
            if (maxPort != null)
            {
                if (videoPortTracker == null)
                {
                    videoPortTracker
                        = PortTracker.createTracker(minPort, maxPort);
                }
                else
                {
                    videoPortTracker.tryRange(minPort, maxPort);
                }
            }
        }
        minPort
            = cfg.getString(
                    OperationSetBasicTelephony
                        .MIN_AUDIO_PORT_NUMBER_PROPERTY_NAME);
        if (minPort != null)
        {
            maxPort
                = cfg.getString(
                        OperationSetBasicTelephony
                            .MAX_AUDIO_PORT_NUMBER_PROPERTY_NAME);
            if (maxPort != null)
            {
                if (audioPortTracker == null)
                {
                    audioPortTracker
                        = PortTracker.createTracker(minPort, maxPort);
                }
                else
                {
                    audioPortTracker.tryRange(minPort, maxPort);
                }
            }
        }
        minPort
            = cfg.getString(
                    OperationSetBasicTelephony
                        .MIN_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME);
        if (minPort != null)
        {
            maxPort
                = cfg.getString(
                        OperationSetBasicTelephony
                            .MAX_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME);
            if (maxPort != null)
            {
                if (dataPortTracker == null)
                {
                    dataPortTracker
                        = PortTracker.createTracker(minPort, maxPort);
                }
                else
                {
                    dataPortTracker.tryRange(minPort, maxPort);
                }
            }
        }
    }
protected synchronized static void initializePortNumbers ( ) { ConfigurationService cfg = ProtocolMediaActivator . getConfigurationService ( ) ; String minPort , maxPort ; minPort = cfg . getString ( OperationSetBasicTelephony . MIN_MEDIA_PORT_NUMBER_PROPERTY_NAME ) ; if ( minPort != null ) { maxPort = cfg . getString ( OperationSetBasicTelephony . MAX_MEDIA_PORT_NUMBER_PROPERTY_NAME ) ; if ( maxPort != null ) { defaultPortTracker . tryRange ( minPort , maxPort ) ; } } minPort = cfg . getString ( OperationSetBasicTelephony . MIN_VIDEO_PORT_NUMBER_PROPERTY_NAME ) ; if ( minPort != null ) { maxPort = cfg . getString ( OperationSetBasicTelephony . MAX_VIDEO_PORT_NUMBER_PROPERTY_NAME ) ; if ( maxPort != null ) { if ( videoPortTracker == null ) { videoPortTracker = PortTracker . createTracker ( minPort , maxPort ) ; } else { videoPortTracker . tryRange ( minPort , maxPort ) ; } } } minPort = cfg . getString ( OperationSetBasicTelephony . MIN_AUDIO_PORT_NUMBER_PROPERTY_NAME ) ; if ( minPort != null ) { maxPort = cfg . getString ( OperationSetBasicTelephony . MAX_AUDIO_PORT_NUMBER_PROPERTY_NAME ) ; if ( maxPort != null ) { if ( audioPortTracker == null ) { audioPortTracker = PortTracker . createTracker ( minPort , maxPort ) ; } else { audioPortTracker . tryRange ( minPort , maxPort ) ; } } } minPort = cfg . getString ( OperationSetBasicTelephony . MIN_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME ) ; if ( minPort != null ) { maxPort = cfg . getString ( OperationSetBasicTelephony . MAX_DATA_CHANNEL_PORT_NUMBER_PROPERTY_NAME ) ; if ( maxPort != null ) { if ( dataPortTracker == null ) { dataPortTracker = PortTracker . createTracker ( minPort , maxPort ) ; } else { dataPortTracker . tryRange ( minPort , maxPort ) ; } } } }
Tries to set the ranges of the <tt>PortTracker</tt>s (e.g.
Tries to set the ranges of the <tt > PortTracker< / tt > s ( e . g .
//try the default tracker first //Try the specified range; otherwise, leave the tracker as it //is: [5000, 6000]. //try the VIDEO tracker //Try the specified range; otherwise, leave the tracker to null. //try the AUDIO tracker //Try the specified range; otherwise, leave the tracker to null. //try the DATA CHANNEL tracker //Try the specified range; otherwise, leave the tracker to null.