public void onTransactionCreate(final TransactionBuildUpEvent<BaseSipMessage> event) {
          assert SIP_INVITE_CLIENT == event.getTransaction().getTransactionType();

          Dialog dialog = (Dialog) event.getEntity();
          final Transaction<Boolean, BaseSipMessage> transaction = event.getTransaction();

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(new AuthChallengeListener<BaseSipMessage>(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new MiddleManForClientMessageBuildingSupport<BaseSipMessage>(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogStateMiddleMan<BaseSipMessage>(
                  transaction, dialog, dialogStateListenerHolder));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(new DialogBecomeStatedListener(transaction, dialog));
          transaction.addListener(new RemotePartyAnnouncedListener(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogCleanUpListener<BaseSipMessage>(transaction, dialog, false) {

                protected void onDialogCleanUp(final Dialog dialog) {
                  getStackContext().getDialogStorage().cleanUpDialog(dialog);
                }
              });
        }
        public void onTransactionCreate(final TransactionBuildUpEvent<BaseSipMessage> event) {
          assert SIP_INVITE_SERVER == event.getTransaction().getTransactionType();

          Dialog dialog = (Dialog) event.getEntity();
          final Transaction<Boolean, BaseSipMessage> transaction = event.getTransaction();

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new IncomingInviteListener<BaseSipMessage>(
                  dialog,
                  createSafeInviteAcceptable(dialog),
                  transaction,
                  incomingCallListenerHolder));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new MiddleManForServerMessageBuildingSupport(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogStateMiddleMan<BaseSipMessage>(
                  transaction, dialog, dialogStateListenerHolder));

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(new DialogBecomeStatedListener(transaction, dialog));
          transaction.addListener(new RemotePartyAnnouncedListener(transaction, dialog));

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogCleanUpListener<BaseSipMessage>(transaction, dialog, false) {

                protected void onDialogCleanUp(final Dialog dialog) {
                  getStackContext().getDialogStorage().cleanUpDialog(dialog);
                }
              });
        }
        public void onTransactionCreate(final TransactionBuildUpEvent<BaseSipMessage> event) {
          assert SIP_UPDATE_SERVER == event.getTransaction().getTransactionType();

          Dialog dialog = (Dialog) event.getEntity();
          final Transaction<Boolean, BaseSipMessage> transaction = event.getTransaction();

          // DIALOG.putCustomParameter(Dialog.ParamKey.REINVITE_IN_PROGRESS, Boolean.TRUE);
          // TODo reinvire is used for update too
          // dialog.markReInviteInProgress(InitiateParty.REMOTE);

          // listener will un-subscribe automatically on transaction complete

          transaction.addListener(
              new IncomingReInviteListener<BaseSipMessage>(
                  dialog,
                  createSafeInviteAcceptable(dialog),
                  transaction,
                  incomingCallListenerHolder));

          transaction.addListener(
              new DialogStateMiddleMan<BaseSipMessage>(
                  transaction, dialog, dialogStateListenerHolder));

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new MiddleManForServerMessageBuildingSupport(transaction, dialog));

          transaction.addListener(
              new UpdateInProgressListener<BaseSipMessage>(
                  transaction, dialog, InitiateParty.REMOTE));
        }
        public void onTransactionCreate(final TransactionBuildUpEvent<BaseSipMessage> event) {
          assert SIP_REINVITE_CLIENT == event.getTransaction().getTransactionType();

          Dialog dialog = (Dialog) event.getEntity();
          final Transaction<Boolean, BaseSipMessage> transaction = event.getTransaction();

          // DIALOG.putCustomParameter(Dialog.ParamKey.REINVITE_IN_PROGRESS, Boolean.TRUE);
          dialog.markReInviteInProgress(InitiateParty.LOCAL);

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(new AuthChallengeListener<BaseSipMessage>(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new MiddleManForClientMessageBuildingSupport<BaseSipMessage>(transaction, dialog));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new ReInviteStateMiddleMan<BaseSipMessage>(
                  transaction, dialog, dialogStateListenerHolder) {

                protected void onDialogCleanUp(final Dialog dialog) {
                  getStackContext().getDialogStorage().cleanUpDialog(dialog);
                }
              });
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new ReinviteInProgressListener<BaseSipMessage>(
                  transaction, dialog, InitiateParty.LOCAL));
        }
        public void onTransactionCreate(final TransactionBuildUpEvent<BaseSipMessage> event) {
          assert SIP_BYE_CLIENT == event.getTransaction().getTransactionType();

          Dialog dialog = (Dialog) event.getEntity();
          final Transaction<Boolean, BaseSipMessage> transaction = event.getTransaction();

          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogStateMiddleMan<BaseSipMessage>(
                  transaction, dialog, dialogStateListenerHolder));
          // listener will un-subscribe automatically on transaction complete
          transaction.addListener(
              new DialogCleanUpListener<BaseSipMessage>(transaction, dialog, null) {

                protected void onDialogCleanUp(final Dialog dialog) {
                  getStackContext().getDialogStorage().cleanUpDialog(dialog);
                }
              });
        }