Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/14/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks.

Similar presentations


Presentation on theme: "4/14/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks."— Presentation transcript:

1 4/14/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

2 Lync Conference 2013 4/14/2017 OFC-B413 The Lync Developer platform– how to use logging and other tools to troubleshoot Or about how to find the monkey in the lab…. Ganesh Sridharan Senior Development Lead Microsoft Corporation Albert Kooiman Marketing Manager Microsoft Corporation © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

3 What will be covered UCWA UCMA Q&A Frequently encountered issues
REST error framework UCMA Troubleshooting guideline Q&A

4 Prerequisites (what we won’t cover)
Provisioning and deployment CLS logging (in detail) How to use Fiddler

5 What is UCMA and UCWA UCWA is a ‘RESTful’ web API that exposes Lync Instant Messaging and Presence functionalities UCMA is a public SDK that is designed for building highly scalable SIP based applications to enhance Lync experience SDK and Runtime SIPEPS DLL (a.k.a. S4 stack) Signaling layer Collaboration layer (abstraction over signaling layer) UCMA Media

6 Unified Communications Web API (UCWA)

7 Sign In Flow

8 Sign In Flow: client server GET https://lyncdiscover.microsoft.com
Lync 2014 4/14/2017 Sign In Flow: client server GET https://lyncdiscover.microsoft.com 200-OK with user token GET https://../oauth/user?originalDomain=microsoft.com { "_links": { "self": { "href": "https://lync32.lyncweb.microsoft.com/..." }, "user": { "href": "https://lync32.lyncweb.microsoft.com/Autodiscover/AutodiscoverService.svc/root/oauth/us er?originalDomain=microsoft.com" "xframe": { "href": "https://lync32.lyncweb.microsoft.com/Autodiscover/XFrame/XFrame.html" } 401 challenge with www-authenticate headers POST https://lync32.lyncweb.microsoft.com/WebTicket/oauthtoken HTTP/ Unauthorized Cache-Control: no-cache Content-Type: text/html Server: Microsoft-IIS/7.5 WWW-Authenticate: Bearer client_id=" ff1-ce " WWW-Authenticate: MsRtcOAuth href="https://lync32.lyncweb.microsoft.com/WebTicket/oauthtoken",grant_type="urn:microsoft.rtc:windows,urn:microsoft.rtc:passive,urn:microsoft.rtc:anonmeeting,password" X-MS-Server-Fqdn: 000DCO2L50FE1B.redmond.corp.microsoft.com 200-OK with webticket Accept: application/json Content-Type: application/x-www-form-url;charset=“utf-8” Content-Length: 71 Expect: 100-continue { "access_token": "cwt=AAEBHAEFAAAAAAAFFQAAAKBlz354S5tf53yHcA-ScgCBEDmnM6DEtsVUgAWP_RV8MvyCAsL7gyBmWIhojzG8M83-YPuWob0VoXver6tQPtoGGLFDZipCS4YIJibsGhP50AgNEH3WUHptad9YvSOZbec3KbQ", "expires_in": 27734, "ms_rtc_identityscope": "local", "token_type": "Bearer" } © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

9 Sign In Flow: client server
GET https://../oauth/user?originalDomain=microsoft.com Host: lync0b.lyncweb.microsoft.com Connection: keep-alive Cache-Control: no-cache Accept: */* Authorization: Bearer cwt=AAEBHAEFAAAAAAAFFQAAAKBlz354S5tf53yHcA- ScgCBEG7qxRtbYkRejClBo1lfTZiCAjUXgyBeDJh- bPtyMbfXKNOST8SEISnXEBhaDir0ek6RPAIfToYIvQIMnRP50AgNEAZ69SYDHnRUhIkdHuxK34g 200-OK with Ucwa applications token POST https://.../ucwa/oAuth/v1/applications { "_links": { "self": { "href": "https://lync0b.lyncweb.microsoft.com/Autodiscover/AutodiscoverService.svc/root/user" }, "applications": { "href": "https://lync0b.lyncweb.microsoft.com/ucwa/oauth/v1/applications" "xframe": { "href": "https://lync0b.lyncweb.microsoft.com/Autodiscover/XFrame/XFrame.html" } 201-Created with Ucwa application dashboard Connection: keep-alive Cache-Control: no-cache Content-Type: application/json Authorization: Bearer cwt=AAEBHAEFAAAAAAAFFQAAAKBlz354S5tf53yHcA- ScgCBEG7qxRtbYkRejClBo1lfTZiCAjUXgyBeDJh- bPtyMbfXKNOST8SEISnXEBhaDir0ek6RPAIfToYIvQIMnRP50AgNEAZ69SYDHnRUhIkdHuxK34g Content-Length: { "culture": "en-US", "endpointId": "12345", "userAgent": "myUserAgent", "type": "Browser“ } Via: DTK5L50FEBC.redmond.corp.microsoft.com RtcExt Content-Type: application/json; charset=utf-8 X-MS-Server-Fqdn: 000DTK5L50FEBA.redmond.corp.microsoft.com Date: Sun, 16 Feb :07:05 GMT Content-Length: { "culture": "en-US", "userAgent": "myUserAgent", "_links": {…}, "_embedded": { "me": {..}, "people": {...}, "onlineMeetings": {...}, "communication": {...}, }, "rel": "application“ }

10 Sign In – Summary: Autodiscover process can result in two host FQDNs
In our example: lync32.lyncweb.microsoft.com was given with GET (no authorization header) lync0b.lyncweb.microsoft.com was given with GET (with webticket authorization) Need to: Do a GET against the new fqdn - https://lync0b.lyncweb.microsoft.com/.../root/oauth/user Extract the MsRtcOAuth url from the 401 challenge Request a new Webticket from the MsRtcOAuth url

11 Tips for troubleshooting Sign In
Lync 2014 4/14/2017 Tips for troubleshooting Sign In If you see an HTML/IIS page error: WebInfrastructure component AutoDiscover component Look for the X-MS-Diagnostics header in the response If your request hits UCWA, we will always give you an error resource back © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

12 Fiddler

13 Fiddler Third-party tool
Helps you debug web applications by capturing network traffic between the Internet and test computers Inspect request/response payloads and gives the ability to modify them before it reaches your app Event-based scripting subsystem, extended by any .NET framework language MSDN link

14 Command Channel vs Event Channel

15 Command Channel a.k.a. Synchronous APIs
Contact APIs Presence APIs Online Meeting Scheduling APIs

16 Example: client server
POST https://.../onlineMeetings/myOnlineMeetings Authorization: Bearer cwt=AAEBHAEFAAAAAAAFFQAAAKBlz354S5tf53yHcA- ScgCBEG7qxRtbYkRejClBo1lfTZiCAjUXgyBeDJh- bPtyMbfXKNOST8SEISnXEBhaDir0ek6RPAIfToYIvQIMnRP50AgNEAZ69SYDHnRUhIkdHuxK34g Content-Type : application/json; charset=utf-8 Content-Length: 123 { "accessLevel": "Everyone", "description": "meeting scheduling example", "subject": "meeting scheduling example“ } 200-OK with meeting information X-MS-Server-Fqdn : SERVER.vdomain.com X-MS-Correlation-Id : client-request-id : ResExp/2082d19e-29a9-4df6-879d-c76f461e2dd2 Cache-Control : no-cache Date : Sun, 16 Feb :28:18 GMT ETag : " “ Content-Length : 835 Content-Type : application/json; charset=utf-8 { "accessLevel": "Everyone", "entryExitAnnouncement": "Disabled", "automaticLeaderAssignment": "Disabled", "description": "meeting scheduling example", "onlineMeetingId": "3VC016ZQ", "onlineMeetingUri": "0f f89-4c74-9ec6-c b82": "please pass this in a PUT request", "_links": {...}, "rel": "myOnlineMeeting", "etag": " " }

17 Resource Operations AKA Asynchronous APIs
Messaging Invitations Online Meeting Invitations Send Message Presence Subscriptions Contacts and Groups Subscriptions

18 Example: client server
GET https://... / /events?ack=1&timeout=180 POST https://.../communication/onlineMeetingInvitations 201 Created - with location header Accept: application/vnd.microsoft.com.ucwa+json Authorization: Bearer cwt=AAEBHAEFAAAAA… Content-Type: application/vnd.microsoft.com.ucwa+json Content-Length: 279 { "importance": "Normal", "operationId": "2DCC542A-031B-4E1D-8FE7-C321B326D359", "subject": "", "anonymousDisplayName": "Prashanth", "telemetryId": "116939c1-413d-436a-8a79-250c0e184e92", "onlineMeetingUri": "threadId": null } Location: /ucwa/v1/applications/ /communication/messagingInvitations/dc1951a313a244 b59a45167d0e6cbf86 X-MS-UcwaBuild: {"version":" ", "date":"02/02/ :06:02 Z"} X-Ms-Namespace: internal X-MS-Server-Fqdn: BL20D06FES01.infra.lync.com X-MS-Correlation-Id: 200 OK – ack=1 PGET completes with event payload { "rel": "communication", "events": [ "link": { "rel": "onlineMeetingInvitation", ..}, "status": "Success", "_embedded": { "onlineMeetingInvitation": { "state": "Connected", "operationId": "2DCC542A-031B-4E1D-8FE7-C321B326D359", }, "rel": "onlineMeetingInvitation" } "type": "completed" ]

19 Unexpected State Transitions
UCWA also gives information to client when any unexpected state transition happens

20 Error Resource

21 Error Resources Error Code Error Sub Code Message Debug Info

22 Error Codes Synchronous Error Codes Async Error Codes
Broad Categories: Sync and Async Can be programmed against Synchronous Error Codes BadRequest GatewayTimeout Gone MethodNotAllowed ServiceFailure UnsupportedMediaType PreconditionFailed Async Error Codes LocalFailure Informational RemoteFailure ServiceFailure

23 Error Sub Codes Examples: Ever-growing enum
Has to be taken into context with the error code Can be programmed against Examples: ApplicationNotFound DeserializationFailure ParameterValidationFailure ResourceNotFound TooManyApplications Etc.

24 Messages Cannot be programmed against
Localized to the registered culture Clients can take a dependency on the localization

25 Parameter Validation Failure
Some examples: Synchronous error sub code Always comes with 400-Bad Request Developer friendly

26 Debug Info Dictionary of Key Value pairs
If enabled, gives rich details about the error that occurred Disabled by default due to legal reasons Can be enabled by explicitly adding the following key to the Web.Config file of UCWA : <add key="DiscloseExceptionMessages" value="true"></add>

27 Example Incoming chat invitation being declined

28 Example An organizer terminating the conference

29 After Deployment

30 CLS Central Logging Service (Recap):
CLSController FE CLSAgent Start, Stop, Search commands Start, Stop, Search commands FE CLSAgent Start, Stop, Search commands FE CLSAgent

31 CLS Central Logging Service (Recap):
CLSAgent CLSController Scenarios AlwaysOn Scenario Powershell Cmdlets Start/Stop CLS logging (Start-CsClsLogging / Stop-CsClsLogging) Search CLS logging (Search-CsClsLogging)

32 Headers

33 Headers X-MS-Server-Fqdn Date X-MS-Correlation-Id

34 Extended Headers Via Good to log all the headers returned by UCWA

35 Components to log/collect:
UCWA Collaboration WebInfrastructure S4

36 TL/DR* *Too long/Did not read

37 In Summary Almost all the commonly hit issues can be root-caused by just looking at the error resources This is a standard for all the Lync Web based APIs (also the ones coming…) We will continue to invest in the area until the day comes where we can detect the following scenario ErrorCode = DataCenterDown ErrorSubCode = MonkeyInLab

38 Unified Communications Managed API (UCMA)

39 Troubleshooting During Development During Deployment After Deployment

40 During Development Error about SIPEPS DLL with UCMA
SIPEPS, Version= could not be found You have targeted the wrong version of the .NET framework (.Net Framework 4.5) You have targeted the wrong type of CPU (x64) Firewalls and UCMA applications Firewall blocking incoming connections – SIP 504 error Listening port and media ports (1024 – 65535) Media troubleshooting and quality data void OnCallReceived(object sender, CallReceivedEventArgs<AudioVideoCall> e) { e.Call.MediaTroubleshootingDataReported += this.call_MediaTroubleshootingDataReported; // Accept the call, do other important stuff, etc. } void OnMediaTroubleshootingDataReported(object sender, MediaTroubleshootingDataReportedEventArgs e) { foreach (MediaChannelEstablishmentData data in e.MediaChannelEstablishmentDataCollection) if (data.EstablishmentStatus == MediaChannelEstablishmentStatus.Succeeded) Console.WriteLine("Media establishment succeeded."); } else Console.WriteLine("Media establishment failed: {0}", data.GetDiagnosticsReason()); string qualityOfExperienceXml = System.Text.Encoding.UTF8.GetString(e.QualityOfExperienceContent.GetBody()); Console.WriteLine(qualityOfExperienceXml);

41 During Development Application troubleshooting
DiagnosticsInformation (http://msdn.microsoft.com/en-us/library/office/hh364918(v=office.14).aspx) public DiagnosticsInformation (64001, “client termination”, “more description”, DiagnosticVisibility.Public) Range and range name ‘success’- normal termination 'expected failures' - common error cases 'unexpected failures' - unexpected state or corner case

42 During Deployment Install Central Management Store Replication Service
"%ProgramFiles%\Microsoft Lync Server 2010\Deployment\Bootstrapper.exe" /BootstrapLocalMgmt /MinCache Enable-CsReplica Start-Service Replica New-CsTrustedApplicationComputer New-CsTrustedApplication New-CsTrustedApplicationEndpoint Get-CSManagementStoreReplicationStatus – replication can take up to five minutes Invoke-CSManagementStoreReplication Set-CsCertificate -Type Default -Thumbprint 14b04424b8316d90c72438dfefdf83d1fd917d39 ProvisioningFailureException ProvisioningFailureReason

43 After Deployment Install Lync Server Monitoring Reports
Error about loading dlls

44 After Deployment Error about loading dlls

45 After Deployment Error about loading dlls

46 Q&A Resources UCWA website UCWA MSDN Forum Shelby Hagman’s blog
UCMA Forum Michael Greenlee’s blog

47 Resources Learning TechNet msdn http://channel9.msdn.com/Events/TechEd
4/14/2017 Resources Sessions on Demand Learning Microsoft Certification & Training Resources TechNet Resources for IT Professionals msdn Resources for Developers © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

48 Complete an evaluation and enter to win!
4/14/2017 Complete an evaluation and enter to win! © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

49 Evaluate this session Scan this QR code to evaluate this session.
4/14/2017 Evaluate this session Scan this QR code to evaluate this session. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.

50 4/14/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.


Download ppt "4/14/2017 © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks."

Similar presentations


Ads by Google