示例#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;
 }