Call Manager can view all PSTN call logs from Microsoft Teams, whether the calls arrived via a Microsoft Calling Plan, Operator Connect or Direct Routing.
For Direct Routing, some additional SIP-level information is available. Microsoft provide a final SIP code, final SIP message and a Microsoft-specific error code (typically an augmented SIP code).
From Call Manager, browse to Call Logs on the left side menu. Find the failed call in the list, you can filter start/end dates to narrow down large result sets. Click the information icon at the end of row for full call details. This will then present you with a similar screen to the following, that includes a section for Direct Routing details:
Note in this example that beyond just a 404, Microsoft has categorized this call as having error 511404. Microsoft provide some additional troubleshooting information for these specific error codes, which Call Manager displays. In this case, the 511404 is likely due to an inbound call requesting a number that isn't assigned to a user or a resource account.
Clicking the 'Report Call' button will create a text copy of the call details, including the direct routing specific codes. This can then be sent via email or similar to your upstream provider for them to analyze further.
Matching a call with SIP Logs
Microsoft's call ID for a direct routing call is not the same as the SIP Call-ID header. The call ID supplied by Microsoft is used in SIP responses though, so can be used to find the appropriate SIP call leg data. Using the example above, the 404 SIP response sent by Microsoft included this Reason header:
- Reason: Q.850 ;cause=1 ;text="84ad45fd-2974-45af-9b10-5ca696dde982;RNL"
Note the GUID in the header, '84ad54...' that is the Microsoft Call-ID reference from our log above.
For a successful call the matching GUID is typically available in the Contact header, e.g. a SIP 200 OK back from Microsoft would include a Contact header that contains the x-i param that contains the matching correlation call ID:
- Contact: <sip:api-du-b-euno.pstnhub.microsoft.com:443;x-i=34e375ae-44be-47e4-82b6-cbdf9366dbd7;x-c=c756fcfb71475a55a8743885f3f53512/s/1/68bb4a9a4a8c46d7bccd029a6f3c9aa8>