internal override bool Execute(LocalTUILogonConnectivityTester umConn) { umConn.DebugTrace("Inside SendDigits Execute()", new object[0]); if (umConn.IsCallGone()) { umConn.Error = new TUC_RemoteEndDisconnected(); return(false); } if (string.IsNullOrEmpty(this.digitsToSend)) { return(true); } bool result; try { foreach (char c in this.digitsToSend) { umConn.DebugTrace("Inside SendDigits , sending digit {0}", new object[] { c }); if (!umConn.SendDTMFTone(c)) { return(false); } Thread.Sleep(500); } result = true; } catch (Exception ex) { if (!(ex is RealTimeException) && !(ex is InvalidOperationException)) { throw; } umConn.Error = new TUC_SendSequenceError(ex.Message, ex); umConn.ErrorTrace("Inside SendDigits Execute, error ={0}", new object[] { ex }); result = false; } return(result); }
internal abstract bool Execute(LocalTUILogonConnectivityTester umConn);
internal override bool Execute(LocalTUILogonConnectivityTester umConnection) { this.umConn = umConnection; this.umConn.DebugTrace("Inside WaitForState Execute()", new object[0]); if (this.umConn.IsCallGone()) { this.umConn.Error = new TUC_RemoteEndDisconnected(); return(false); } if (this.state == null) { return(true); } if (this.secsTimeout <= 0.0) { this.umConn.Error = new TUC_OperationTimedOutInTestUMConnectivityTask(this.stateName, this.secsTimeout.ToString(CultureInfo.InvariantCulture)); return(false); } ManualResetEvent[] waitHandles = new ManualResetEvent[] { this.umConn.CallEndedEvent, this.umConn.SIPMessageQueuedEvent }; double num = this.secsTimeout * 1000.0; bool flag = false; bool flag2 = false; while (!flag && !flag2 && num > 0.0) { ExDateTime utcNow = ExDateTime.UtcNow; int num2 = WaitHandle.WaitAny(waitHandles, TimeSpan.FromMilliseconds(num), false); num -= ExDateTime.UtcNow.Subtract(utcNow).TotalMilliseconds; int num3 = num2; switch (num3) { case 0: this.umConn.Error = new TUC_RemoteEndDisconnected(); flag = true; break; case 1: switch (this.GotMyExpectedMessage(this.state, this.isPreemptable, this.statesToExclude)) { case ScenarioTestingHelperMethods.WaitForStates.MatchedState.Expected: this.umConn.DebugTrace("Inside WaitForState Got one of the expected states", new object[0]); flag2 = true; break; case ScenarioTestingHelperMethods.WaitForStates.MatchedState.Excluded: this.umConn.Error = new TUC_OperationFailed(this.errorMesg); flag = true; break; default: if (num <= 0.0) { this.umConn.Error = new TUC_OperationTimedOutInTestUMConnectivityTask(this.stateName, this.secsTimeout.ToString(CultureInfo.InvariantCulture)); flag = true; } else { flag = false; } break; } break; default: if (num3 == 258) { this.umConn.Error = new TUC_OperationTimedOutInTestUMConnectivityTask(this.stateName, this.secsTimeout.ToString(CultureInfo.InvariantCulture)); flag = true; } else { this.umConn.Error = new TUC_OperationTimedOutInTestUMConnectivityTask(this.stateName, this.secsTimeout.ToString(CultureInfo.InvariantCulture)); flag = true; } break; } } return(flag2); }