public void Run() { // Create and establish the endpoint, using the credentials of the user the application will be acting as. _helper = new UCMASampleHelper(); _userEndpoint = _helper.CreateEstablishedUserEndpoint("VoiceXML Sample User" /*endpointFriendlyName*/); _userEndpoint.RegisterForIncomingCall <AudioVideoCall>(inboundAVCall_CallReceived); // Pause the main thread until a call is received and then accepted. _waitForCallReceived.WaitOne(); _waitForCallAccepted.WaitOne(); InitializeVoiceXmlBrowser(); _voiceXmlBrowser.SetAudioVideoCall(_audioVideoCall); Uri startPageURI = new Uri(startPageURL); Console.WriteLine("Browser state: " + _voiceXmlBrowser.State.ToString()); _voiceXmlBrowser.RunAsync(startPageURI, null); _waitForSessionCompleted.WaitOne(); _collabPlatform = _conversation.Endpoint.Platform; // Terminate the call. _audioVideoCall.BeginTerminate(CallTerminateCB, _audioVideoCall); _waitForPlatformShutdownCompleted.WaitOne(); // Pause the console to allow the user to view logs. Console.WriteLine("Press any key to end the sample."); Console.ReadKey(); }
private void InitializeVoiceXmlBrowser() { voiceXmlBrowser = new Microsoft.Rtc.Collaboration.AudioVideo.VoiceXml.Browser(); voiceXmlBrowser.Disconnecting += new EventHandler <DisconnectingEventArgs>(HandleDisconnecting); voiceXmlBrowser.Disconnected += new EventHandler <DisconnectedEventArgs>(HandleDisconnected); voiceXmlBrowser.SessionCompleted += new EventHandler <SessionCompletedEventArgs>(HandleSessionCompleted); voiceXmlBrowser.SetAudioVideoCall(audioVideoCall); }