I hear this question a lot, and like many things in Microsoft Teams, there can be multiple answers depending on what you need.
Do you want a log of just user PSTN “phone calls”?
This is an easy one, PSTN user phone calls are available from the Teams Admin Center under User Reports / PSTN and SMS report
https://admin.teams.microsoft.com/analytics/reports
You can also export this into Excel. It contains Microsoft Calling plan calls with any costs if applicable and Direct Routing calls, but no costs for Direct Routing calls since Microsoft don’t know the cost.
This information is also available from a beta graph API, here: Microsoft Docs
Here is a more granular breakdown of that call log/bill: here
If you just wanted Direct Routing calls, you could also potentially get a log/bill from your SBC or your PSTN carrier. The carrier can also provide the costs.
Do you want PSTN elements/legs of conference calls?
These are also available in the Teams Admin Center Excel or from the Beta Graph API, complete with any costs. This will only be for the PSTN element of any conference. This is often an area for heavy use of communications credits, particularly if you have PAYG conferencing.
Do you want PSTN elements of Call Queues / Auto Attendants?
Again, these are also available in the Teams Admin Center Excel or from the Beta Graph API, complete with any costs. This will only be for the PSTN element of those services.
Do you also want Teams to Teams VoIP calls and the VoIP elements of Conferences?
In this case, your only option is the call records API: Call Records API Docs
This gives a complete log of all Audio / Video sessions, VoIP and PSTN, but does not provide any costs for PSTN sessions.
As you can see there are quite a few options. There are also third parties who have written tools to parse both the Microsoft PSTN call log and the call records API and can cross-reference the records by user active directory attributes to generate logs/bills for specific countries or departments.
Sourced from: TomTalks Blog. View the original article here.