Search in sources :

Example 1 with ProtocolObjects

use of org.mobicents.tools.sip.balancer.ProtocolObjects in project load-balancer by RestComm.

the class BackToBackUserAgent method start.

public void start() {
    SipFactory sipFactory = null;
    sipFactory = SipFactory.getInstance();
    sipFactory.setPathName("gov.nist");
    this.protocolObjects = new ProtocolObjects("backtobackua", "gov.nist", transport, true, true, false);
    try {
        messageFactory = protocolObjects.messageFactory;
        lp = protocolObjects.sipStack.createListeningPoint("127.0.0.1", port, transport);
        sp = protocolObjects.sipStack.createSipProvider(lp);
        sp.addSipListener(this);
        protocolObjects.start();
        node = new Node("Node", "127.0.0.1");
        node.getProperties().put(transport.toLowerCase() + "Port", "" + port);
        node.getProperties().put("version", "0");
        node.getProperties().put(Protocol.SESSION_ID, "" + System.currentTimeMillis());
        node.getProperties().put(Protocol.HEARTBEAT_PORT, "" + heartbeatPort);
        clientController = new ClientController(this, lbAddress, lbHBPort, node, 2000, heartbeatPeriod, executor);
        clientController.startClient();
    } catch (Exception ex) {
    }
}
Also used : ProtocolObjects(org.mobicents.tools.sip.balancer.ProtocolObjects) Node(org.mobicents.tools.heartbeat.api.Node) SipFactory(javax.sip.SipFactory) ClientController(org.mobicents.tools.heartbeat.impl.ClientController) InvalidArgumentException(javax.sip.InvalidArgumentException) ParseException(java.text.ParseException) SipException(javax.sip.SipException)

Aggregations

ParseException (java.text.ParseException)1 InvalidArgumentException (javax.sip.InvalidArgumentException)1 SipException (javax.sip.SipException)1 SipFactory (javax.sip.SipFactory)1 Node (org.mobicents.tools.heartbeat.api.Node)1 ClientController (org.mobicents.tools.heartbeat.impl.ClientController)1 ProtocolObjects (org.mobicents.tools.sip.balancer.ProtocolObjects)1