Пример #1
0
  private void sendInviteOK(RequestEvent requestEvent, ServerTransaction inviteTid) {
    try {
      logger.info("sendInviteOK: " + inviteTid);
      if (inviteTid.getState() != TransactionState.COMPLETED) {
        logger.info("shootme: Dialog state before OK: " + inviteTid.getDialog().getState());

        SipProvider sipProvider = (SipProvider) requestEvent.getSource();
        Request request = requestEvent.getRequest();
        Response okResponse = protocolObjects.messageFactory.createResponse(Response.OK, request);
        ListeningPoint lp = sipProvider.getListeningPoint(protocolObjects.transport);
        int myPort = lp.getPort();

        Address address =
            protocolObjects.addressFactory.createAddress(
                "Shootme <sip:" + myAddress + ":" + myPort + ">");
        ContactHeader contactHeader = protocolObjects.headerFactory.createContactHeader(address);
        okResponse.addHeader(contactHeader);
        inviteTid.sendResponse(okResponse);
        logger.info("shootme: Dialog state after OK: " + inviteTid.getDialog().getState());
        TestHarness.assertEquals(DialogState.CONFIRMED, inviteTid.getDialog().getState());
      } else {
        logger.info("semdInviteOK: inviteTid = " + inviteTid + " state = " + inviteTid.getState());
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
Пример #2
0
  public SipProvider createProvider() {
    try {

      ListeningPoint lp =
          protocolObjects.sipStack.createListeningPoint(
              myAddress, myPort, protocolObjects.transport);

      sipProvider = protocolObjects.sipStack.createSipProvider(lp);
      logger.info("provider " + sipProvider);
      logger.info("sipStack = " + protocolObjects.sipStack);
      return sipProvider;
    } catch (Exception ex) {
      logger.error(ex);
      TestHarness.fail(unexpectedException);
      return null;
    }
  }
Пример #3
0
  public void checkState() {
    TestHarness.assertTrue("Should see invite", inviteSeen);

    TestHarness.assertTrue("Should see either an ACK or a BYE, or both", byeSeen || ackSeen);
  }