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 PlayMenu(string menuName) { string vxmlURL = Path.Combine(vxmlDirectory, menuName.Trim().Replace(" ", "_") + ".vxml"); Uri pageURI = new Uri(vxmlURL); Console.WriteLine("Browser state: " + voiceXmlBrowser.State.ToString()); voiceXmlBrowser.RunAsync(pageURI, null); }