code: public SipTransaction sendReply(SipTransaction transaction, Response response) {
      initErrorInfo();
  
      if ((transaction == null) || (transaction.getServerTransaction() == null)) {
        setErrorMessage("Cannot send reply, transaction information is null");
        setReturnCode(INVALID_ARGUMENT);
        return null;
      }
  
      // send the message
      try {
        SipStack.dumpMessage("Response before sending out through stack", response);
        transaction.getServerTransaction().sendResponse(response);
      } catch (Exception ex) {
        setException(ex);
        setErrorMessage("Exception: " + ex.getClass().getName() + ": " + ex.getMessage());
        setReturnCode(EXCEPTION_ENCOUNTERED);
        return null;
      }
  
      return transaction;
    }
docs: This method sends a stateful response to a previously received request. The returned
  SipTransaction object must be used in any subsequent calls to sendReply() for the same received
  request, if there are any.
  
  @param transaction The SipTransaction object returned from a previous call to sendReply().
  @param response The response to send, as is.
  @return A SipTransaction object that must be passed in to any subsequent call to sendReply()
  for the same received request, or null if an error was encountered while sending the
  response. The calling program doesn't need to do anything with the returned
  SipTransaction other than pass it in to a subsequent call to sendReply() for the same
  received request.