@Override
  public void fromNetwork(final SipRequestReceivedEvent e, final TransactionListener listener) {

    switch (this.state) {
      case Initial:
        // pass the message on to the app layer.
        this.flowId = e.getFlowId();
        this.setState(State.Trying);
        listener.sendToApp(null, e.getMessage());
        break;
      case Trying:
        break;
      case Proceeding:
      case Completed:
        // always send the response down the same flow as we received it.
        Preconditions.checkNotNull(this.response);
        listener.sendToNetwork(e.getFlowId(), this.response);
        break;
      case Terminated:
        break;
    }
  }