# `bird voice stats by-trunk`

## Usage

```bash
bird voice stats by-trunk [flags]
```

## Description

Voice stats grouped by SIP trunk, ranked by `sort` (default `total_calls`) and capped at `limit` (default 50, max 200); the response's `total` tells a capped ranking from a complete one. This is the axis that answers which trunk is degraded, so compare `asr` and `short_call_rate` across rows rather than reading one in isolation. `trunk_name` is resolved as the response is built, and a null `trunk_id` is the row for calls that used no trunk, such as Verify voice calls.

## Examples

```bash
bird voice stats by-trunk
```

## Options

| Name                            | Description                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--direction`                   | When set, limits the statistics to call legs in this direction. Omit to include all legs. Possible values: inbound, outbound.                                                                                                                                                                                                                                                    |
| `--from`                        | Start date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to 30 days before to when omitted.                                                                                                                                                                                                                |
| `--limit <n>`                   | Maximum number of rows to return, ranked by the sort metric descending. The response's total reports how many rows existed before this cap.                                                                                                                                                                                                                                      |
| `--response-schema`             | Print the fields this command returns, then exit                                                                                                                                                                                                                                                                                                                                 |
| `--short-call-threshold-ms <n>` | Duration in milliseconds below which an answered call counts toward short\_calls. The default of 30 seconds is a convention rather than a property of the network, so set it to whatever your own definition of a call too short to have been useful is. Every response echoes the value it used, so a stored figure can always be read against the definition that produced it. |
| `--sort`                        | Which metric ranks the breakdown rows, always descending. Defaults to total\_calls. Possible values: total\_calls, answered\_calls, asr, acd\_ms.                                                                                                                                                                                                                                |
| `--timezone`                    | IANA timezone identifier used to group statistics, for example Asia/Kathmandu. The default is UTC. Day and hour boundaries, including the default window when from and to are omitted, follow this timezone. When this parameter is set, pass from and to as calendar days or Z instants instead of timestamps with explicit UTC offsets.                                        |
| `--to`                          | End date (inclusive) in YYYY-MM-DD, interpreted as a calendar day in timezone (a UTC day when timezone is omitted). Defaults to today in that timezone when omitted. Window may not exceed 365 days.                                                                                                                                                                             |

## Related

| Name                                                                                    | Description                           |
| --------------------------------------------------------------------------------------- | ------------------------------------- |
| [`bird voice stats by-country`](/docs/cli/reference/voice-stats-by-country)             | Get Voice statistics by country       |
| [`bird voice stats by-response-code`](/docs/cli/reference/voice-stats-by-response-code) | Get Voice statistics by response code |
| [`bird voice stats daily`](/docs/cli/reference/voice-stats-daily)                       | Get daily Voice statistics            |
| [`bird voice stats hourly`](/docs/cli/reference/voice-stats-hourly)                     | Get hourly Voice statistics           |
| [`bird voice stats summary`](/docs/cli/reference/voice-stats-summary)                   | Get aggregate Voice statistics        |

## Related resources

- [What is a voice API?](/explained/voice/what-is-a-voice-api) (answer)
- [Voice](/products/voice) (product)
- [Voice overview](/docs/guides/voice/overview) (docs)

[Get an implementation brief](/learn/workspace?topic=voice)
