# Add a Call Rate Rule

Call rate rules let Cloud Voice put a price on outbound calls (calls that leave your system and go out to the public phone network). Once a rule is in place, the system charges every matching call automatically, which makes it easy to keep an eye on what teams and individuals are spending on local, long-distance, and international dialing, and to spot unusual activity that might signal fraud.

:::note
A call rate rule only measures and records the cost of a call for your reports. It does not block, restrict, or reroute calls. You catch misuse by reviewing the cost totals it produces, not because the rule stops a call. Treat these rules as an accounting and monitoring tool, not a call barrier.
:::

## How many rules you can create

A single Cloud Voice system supports up to **30,000** call rate rules.

## Create a rule

1. Sign in to your Cloud Voice management portal and go to **Reports and Recordings > Call Reports**.

   :::note
   Call rate rules live under **Reports and Recordings** because their whole purpose is to feed cost figures into your call reports.
   :::

2. Open the **Rate** tab and click **Add**.
3. Fill in the rule's settings, described below.

   ![Rate settings for a new outbound call rate rule](/images/pbx/local_outbound-rate-setting.png)

   | Setting | What to enter |
   | --- | --- |
   | **Name** | A label that helps you recognize the rule later, such as `Local_Outbound`. |
   | **Match Prefix** | Optional. The dialing prefix (the leading digits) a call must start with to be priced by this rule. Only outbound calls whose number begins with the prefix are charged this rate. |
   | **Number Length** | Optional. The length of the dialed number the rule applies to. A call matches only when the dialed number is the same length as this value or shorter. |
   | **Rate** | The amount charged for each billing unit once the initial time has elapsed. |
   | **Billing Unit (s)** | The block of time, in seconds, used to add up the cost after the initial time. Defaults to 60. For example, with a **Rate** of 0.5 and a **Billing Unit** of 60, the call's cost grows by 0.5 for every 60 seconds. |
   | **Initial Time (s)** | The opening stretch of the call, in seconds, that is billed at the flat initial cost. |
   | **Initial Cost** | The fixed charge that covers the initial time. For example, an **Initial Time** of 120 and an **Initial Cost** of 2 means the first two minutes cost 2; beyond that, the rate takes over. |

   :::caution
   **Number Length** matches on "equal to or shorter than", not an exact length. If you enter 7, the rule applies to any number with 7 digits or fewer, so a shorter internal or emergency-style number could match too. Keep this in mind, or leave the field blank when you do not need a length limit.
   :::

4. Click **Save**, then **Apply**.

   :::caution
   The rule does not take effect until you click **Apply**. Clicking only **Save** stages the change but leaves it inactive, so calls will not be priced until you apply it.
   :::

## What happens next

From this point on, any outbound call that matches the rule is billed using the formula below:

```
Amount = Initial Cost + [(Talk Duration + Hold Duration - Initial Time) / Billing Unit] * Rate
```

:::note
Notice that **Hold Duration** is added to talk time in the formula. Time the caller spends on hold is billed just like connected talk time, so a call parked on hold keeps accruing cost.
:::

:::note
Before the figure inside the brackets is multiplied by the rate, any fractional result is rounded up to the next whole number.
:::

**Worked example.** Suppose a rule has an **Initial Cost** of 1, **Initial Time** of 60, **Billing Unit** of 60, and **Rate** of 0.5. A 200-second call with no time on hold costs:

```
Amount = 1 + [(200 + 0 - 60) / 60] * 0.5
       = 1 + [2.33 rounded up to 3] * 0.5
       = 1 + 1.5
       = 2.5
```

When you have more than one rule, Cloud Voice evaluates them from the top of the list downward and applies the first one that matches. To change the order, use the ![Move to top](/images/pbx/top.png) ![Move up](/images/pbx/up.png) ![Move down](/images/pbx/down.png) ![Move to bottom](/images/pbx/bottom.png) controls to reposition a rule.

:::tip
Because only the first matching rule is applied, put your most specific rules (those with a **Match Prefix** or **Number Length**) above broad catch-all rules. Otherwise a general rule near the top can swallow calls you meant a more specific rule to price.
:::

## Where to see the charges

With rules in place, you can review the accumulated call costs for individual extensions, extension groups, and departments in your call reports. See [Extension Call Accounting Report](/pbx/administrator-guide/extension-call-accounting-report/) and [Extension Call Accounting Details Report](/pbx/administrator-guide/extension-call-accounting-details-report/) for details.
