public void update(Dialog dialog) throws DialogStateException {
    assert TransactionUtils.isTransactionExecutionThread()
        : "Code run in wrong thread. Must be run in TransactionThread. Now in "
            + Thread.currentThread();
    assert !done.get();
    assert getStackContext().getDialogStorage().findDialogByCallId(dialog.getCallId()) != null
        : "DIALOG being updated is already  terminated";

    if (!done.get()) {

      checkUpdatePreconditions(dialog, null);
      dialog
          .getOutgoingSdpMessage()
          .setSessionVersion(dialog.getOutgoingSdpMessage().getSessionVersion() + 1);
      doUpdate(dialog);
    }
  }
  public void reInvite(final Dialog dialog) throws DialogStateException {
    Logger.log(TAG, "reInvite#started");
    assert TransactionUtils.isTransactionExecutionThread()
        : "Code run in wrong thread. Must be run in TransactionThread. Now in "
            + Thread.currentThread();
    assert !done.get();
    assert getStackContext().getDialogStorage().findDialogByCallId(dialog.getCallId()) != null
        : "DIALOG being re-invited is already  terminated";

    if (!done.get()) {

      checkReInvitePreconditions(dialog, null);
      dialog
          .getOutgoingSdpMessage()
          .setSessionVersion(dialog.getOutgoingSdpMessage().getSessionVersion() + 1);
      doReInvite(dialog, LONG_TRANSACTION_TIMEOUT);
    }
    Logger.log(TAG, "reInvite#finished");
  }