예제 #1
0
  public void processRequest(RequestEvent requestReceivedEvent) {
    Request request = requestReceivedEvent.getRequest();
    ServerTransaction serverTransactionId = requestReceivedEvent.getServerTransaction();

    System.out.println(
        "\n\nRequest "
            + request.getMethod()
            + " received at "
            + sipStack.getStackName()
            + " with server transaction id "
            + serverTransactionId);

    // We are the UAC so the only request we get is the BYE.
    if (request.getMethod().equals(Request.BYE)) processBye(request, serverTransactionId);
  }
    public void processRequest(RequestEvent requestEvent) {
      Request request = requestEvent.getRequest();
      ServerTransaction serverTransactionId = requestEvent.getServerTransaction();

      System.out.println(
          "\n\nRequest "
              + request.getMethod()
              + " received at "
              + sipStack.getStackName()
              + " with server transaction id "
              + serverTransactionId);

      if (request.getMethod().equals(Request.INVITE)) {
        processInvite(requestEvent, serverTransactionId);
      }
    }
예제 #3
0
  public void processRequest(RequestEvent requestEvent) {
    Request request = requestEvent.getRequest();
    ServerTransaction serverTransactionId = requestEvent.getServerTransaction();

    System.out.println(
        "\n\nRequest "
            + request.getMethod()
            + " received at "
            + sipStack.getStackName()
            + " with server transaction id "
            + serverTransactionId);

    if (request.getMethod().equals(Request.INVITE)) {
      processInvite(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.ACK)) {
      processAck(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.BYE)) {
      processBye(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.CANCEL)) {
      processCancel(requestEvent, serverTransactionId);
    } else {
      try {
        serverTransactionId.sendResponse(messageFactory.createResponse(202, request));

        // send one back
        SipProvider prov = (SipProvider) requestEvent.getSource();
        Request refer = requestEvent.getDialog().createRequest("REFER");
        requestEvent.getDialog().sendRequest(prov.getNewClientTransaction(refer));

      } catch (SipException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (InvalidArgumentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (ParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
  }
    public void processRequest(RequestEvent requestReceivedEvent) {
      Request request = requestReceivedEvent.getRequest();
      ServerTransaction serverTransactionId = requestReceivedEvent.getServerTransaction();

      System.out.println(
          "\n\nRequest "
              + request.getMethod()
              + " received at "
              + sipStack.getStackName()
              + " with server transaction id "
              + serverTransactionId);

      // We are the UAC so the only request we get is the BYE.
      if (request.getMethod().equals(Request.BYE)) processBye(request, serverTransactionId);
      else {
        try {
          serverTransactionId.sendResponse(messageFactory.createResponse(202, request));
        } catch (Exception e) {
          e.printStackTrace();
          fail("Unxepcted exception ");
        }
      }
    }
예제 #5
0
  public void processRequest(RequestEvent requestEvent) {
    Request request = requestEvent.getRequest();
    ServerTransaction serverTransactionId = requestEvent.getServerTransaction();

    System.out.println(
        "\n\nRequest "
            + request.getMethod()
            + " received at "
            + sipStack.getStackName()
            + " with server transaction id "
            + serverTransactionId);

    if (request.getMethod().equals(Request.INVITE)) {
      processInvite(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.ACK)) {
      processAck(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.CANCEL)) {
      processCancel(requestEvent, serverTransactionId);
    } else if (request.getMethod().equals(Request.REGISTER)) {
      processRegister(requestEvent, serverTransactionId);
    } else {
      processInDialogRequest(requestEvent, serverTransactionId);
    }
  }