public float CalculateSessionCost(Session session)
        {
            if (!session.CallAccepted) return 0;

            var rate = session.Rate;
            var duration = session.EndCalling.Subtract(session.StartCalling);

            var cost = rate.CalculateCost(duration);
            return cost;
        }
        private void OnTerminalCalling(object sender, CallingRequest e)
        {
            var sourceTerminal = sender as ClientTerminal;
            if (sourceTerminal == null) return;

            var sourceClient = BillingSystem.Contracts.First(c => c.Terminal == sourceTerminal);
            var sourceTelephoneNumber = sourceClient.TelephoneNumber;
            var incommingRequest = new InCommingRequest(sourceTelephoneNumber);

            var clients = BillingSystem.Contracts.Where(c => c.TelephoneNumber == e.Target);
            // Target number doesn't exist
            if (!clients.Any())
            {
                sourceTerminal.ReceiveResponce(ResponceState.DoesNotExist);
                return;
            }

            var targetClient = clients.First();
            var session = new Session(sourceClient, targetClient, sourceClient.Rate);
            var systemTime = DateTime.Now;
            var currentTime = new DateTime(BillingSystem.CurrentTime.Year, BillingSystem.CurrentTime.Month, systemTime.Day, systemTime.Hour, systemTime.Minute, systemTime.Second);
            var connEvent = new ConnectionEvent(targetClient, ConnectionEventType.Accepted, currentTime);
            session.Events.Add(connEvent);

            var targetPort = _terminalToPertConnections.First(c => c.Terminal == targetClient.Terminal).Port;
            switch (targetPort.State)
            {
                case ConnectionState.Free:
                    {
                        sourceTerminal.ReceiveResponce(ResponceState.Calling);
                        CurrentSessions.Add(session);

                        targetClient.Terminal.IncomingRequestFrom(incommingRequest);
                        break;
                    }
                case ConnectionState.Busy:
                    {
                        sourceTerminal.ReceiveResponce(ResponceState.IsBusy);
                        BillingSystem.SessionHistory.Add(session);
                        break;
                    }
                case ConnectionState.UnConnected:
                    {
                        sourceTerminal.ReceiveResponce(ResponceState.UnConnected);
                        BillingSystem.SessionHistory.Add(session);
                        break;
                    }
            }
        }