public void AnswerCall(object sender, AnsweredCallEvent e) { OnNotifyStationOfAnsweredOfCall(new AnsweredCallEvent(PhoneNumber) { CallStartTime = e.CallStartTime }); }
public void AnswerCall(object sender, AnsweredCallEvent e) { if (!(sender is IPort receiverPort)) { return; } var senderPort = CallsWaitingToBeAnswered.FirstOrDefault(x => x.Value == receiverPort).Key; if (senderPort == null) { return; } DisposeTimer(senderPort); // dispose timer because call was answered CallsWaitingToBeAnswered.Remove(senderPort); // remove information about call from this specified list CallsInProgress.Add(new HeldCallEvent(senderPort.PhoneNumber, receiverPort.PhoneNumber) { CallStartTime = e.CallStartTime }); // Logger.WriteLine($"{receiverPort.PhoneNumber} answered call from {senderPort.PhoneNumber}"); }
private void OnNotifyStationOfAnsweredOfCall(AnsweredCallEvent e) { NotifyStationOfAnsweredCall?.Invoke(this, e); }
private void OnNotifyPortAboutAnsweredCall(AnsweredCallEvent e) { NotifyPortAboutAnsweredCall?.Invoke(this, e); }