Beispiel #1
0
 private async Task EndAllCalls()
 {
     foreach (var line in ConnectedLines.Where(c => c.Value.CallState.CallCanBeAbandoned))
     {
         line.Value.Hangup();
     }
     foreach (var line in ConnectedLines.Where(c => !c.Value.CallState.CallCanBeAbandoned))
     {
         while (!line.Value.CallState.CallCanBeAbandoned)
         {
             await Task.Delay(1000);
         }
         line.Value.Hangup();
     }
 }
Beispiel #2
0
 private async Task EndAllCallsAsync()
 {
     foreach (var line in ConnectedLines.Where(c => c.Value.CallState.CallCanBeAbandoned))
     {
         await line.Value.HangupAsync();
     }
     foreach (var line in ConnectedLines.Where(c => !c.Value.CallState.CallCanBeAbandoned))
     {
         while (!line.Value.CallState.CallCanBeAbandoned)
         {
             await Task.Delay(1000, _cancellationToken);
         }
         await line.Value.HangupAsync();
     }
 }