private void doHandleIncomingUpdate(
      Request msg,
      Dialog dialog,
      TransactionType<UpdateSrvTransaction, UpdateServerTransaction> transactionType) {

    dialog.getMessageHistory().addMessage(msg, true);
    SdpMessage sdp = SipMessageUtils.getSdpFromMessage(msg);
    if (sdp != null) {
      dialog.setIncomingSdpMessage(sdp);
    }

    final TransactionManager transactionManager = getTransactionManager();
    transactionManager.addListener(
        new FirstMessageResolver(transactionType.getName(), dialog, msg, transactionManager));

    final UpdateSrvTransaction transaction =
        transactionManager.lookUpTransaction(dialog, null, transactionType);
    runAsynchronously((Transaction<Boolean, BaseSipMessage>) transaction);
  }
  private void doHandleIncomingInvite(
      final Request msg,
      final Dialog dialog,
      final TransactionType<InviteSrvTransaction, ? extends ServerCommonInviteTransaction>
          transactionType) {

    dialog.getMessageHistory().addMessage(msg, true);
    // DIALOG.putCustomParameter(ParamKey.LAST_MESSAGE, msg);
    Logger.log("doHandleIncomingInvite", "");
    SdpMessage sdp = SipMessageUtils.getSdpFromMessage(msg);
    if (sdp != null) {
      dialog.setIncomingSdpMessage(sdp);
    }

    final TransactionManager transactionManager = getTransactionManager();
    transactionManager.addListener(
        new FirstMessageResolver(transactionType.getName(), dialog, msg, transactionManager));

    final InviteSrvTransaction transaction =
        transactionManager.lookUpTransaction(dialog, null, transactionType);
    runAsynchronously((Transaction<Boolean, BaseSipMessage>) transaction);
  }