Пример #1
0
        protected void RigesterOutgoingRequest(OutgoingRequest request)
        {
            if (CheckOnCorrectness(request.Source, request.Target) &&
                GetCallInfo(request.Source) == null && GetConnectionInfo(request.Source) == null)
            {
                CallInfo info = new CallInfo(request.Source, request.Target, DateTime.Now);

                ITerminal targetTerminal = GetTerminalByNumber(request.Target);
                IPort targetPort = GetPortByNumber(request.Target);

                if (targetPort.State == PortState.Free)
                {
                    this.m_connectionCollection.Add(info);

                    targetPort.State = PortState.Busy;
                    targetTerminal.IncomingRequestFrom(request.Source);
                }
                else
                    OnPreparedCallInfo(this, info);
            }
        }
Пример #2
0
 protected virtual void OnPreparedCallInfo(object sender, CallInfo info)
 {
     if (PreparedCallInfo != null)
         PreparedCallInfo(sender, new CallInfoEventArgs(info));
 }
Пример #3
0
 protected void MakeCallActive(CallInfo info)
 {
     this.m_connectionCollection.Remove(info);
     info.Started = DateTime.Now;
     this.m_callCollection.Add(info);
 }
Пример #4
0
        protected void InterruptConnection(CallInfo info)
        {
            this.m_connectionCollection.Remove(info);
            SetPortStateAfterConnectionInterrupted(info.Source, info.Target);

            OnPreparedCallInfo(this, info);
        }
Пример #5
0
        protected void InterruptActiveCall(CallInfo info)
        {
            info.Duration = DateTime.Now - info.Started;
            this.m_callCollection.Remove(info);

            SetPortStateAfterConnectionInterrupted(info.Source, info.Target);
            OnPreparedCallInfo(this, info);
        }
 public CallInfoEventArgs(CallInfo args)
 {
     this.m_callInfo = args;
 }