360 likes | 794 Views
Upgrading your Applications to UCMA 4.0. Session Objectives. What’s new in UCMA 4.0 Writing asynchronous code using Async CTP Building workflow solutions with UCMA . Agenda. Overview. What’s new in UCMA 4.0. Async CTP. Replacing UCMA Workflow. Upgrading your Applications to UCMA 4.0.
E N D
Session Objectives • What’s new in UCMA 4.0 • Writing asynchronous code using Async CTP • Building workflow solutions with UCMA
Agenda Overview What’s new in UCMA 4.0 Async CTP Replacing UCMA Workflow Upgrading your Applications to UCMA 4.0
Unified Communications Managed API • Build communications solutions • Help Desk / Call Center / Contact Center • Server assisted communications • IVRs / virtual personal assistants • Conferencing • Notification systems • Web chat
UCMA 3.0 Highlights Conferencing • Conference scheduling and management • Conference join and lobby experience • Back-to-back calls • Trusted participant Audio Routes • Full control of media routing between participant endpoints • Enables advanced communications scenarios • Supervisor monitor • Supervisor whisper • Supervisor barge-in Context Channel • Communication channel between UCMA app and Silverlight extensibility app • Launch with initial context • Send and receive context data • Can replace WCF-based communication mechanism Management PowerShell cmdlets to create and manage UCMA trusted applications and endpoints. Autoprovisioning Application settings replicated to trusted application pools. Very easy UCMA application startup code. Quality and Resiliency Guarantee quality of service using new server role. KPIs for health indicators. DNS load balancing.
Agenda Overview What’s new in UCMA 4.0 Async CTP Replacing UCMA Workflow Upgrading your Applications to UCMA 4.0
Platform Investments • Lots of investment in new features in 2.0 and 3.0 • Deployment • Performance • Web and mobile optimizations
The Rise of the Cloud, Mobility, and the Real-Time Web 2010 2011 2013 2012 Microsoft Office 2013 Cumulative Update 4
Speech Speech in UCMA • Upgraded to use Speech 11 • More TTS voices • 16KHz audio for most TTS voices • VXML SDK will work with Speech 11
Setup and Development Setup • Support for silent runtime installs Development • .NET 4 Support for Async Task Framework
UCMA Workflow SDK Support • UCMA Workflow SDK will not ship in Lync 2013 • Support existing applications in a co-existence environment • UCMA Workflow SDK 3.0 application running Lync 2010 server • Users honed on Lync 2013 server • Users able to connect to legacy application Guidance • Build using UCMA core • Leverage VXML
Agenda Overview What’s new in UCMA 4.0 Async CTP Replacing UCMA Workflow Upgrading your Applications to UCMA 4.0
Programming with Async CTP • IAsyncResult pattern is verbose and hard to follow • Easier syntax for writing asynchronous code • Add-on for .NET 4.0 • Go-live license available • Native in .NET 4.5
Starting a Collaboration Platform – IAsyncResult • try • { • _platform.BeginStartup(startupAsyncResult => • { • try • { • _platform.EndStartup(startupAsyncResult); • Console.WriteLine("Started platform."); • EstablishEndpoint(); • } • catch (RealTimeException ex) • { • throw(ex); • } • }, • null); • } • catch (InvalidOperationException ex) • { • throw(ex); • }
Starting a Collaboration Platform – Async • varplatformSettings = new ProvisionedApplicationPlatformSettings(_applicationName, _applicationId); • _platform = new CollaborationPlatform(platformSettings); • await _platform.StartUpAsync(); • Console.WriteLine("Platform started."); • varendpointSettings = new ApplicationEndpointSettings(_applicationEndpointURI, _lyncServer, _lyncServerPort); • _endpoint = new ApplicationEndpoint(_platform, endpointSettings); • await _endpoint.EstablishAsync(); • Console.WriteLine(“Application Endpoint established.");
Creating Async Tasks Extension Methods • Create Task that represents pair of BeginX and EndX methods • Specify Begin operation • Specify End operation • Set parameters • Set asynchronous state
Creating an Async Task – Start Collaboration Platform • using System.Threading.Tasks; • … • public static Task StartUpAsync(this CollaborationPlatform platform) • { • if (platform == null) • { • throw new ArgumentNullException(); • } • return Task.Factory.FromAsync(platform.BeginStartup, platform.EndStartup, null); • } • … • await _platform.StartUpAsync();
Creating an Async Task – Establish Instant Message Call • public static Task<CallMessageData> EstablishAsync( • this Call call, • string destinationUri, • CallEstablishOptionsoptions) • { • if (call == null) • { • throw new ArgumentNullException(); • } • return Task<CallMessageData>.Factory.FromAsync( • call.BeginEstablish, • call.EndEstablish, • destinationUri, • options, • null); • }
Exception Handling • try • { • await _platform.StartupAsync(); • } • catch (InvalidOperationException ex) • { • Console.WriteLine(ex;) • } • catch (RealTimeException ex) • { • Console.WriteLine(ex;) • }
Developing with Async Scenarios • Run Tasks in sequence • Run Tasks in parallel • WhenAll Tasks complete • WhenAny Tasks complete
Agenda Overview Topic 1 Async CTP Replacing UCMA Workflow Upgrading your Applications to UCMA 4.0
UCMA Workflow SDK Positives • Easy to develop with • Visual design surface • Handles underlying plumbing Negatives • Media is expensive • Scalability • Have to write straight UCMA code often
Speech Synthesis • varsynthConnector = new SpeechSynthesisConnector(); • PhoneMenuCallController.SpeechSynthesizer = new SpeechSynthesizer(); • var format = • new SpeechAudioFormatInfo( • 16000, • AudioBitsPerSample.Sixteen, • Microsoft.Speech.AudioFormat.AudioChannel.Mono); • PhoneMenuCallController.SpeechSynthesizer.SetOutputToAudioStream(synthConnector.Stream, format); • synthConnector.AttachFlow(PhoneMenuCallController.AVCall.Flow); • synthConnector.Start(); • … • PhoneMenuCallController.SpeechSynthesizer.SpeakAsync( • "Thank you for calling the phone menu sample app! " • + "Press 1 to speak to an agent, or 2 to repeat this menu.");
Handling Tones • PhoneMenuCallController.ToneController.ToneReceived • += new EventHandler<ToneControllerEventArgs>(ToneController_ToneReceived); • … • void ToneController_ToneReceived(object sender, ToneControllerEventArgs e) • { • PhoneMenuCallController.SpeechSynthesizer.SpeakAsyncCancelAll(); • if (e.Tone == 1) • { • // do something • } • }
Agenda Overview What’s new in UCMA 4.0 Async CTP Replacing UCMA Workflow Upgrading your Applications to UCMA 4.0
Key takeaways • Platform investments in web, deployment, and performance • Writing asynchronous code using Async CTP • Replacing UCMA Workflow SDK applications
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Building Blocks Unified Communications Web API VoiceXML UCMA 4.0 Core API UCMA Server Speech API Media Stack Microsoft.Speech SIP Layer Lync Server 2010 Infrastructure