/** * 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; }
/** * Constructor for this class. Creates the JAIN-SIP stack. * * @throws OperationFailedException if creating the stack fails. */ SipStackSharing() throws OperationFailedException { // init of the stack try { SipFactory sipFactory = SipFactory.getInstance(); sipFactory.setPathName("org.jitsi.gov.nist"); Properties sipStackProperties = new SipStackProperties(); // Create SipStack object this.stack = sipFactory.createSipStack(sipStackProperties); if (logger.isTraceEnabled()) logger.trace("Created stack: " + this.stack); // set our custom address resolver managing SRV records AddressResolverImpl addressResolver = new AddressResolverImpl(); ((SIPTransactionStack) this.stack).setAddressResolver(addressResolver); SipActivator.getNetworkAddressManagerService().addNetworkConfigurationChangeListener(this); } catch (Exception ex) { logger.fatal("Failed to get SIP Factory.", ex); throw new OperationFailedException( "Failed to get SIP Factory", OperationFailedException.INTERNAL_ERROR, ex); } }
/** * 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); }