public void testDialogFailover() throws Exception {

    balancer = new Balancer(IP_ADDRESS, BALANCER_PORT);

    balancer.start();

    shootist = new Shootist(true);

    shootme = new Shootme("shootme", 5070, true);

    shootmeRecoveryNode = new Shootme("shootme_recovery", 5080, true);

    shootme.init();
    shootmeRecoveryNode.init();

    Thread.sleep(5000);

    shootist.init();

    Thread.sleep(10000);

    shootist.stop();
    shootmeRecoveryNode.stop();
    //      shootme.stop();
    stopSipStack(balancer.sipStack, balancer);

    assertTrue(shootist.okToByeReceived);
  }
Example #2
0
  public void tearDown() {
    try {
      Thread.sleep(12000);

      this.shootist.checkState();

      int ackCount = 0;

      for (Shootme shootme : this.shootme) {
        shootme.checkState();

        if (shootme.isAckSeen()) {
          ackCount++;
        }
      }

      assertEquals("ACK count must be exactly 2", 2, ackCount);

      this.shootist.stop();

      for (Shootme shootme : this.shootme) {

        shootme.stop();
      }

      this.proxy.stop();
    } catch (Exception ex) {
      ex.printStackTrace();
      logger.error("unexpected exception", ex);
      fail("unexpected exception ");
    }
  }
Example #3
0
  public void setUp() {

    try {
      super.setUp();
      shootist = new Shootist(6050, 5070);
      SipProvider shootistProvider = shootist.createSipProvider();
      shootistProvider.addSipListener(shootist);
      boolean sendRinging = true;
      for (int i = 0; i < forkCount; i++) {

        Shootme shootme = new Shootme(5080 + i, sendRinging, 400 * forkCount - 200 * i);
        sendRinging = false;
        SipProvider shootmeProvider = shootme.createProvider();
        shootmeProvider.addSipListener(shootme);
        this.shootme.add(shootme);
      }

      this.proxy = new Proxy(5070, forkCount);
      SipProvider provider = proxy.createSipProvider();
      provider.addSipListener(proxy);
      logger.debug("setup completed");

    } catch (Exception ex) {
      fail("unexpected exception ");
    }
  }
Example #4
0
  public void setUp() {

    try {
      this.transport = "udp";

      super.setUp();

      shootist = new Shootist(getRiProtocolObjects());

      SipProvider shootistProvider = shootist.createSipProvider();
      providerTable.put(shootistProvider, shootist);

      shootme = new Shootme(getTiProtocolObjects());
      SipProvider shootmeProvider = shootme.createSipProvider();
      providerTable.put(shootmeProvider, shootme);
      shootistProvider.addSipListener(this);
      shootmeProvider.addSipListener(this);

      ((SipStackImpl) getTiProtocolObjects().sipStack).setIsBackToBackUserAgent(false);
      ((SipStackImpl) getRiProtocolObjects().sipStack).setIsBackToBackUserAgent(false);

      getRiProtocolObjects().start();
      if (getTiProtocolObjects() != getRiProtocolObjects()) getTiProtocolObjects().start();
    } catch (Exception ex) {
      ex.printStackTrace();
      fail("unexpected exception ");
    }
  }
 public void run() {
   shootme.sendInviteOK();
 }