private void StartMusicOnHoldPlayback(object sender, AudioVideoFlowConfigurationRequestedEventArgs args) { _mohServer._mohPlayer.AttachFlow(args.Flow); _mohServer._mohPlayer.StateChanged += this.OnPlayerStateChanged; _mohServer._mohFileSource.BeginPrepareSource( MediaSourceOpenMode.Buffered, ar => { WmaFileSource fileSource = ar.AsyncState as WmaFileSource; try { fileSource.EndPrepareSource(ar); _mohServer._mohPlayer.Start(); } catch (OperationFailureException ex) { _mohServer.BeginShutDown( sar => { AcdMusicOnHoldServer mohServer = sar.AsyncState as AcdMusicOnHoldServer; mohServer.EndShutDown(sar); }, _mohServer); this.SetAsCompleted(ex, false); } }, _mohServer._mohFileSource); }
private void NewAttendeeCall_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { // Attach a Wma file player to the flow. It will be used to play // back a WMA file to the participant matching the detected DTMF // digit that the user pressed in the ToneReceived EventHandler. Player wmaFilePlayer = new Player(); wmaFilePlayer.StateChanged += new EventHandler <PlayerStateChangedEventArgs>( WmaFilePlayer_StateChanged); var currentAvFlow = ((AudioVideoCall)sender).Flow; wmaFilePlayer.AttachFlow(currentAvFlow); ToneController currentToneController = new ToneController(); // Add a handler for the tonereceived event so that the app can play // a wave file back to the user echoing the digit received.ss currentToneController.ToneReceived += new EventHandler < ToneControllerEventArgs>(ToneController_ToneReceived); // Attach the flow to the tone controller. currentToneController.AttachFlow(currentAvFlow); }
// Handler for the AudioVideoFlowConfigurationRequested event on the call. // This event is raised when there is a //flow present to begin media operations with, and that it is no longer null. public void AudioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { audioVideoFlow = e.Flow; audioVideoFlow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(AudioVideoFlow_StateChanged); }
//Flow created indicates that there is a flow present to begin media operations with, and that it is no longer null. public void audioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { Console.WriteLine("Flow Created."); _audioVideoFlow = e.Flow; // Now that the flow is non-null, bind the event handler for State Changed. // When the flow goes active, (as indicated by the state changed event) the program can choose to take media-related actions on the flow. _audioVideoFlow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(audioVideoFlow_StateChanged); }
private void OnAudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { this.LockAndExecuteOotyCallback(delegate { this.DebugTrace("Inside BaseUMconnectivityTester OnAudioVideoFlowConfigurationRequested", new object[0]); AudioVideoFlowTemplate audioVideoFlowTemplate = new AudioVideoFlowTemplate(e.Flow); audioVideoFlowTemplate.EncryptionPolicy = (this.mediaSecured ? 3 : 1); e.Flow.Initialize(audioVideoFlowTemplate); e.Flow.StateChanged += this.OnMediaStateChanged; }); }
//Flow configuration requested indicates that there is a flow present to begin media operations with that it is no longer null, and is ready to be configured. public void audioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { // Change the default behavior before the negotiation is completed // Create a template based on the current AudioVideoFlow AudioVideoFlowTemplate template = new AudioVideoFlowTemplate(e.Flow); // Accept only 8Khz audio sampling rate codecs template.Audio.GetChannels()[ChannelLabel.AudioMono].AllowedDirection = MediaChannelDirection.Inactive; Console.WriteLine("AudioVideoFlow initialized as Inactive."); // Change _audioVideoFlow settings according to the template e.Flow.Initialize(template); }
//Flow configuration requested indicates that there is a flow present to begin media operations with that it is no longer null, and is ready to be configured. public void audioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { Console.WriteLine("Flow Configuration Requested."); _audioVideoFlow = e.Flow; //Now that the flow is non-null, bind the event handler for State Changed. // When the flow goes active, (as indicated by the state changed event) the program will perform media related actions.. _audioVideoFlow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(audioVideoFlow_StateChanged); // call sample event handler if (_audioVideoFlowConfigurationRequestedEventHandler != null) { _audioVideoFlowConfigurationRequestedEventHandler(sender, e); } }
//Flow configuration requested indicates that there is a flow present to begin media operations with that it is no longer null, and is ready to be configured. public void AudioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { NonBlockingConsole.WriteLine("AV Flow Configuration Requested."); _audioVideoFlow = e.Flow; Message m = new Message("AV Flow Configuration Requested.", MessageType.Audio, _transcriptRecorder.Conversation.Id); _transcriptRecorder.OnMessageReceived(m); //Now that the flow is non-null, bind the event handler for State Changed. // When the flow goes active, (as indicated by the state changed event) the program will perform media related actions.. _audioVideoFlow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(AudioVideoFlow_StateChanged); // call top level event handler if (_audioVideoFlowConfigurationRequestedEventHandler != null) { _audioVideoFlowConfigurationRequestedEventHandler(sender, e); } }
static void Call_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { Console.WriteLine("flow config requested"); e.Flow.StateChanged += Flow_StateChanged; }
void _avCall_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { Log("AudioVideoFlowConfigurationRequested"); e.Flow.StateChanged += new EventHandler<MediaFlowStateChangedEventArgs>(Flow_StateChanged); }
//Flow configuration requested indicates that there is a flow present to begin media operations with that it is no longer null, and is ready to be configured. public void AudioVideoCall_FlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { NonBlockingConsole.WriteLine("AV Flow Configuration Requested."); _audioVideoFlow = e.Flow; Message m = new Message("AV Flow Configuration Requested.", MessageType.Audio, _transcriptRecorder.Conversation.Id); _transcriptRecorder.OnMessageReceived(m); //Now that the flow is non-null, bind the event handler for State Changed. // When the flow goes active, (as indicated by the state changed event) the program will perform media related actions.. _audioVideoFlow.StateChanged += new EventHandler<MediaFlowStateChangedEventArgs>(AudioVideoFlow_StateChanged); // call top level event handler if (_audioVideoFlowConfigurationRequestedEventHandler != null) { _audioVideoFlowConfigurationRequestedEventHandler(sender, e); } }
static void Call_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { e.Flow.StateChanged +=Flow_StateChanged; }
void _controlAVCall_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { Log("ControlAVCall AudioVideoFlowConfigurationRequested"); e.Flow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(Flow_StateChanged); }
static void Call_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { e.Flow.StateChanged += Flow_StateChanged; }
/// <summary> /// Handle the AudioVideoFlowConfigurationRequested event /// </summary> /// <param name="sender">sender</param> /// <param name="e">AudioVideoFlowConfigurationRequestedEventArgs</param> private void Call_AudioVideoFlowConfigurationRequested(object sender, AudioVideoFlowConfigurationRequestedEventArgs e) { currentCall.Flow.StateChanged += new EventHandler <MediaFlowStateChangedEventArgs>(Flow_StateChanged); }