/**
   * Fetches the preferred TLS (TCP) port for secure communications in the user preferences or
   * search is default value set in settings or fallback on a default value.
   *
   * @return the preferred network port for secure communications.
   */
  private int getPreferredSecurePort() {
    int preferredPort =
        SipActivator.getConfigurationService().getInt(PREFERRED_SECURE_PORT_PROPERTY_NAME, -1);

    if (preferredPort <= 1) {
      // check for default value
      preferredPort =
          SipActivator.getResources().getSettingsInt(PREFERRED_SECURE_PORT_PROPERTY_NAME);
    }

    if (preferredPort <= 1) return ListeningPoint.PORT_5061;
    else return preferredPort;
  }
 /**
  * Fetches the number of times to retry when the binding of a JAIN-SIP <tt>ListeningPoint</tt>
  * fails. Looks in the user preferences or fallbacks on a default value.
  *
  * @return the number of times to retry a failed bind.
  */
 private int getBindRetriesValue() {
   return SipActivator.getConfigurationService()
       .getInt(
           ProtocolProviderService.BIND_RETRIES_PROPERTY_NAME,
           ProtocolProviderService.BIND_RETRIES_DEFAULT_VALUE);
 }