use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class WsWorstCaseAffinityTest method setUp.
@Before
public void setUp() throws Exception {
shootist = new Shootist(ListeningPointExt.WS, 5060);
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(null);
lbConfig.getSipConfiguration().getInternalLegConfiguration().setWsPort(5065);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setWsPort(5060);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(WorstCaseUdpTestAffinityAlgorithm.class.getName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setEarlyDialogWorstCase(true);
balancer.start(lbConfig);
for (int q = 0; q < servers.length; q++) {
servers[q] = new AppServer("node" + q, 4060 + q, "127.0.0.1", 2000, 5060, 5065, "0", ListeningPointExt.WS, 2222 + q);
servers[q].start();
}
Thread.sleep(5000);
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class WssWorstCaseAffinityTest method setUp.
@Before
public void setUp() throws Exception {
shootist = new Shootist(ListeningPointExt.WSS, 5061);
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
lbConfig.getSipConfiguration().getExternalLegConfiguration().setTcpPort(null);
lbConfig.getSipConfiguration().getInternalLegConfiguration().setWssPort(5066);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setWssPort(5061);
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setAlgorithmClass(WorstCaseUdpTestAffinityAlgorithm.class.getName());
lbConfig.getSipConfiguration().getAlgorithmConfiguration().setEarlyDialogWorstCase(true);
lbConfig.getSipStackConfiguration().getSipStackProperies().setProperty("javax.net.ssl.keyStore", SinglePointTest.class.getClassLoader().getResource("keystore").getFile());
lbConfig.getSipStackConfiguration().getSipStackProperies().setProperty("javax.net.ssl.trustStorePassword", "123456");
lbConfig.getSipStackConfiguration().getSipStackProperies().setProperty("javax.net.ssl.trustStore", SinglePointTest.class.getClassLoader().getResource("keystore").getFile());
lbConfig.getSipStackConfiguration().getSipStackProperies().setProperty("javax.net.ssl.keyStorePassword", "123456");
lbConfig.getSslConfiguration().setTlsClientProtocols("TLSv1,TLSv1.1,TLSv1.2");
lbConfig.getSslConfiguration().setEnabledCipherSuites("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA,TLS_DHE_RSA_WITH_AES_128_CBC_SHA");
balancer.start(lbConfig);
for (int q = 0; q < servers.length; q++) {
servers[q] = new AppServer("node" + q, 4060 + q, "127.0.0.1", 2000, 5061, 5066, "0", ListeningPointExt.WSS, 2222 + q);
servers[q].start();
Thread.sleep(1000);
}
Thread.sleep(5000);
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class BindingWithIncorrectSystemidTest method initialization.
@BeforeClass
public static void initialization() {
// start lb
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = ConfigInit.getLbPropertiesWithOneServer();
lbConfig.getSmppConfiguration().setReconnectPeriod(2000);
balancer.start(lbConfig);
// start servers
serverHandler = new DefaultSmppServerHandler();
server = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(0, false), serverHandler, executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
server.start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class CommonTest method initialization.
@BeforeClass
public static void initialization() {
boolean enableSslLbPort = false;
boolean terminateTLSTraffic = true;
// start lb
balancer = new BalancerRunner();
ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic).getSmppConfiguration().setTimeoutConnection(2000);
ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic).getSmppConfiguration().setTimeoutConnectionCheckClientSide(5000);
ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic).getSmppConfiguration().setTimeoutConnectionCheckServerSide(5000);
balancer.start(ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic));
// start servers
serverArray = new DefaultSmppServer[serverNumbers];
serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
for (int i = 0; i < serverNumbers; i++) {
serverHandlerArray[i] = new DefaultSmppServerHandler();
serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
logger.info("Starting SMPP server...");
try {
serverArray[i].start();
} catch (SmppChannelException e) {
logger.info("SMPP server does not started");
e.printStackTrace();
}
logger.info("SMPP server started");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
use of org.mobicents.tools.sip.balancer.BalancerRunner in project load-balancer by RestComm.
the class SipBalancerUdpTest method setUp.
public void setUp() throws Exception {
balancer = new BalancerRunner();
LoadBalancerConfiguration lbConfig = new LoadBalancerConfiguration();
Properties properies = new Properties();
properies.setProperty("javax.sip.STACK_NAME", "SipBalancerForwarder");
lbConfig.getSipStackConfiguration().setSipStackProperies(properies);
lbConfig.getSipConfiguration().getExternalLegConfiguration().setHost("127.0.0.1");
lbConfig.getSipConfiguration().getInternalLegConfiguration().setHost("127.0.0.1");
lbConfig.getSipConfiguration().getExternalLegConfiguration().setUdpPort(5060);
lbConfig.getSipConfiguration().getInternalLegConfiguration().setUdpPort(5065);
lbConfig.getSipConfiguration().setUsePrettyEncoding(true);
lbConfig.getHttpConfiguration().setHttpPort(null);
lbConfig.getSmppConfiguration().setSmppPort(null);
balancer.start(lbConfig);
server = new BlackholeAppServer("blackhole", 18452, "127.0.0.1");
server.start();
Thread.sleep(5000);
}
Aggregations