Correlating SIP Response Codes with API Recording Downloads

I require assistance with the Platform API regarding SIP diagnostics and recording retrieval. I am attempting to automate the export of specific call recordings for our quality management team when a SIP 503 Service Unavailable error occurs on our BYOC premises trunks. I am querying the /api/v2/telephony/providers/edges/trunks/{trunkId}/metrics endpoint, but this does not provide the interaction IDs necessary to fetch the recordings. How can I correlate SIP response codes from the edge servers to the specific conversation IDs so I can execute the /api/v2/conversations/{conversationId}/recordings download?

You cannot extract SIP response codes directly from the Edge metrics API to correlate with conversation IDs. The Edge metrics endpoint provides aggregated statistics, not transaction level details. To achieve this correlation, you must subscribe to the WebSocket notification channel for the specific edge server events or utilize the Analytics API.

Specifically, you should query /api/v2/analytics/conversations/details/query and filter by the disconnectType or specific SIP protocol error codes in the session data. Once you have the conversation IDs from the analytics query, you can request the recording export.

Building upon the previous point, our compliance team utilizes a similar workflow to audit failed voice interactions. You must use the Analytics API to identify the failed calls. Be aware that if the SIP 503 error occurs before the call establishes a media path with the edge server, there will be no recording available to retrieve via /api/v2/conversations/{conversationId}/recordings.

Genesys Cloud only records active media streams. If the call fails at the SIP signaling layer prior to media establishment, you will only have the signaling logs, not an audio file, for your quality management review.