public SipInviteServerDialog(
             ISipTransaction transaction, 
             SipDialogTable dialogTable,
             ITimerFactory timerFactory,
             SipHeaderFactory headerFactory,
             SipMessageFactory messageFactory,
             SipAddressFactory addressFactory,
             ISipMessageSender messageSender,
             ISipListener listener,
            IPEndPoint listeningPoint)
            : base(headerFactory, messageFactory, addressFactory, messageSender, listener, listeningPoint, transaction)
        {
            Check.Require(transaction, "transaction");
            Check.Require(dialogTable, "dialogTable");
            Check.Require(timerFactory, "timerFactory");

            _logger = NLog.LogManager.GetCurrentClassLogger();

            _dialogTable = dialogTable;
            _state = DialogState.Null;
            _timerFactory = timerFactory;

            //(only ?) localtag is set on firstresponse
            //localtarget is not defined, because is has no use, (every user agent knows it local address)

            _retransmitOkTimer = _timerFactory.CreateInviteCtxRetransmitTimer(OnOkReTransmit);
            //_endWaitForAckTimer = _timerFactory.CreateInviteCtxTimeOutTimer(OnWaitForAckTimeOut);

            if (_logger.IsInfoEnabled) _logger.Info("ServerDialog[Id={0}] created.", GetId());
        }
        public SipInviteServerDialog(
            ISipTransaction transaction,
            SipDialogTable dialogTable,
            ITimerFactory timerFactory,
            SipHeaderFactory headerFactory,
            SipMessageFactory messageFactory,
            SipAddressFactory addressFactory,
            ISipMessageSender messageSender,
            ISipListener listener,
            IPEndPoint listeningPoint)
            : base(headerFactory, messageFactory, addressFactory, messageSender, listener, listeningPoint, transaction)
        {
            Check.Require(transaction, "transaction");
            Check.Require(dialogTable, "dialogTable");
            Check.Require(timerFactory, "timerFactory");

            _logger = NLog.LogManager.GetCurrentClassLogger();

            _dialogTable  = dialogTable;
            _state        = DialogState.Null;
            _timerFactory = timerFactory;

            //(only ?) localtag is set on firstresponse
            //localtarget is not defined, because is has no use, (every user agent knows it local address)

            _retransmitOkTimer = _timerFactory.CreateInviteCtxRetransmitTimer(OnOkReTransmit);
            //_endWaitForAckTimer = _timerFactory.CreateInviteCtxTimeOutTimer(OnWaitForAckTimeOut);

            if (_logger.IsInfoEnabled)
            {
                _logger.Info("ServerDialog[Id={0}] created.", GetId());
            }
        }
        internal SipInviteClientTransaction(
            SipClientTransactionTable table,
            ISipMessageSender messageSender,
            ISipListener listener,
            SipRequest request,
            ITimerFactory timerFactory,
            SipHeaderFactory headerFactory,
            SipMessageFactory messageFactory)
            : base(table, request, messageSender, listener, timerFactory)
        {
            Check.Require(headerFactory, "headerFactory");
            Check.Require(messageFactory, "messageFactory");

            Check.IsTrue(request.RequestLine.Method == SipMethods.Invite, "Method other then 'INVITE' is not allowed");

            _logger = NLog.LogManager.GetCurrentClassLogger();

            _headerFactory  = headerFactory;
            _messageFactory = messageFactory;

            ReTransmitTimer   = timerFactory.CreateInviteCtxRetransmitTimer(OnReTransmit);
            TimeOutTimer      = timerFactory.CreateInviteCtxTimeOutTimer(OnTimeOut);
            EndCompletedTimer = timerFactory.CreateInviteCtxEndCompletedTimer(OnCompletedEnded);
        }
        internal SipInviteClientTransaction(
            SipClientTransactionTable table,
            ISipMessageSender messageSender,
            ISipListener listener, 
            SipRequest request, 
            ITimerFactory timerFactory, 
            SipHeaderFactory headerFactory,
            SipMessageFactory messageFactory)
            : base(table, request, messageSender, listener, timerFactory)
        {
            Check.Require(headerFactory, "headerFactory");
            Check.Require(messageFactory, "messageFactory");

            Check.IsTrue(request.RequestLine.Method == SipMethods.Invite, "Method other then 'INVITE' is not allowed");

            _logger = NLog.LogManager.GetCurrentClassLogger();

            _headerFactory = headerFactory;
            _messageFactory = messageFactory;

            ReTransmitTimer = timerFactory.CreateInviteCtxRetransmitTimer(OnReTransmit);
            TimeOutTimer = timerFactory.CreateInviteCtxTimeOutTimer(OnTimeOut);
            EndCompletedTimer = timerFactory.CreateInviteCtxEndCompletedTimer(OnCompletedEnded);
        }