What is the correct way to isolate BYOC trunk failover metrics in Analytics?

Background
Managing fifteen BYOC trunks across AP-SE-2 requires precise visibility into carrier-specific performance. The current setup involves multiple carriers with distinct SIP registration behaviors and failover logic configurations. The goal is to extract granular data for specific failover events rather than aggregated trunk statistics.

Issue
Attempting to query the Analytics API for trunk_failover_events returns null results or incomplete datasets. The specific error encountered is a 400 Bad Request when filtering by carrier_id during peak load windows. The API response indicates that the filter parameter is invalid, yet the same carrier_id works perfectly in the standard routing configuration UI. This suggests a mismatch between the UI identifier and the Analytics backend schema.

Troubleshooting

  • Verified SIP credentials and registration status for all 15 trunks; all show Registered state.
  • Checked outbound routing rules; failover logic is set to sequential with 5-second timeouts.
  • Tested the Analytics API endpoint /api/v2/analytics/trunk/queries with minimal filters, which returns data but lacks failover granularity.
  • Reviewed carrier-specific quirks; one provider sends 408 Request Timeout instead of 487 Request Terminated during switch, potentially causing data loss in the analytics pipeline.

Is there a specific query structure or additional header required to access these detailed failover metrics via the API?