code: private void transition(final CallState nextState, final SipPacket msg) {
          final CallState previousState = this.currentState;
          this.currentState = nextState;
          if (previousState != nextState) {
              // don't add the same transition twice
              this.callTransitions.add(nextState);
          }
          if (logger.isInfoEnabled()) {
              logger.info("[{}] {} -> {} Event: {}", this.callId, previousState, this.currentState, msg.getInitialLine());
          }
      }
docs: Helper method for doing transitions.
  
  @param nextState
  @param msg