public void addSipConnector(ListeningPoint listeningPoint) { if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)){ logger.logInfo("Adding Listening Point to be using the Load Balancer for outbound traffic " + listeningPoint.getIPAddress() + ":" + listeningPoint.getPort() + "/" + listeningPoint.getTransport()); logger.logInfo("Recomputing SIP Nodes to be sent to the LB"); } // https://github.com/RestComm/jain-sip.ha/issues/3 we restrict only if one connector is passed forcefully this way useLoadBalancerForAllConnectors = false; sipConnectors.add(listeningPoint); updateConnectorsAsSIPNode(); }
public void addSipConnector(ListeningPoint listeningPoint, SipLoadBalancer loadBalancer) { if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)){ logger.logInfo("Adding Listening Point to be using the Load Balancer " + loadBalancer + " for outbound traffic " + listeningPoint.getIPAddress() + ":" + listeningPoint.getPort() + "/" + listeningPoint.getTransport()); logger.logInfo("Recomputing SIP Nodes to be sent to the LB"); } // https://github.com/RestComm/jain-sip.ha/issues/3 we restrict only if one connector is passed forcefully this way useLoadBalancerForAllConnectors = false; Set<ListeningPoint> sipConnectors = connectors.get(loadBalancer); if(sipConnectors == null) { sipConnectors = new CopyOnWriteArraySet<ListeningPoint>(); connectors.put(loadBalancer, sipConnectors); } sipConnectors.add(listeningPoint); updateConnectorsAsSIPNode(loadBalancer); // notify the listeners for (LoadBalancerHeartBeatingListener loadBalancerHeartBeatingListener : loadBalancerHeartBeatingListeners) { loadBalancerHeartBeatingListener.loadBalancerAdded(loadBalancer); } }
public void removeSipConnector(ListeningPoint listeningPoint) { if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)){ logger.logInfo("Removing Listening Point to be using the Load Balancer for outbound traffic " + listeningPoint.getIPAddress() + ":" + listeningPoint.getPort() + "/" + listeningPoint.getTransport()); logger.logInfo("Recomputing SIP Nodes to be sent to the LB"); } sipConnectors.remove(listeningPoint); updateConnectorsAsSIPNode(); } }
public void removeSipConnector(ListeningPoint listeningPoint, SipLoadBalancer loadBalancer) { if(logger.isLoggingEnabled(StackLogger.TRACE_INFO)){ logger.logInfo("Removing Listening Point to be using the Load Balancer " + loadBalancer + " for outbound traffic " + listeningPoint.getIPAddress() + ":" + listeningPoint.getPort() + "/" + listeningPoint.getTransport()); logger.logInfo("Recomputing SIP Nodes to be sent to the LB"); } // https://github.com/RestComm/jain-sip.ha/issues/3 we restrict only if one connector is passed forcefully this way useLoadBalancerForAllConnectors = false; Set<ListeningPoint> sipConnectors = connectors.get(loadBalancer); sipConnectors.remove(listeningPoint); updateConnectorsAsSIPNode(loadBalancer); // notify the listeners for (LoadBalancerHeartBeatingListener loadBalancerHeartBeatingListener : loadBalancerHeartBeatingListeners) { loadBalancerHeartBeatingListener.loadBalancerRemoved(loadBalancer); } } }
public void runTask() { if (logger.isLoggingEnabled(LogWriter.TRACE_DEBUG)) { logger.logDebug( "~~~ Starting processing of KeepAliveTimeoutEvent( " + peerAddress.getHostAddress() + "," + peerPort + ")..."); } close(true, true); if(sipStack instanceof SipStackImpl) { for (Iterator<SipProviderImpl> it = ((SipStackImpl)sipStack).getSipProviders(); it.hasNext();) { SipProviderImpl nextProvider = (SipProviderImpl) it.next(); SipListener sipListener= nextProvider.getSipListener(); ListeningPoint[] listeningPoints = nextProvider.getListeningPoints(); for(ListeningPoint listeningPoint : listeningPoints) { if(sipListener!= null && sipListener instanceof SipListenerExt // making sure that we don't notify each listening point but only the one on which the timeout happened && listeningPoint.getIPAddress().equalsIgnoreCase(myAddress) && listeningPoint.getPort() == myPort && listeningPoint.getTransport().equalsIgnoreCase(getTransport())) { ((SipListenerExt)sipListener).processIOException(new IOExceptionEventExt(nextProvider, Reason.KeepAliveTimeout, myAddress, myPort, peerAddress.getHostAddress(), peerPort, getTransport())); } } } } else { SipListener sipListener = sipStack.getSipListener(); if(sipListener instanceof SipListenerExt) { ((SipListenerExt)sipListener).processIOException(new IOExceptionEventExt(this, Reason.KeepAliveTimeout, myAddress, myPort, peerAddress.getHostAddress(), peerPort, getTransport())); } } } }
String transport = listeningPoint.getTransport(); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("connector: " + address + ", port: " + port + ", transport: " + transport);
String transport = listeningPoint.getTransport(); if(logger.isLoggingEnabled(StackLogger.TRACE_TRACE)) { logger.logTrace("connector: " + address + ", port: " + port + ", transport: " + transport);
private ContactHeader getContactHeader() throws ParseException { if (contactHeader == null) { final ListeningPoint listeningPoint = sleeSipProvider .getListeningPoint("udp"); final javax.sip.address.SipURI sipURI = addressFactory .createSipURI(null, listeningPoint.getIPAddress()); sipURI.setPort(listeningPoint.getPort()); sipURI.setTransportParam(listeningPoint.getTransport()); contactHeader = headerFactory.createContactHeader(addressFactory .createAddress(sipURI)); } return contactHeader; }
sipProvider.getListeningPoints()[0].getIPAddress(), sipProvider.getListeningPoints()[0].getPort(), sipProvider.getListeningPoints()[0].getTransport(), null); viaHeaders.add(viaHeader);
URI contactURI = sleeSipProvider.getLocalSipURI(sleeSipProvider.getListeningPoints()[0].getTransport()); Address contactAddress = addressFactory.createAddress(contactURI); ContactHeader contactHeader = headerFactory.createContactHeader(contactAddress);
.createViaHeader(listeningPoint.getIPAddress(), listeningPoint.getPort(), listeningPoint.getTransport(), null); viaHeaders.add(viaHeader); ContentTypeHeader contentTypeHeader = headerFactory