protected override void HandleToneReceived(ToneControllerEventArgs e) { if (!this.notInterestedInDtmf) { if (!this.anyDTMFsReceived) { this.anyDTMFsReceived = true; this.firstDtmfEvent.Set(); } if (this.runningInMOMMode) { this.notInterestedInDtmf = true; this.dtmfRecvdEvent.Set(); return; } if (e.Tone >= 0 && e.Tone <= 15) { this.HandleTheReceivedDTMF(e.Tone); return; } base.DebugTrace("Received a bad tone :{0}", new object[] { e.Tone }); } }
private void ToneController_ToneReceived(object sender, ToneControllerEventArgs e) { Console.WriteLine("Detected tone {0}, from the user with uri={1}.", e.Tone, _trustedParticipantCallIDToParticipantUriStore[((ToneController)sender).AudioVideoFlow.Call .CallId]); string wmaFileName = string.Empty; if (0 <= e.Tone && 9 >= e.Tone) { //retrieve the name of the wma file from the config file. wmaFileName = ConfigurationManager.AppSettings[string.Format("DTMF{0}WmaFile", e.Tone)]; } else { if (e.Tone == (int)ToneId.Pound) { wmaFileName = ConfigurationManager.AppSettings["DTMFPoundWmaFile"]; } if (e.Tone == (int)ToneId.Star) { wmaFileName = ConfigurationManager.AppSettings["DTMFStarWmaFile"]; } } // Play the message to the user corresponding to the detected // keypress. PlayWmaFileAudio((sender as ToneController).AudioVideoFlow, wmaFileName); }
private void OnToneReceived(object sender, ToneControllerEventArgs e) { this.LockAndExecuteOotyCallback(delegate { this.DebugTrace("Inside BaseUMconnectivityTester OnToneReceived", new object[0]); this.HandleToneReceived(e); }); }
// Callback that handles when a tone is received void toneController_ToneReceived(object sender, ToneControllerEventArgs e) { Console.WriteLine("Tone Received: " + (ToneId)e.Tone + " (" + e.Tone + ")"); if ((ToneId)e.Tone == ToneId.Tone0) { _waitForToneReceivedEventCompleted.Set(); } else { ToneController tc = (ToneController)sender; tc.Send(e.Tone); } }
private async void toneController_ToneReceived(object sender, ToneControllerEventArgs e) { _speechSynthesizer.SpeakAsyncCancelAll(); ContinuousMusicPlayer.Instance._player.DetachFlow(_flow); switch (e.Tone) { case 1: _speechSynthesizer.Speak(string.Format("It's {0} on {1}", DateTime.Now.ToShortTimeString(), DateTime.Now.ToLongDateString())); SpeakMenuOptions(); break; case 2: _speechSynthesizer.Speak("Joining conference."); _speechSynthesisConnector.DetachFlow(); await _server.AddCallerToConference(_flow.Call); break; case 3: ContinuousMusicPlayer.Instance._player.AttachFlow(_flow); break; } }
protected virtual void HandleToneReceived(ToneControllerEventArgs e) { }