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); } }
protected virtual void OnPreparedCallInfo(object sender, CallInfo info) { if (PreparedCallInfo != null) PreparedCallInfo(sender, new CallInfoEventArgs(info)); }
protected void MakeCallActive(CallInfo info) { this.m_connectionCollection.Remove(info); info.Started = DateTime.Now; this.m_callCollection.Add(info); }
protected void InterruptConnection(CallInfo info) { this.m_connectionCollection.Remove(info); SetPortStateAfterConnectionInterrupted(info.Source, info.Target); OnPreparedCallInfo(this, info); }
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; }