# Set up Call Rate for Guest Call Billing

Cloud Voice includes built-in call accounting that prices the outbound calls your guests make and adds the charges straight to their room bill. Pricing is driven by a rate deck: a set of call rate rules that you define. When a guest finishes an outbound call, the phone system (the PBX, short for Private Branch Exchange) finds the matching rule, works out the cost, and records it against the guest. This page shows you how to create a call rate rule for outbound calls.

:::caution
Each rule is matched on the dialing prefix and number length of the digits the PBX actually sends out, not the digits the guest keyed in. Your outbound routes decide what gets sent, so a rate rule only prices calls correctly when it lines up with your outbound route configuration. If the two do not match, guests can be billed at the wrong rate. Review your rate rules and outbound routes together.
:::

## Add a call rate rule

1. Sign in to the management portal and go to **Reports and Recordings > Call Reports > Rate**.
2. Click **Add**.
3. Complete the rule using the fields below. The first three fields decide which calls the rule matches; the rest decide how a matched call is priced.

   ![Form for defining a call rate rule with name, matching, rate, and billing fields](/images/pbx/call-rate-setting.png)

   | Field | What to enter |
   |-------|---------------|
   | **Name** | A label that lets you recognize the rule later. |
   | **Match Prefix** | Optional. The dialing prefix a call must begin with for this rule to apply. Matching is done against the number the PBX sends out, so only outbound calls whose sent number starts with this prefix are priced by the rule. |
   | **Number Length** | Optional. The rule applies only to outbound calls whose sent number is this many digits or fewer. As with the prefix, this is measured against the number the PBX sends, not the number the guest dialed. |
   | **Rate** | The amount charged for each billing unit once the initial time has elapsed. Up to 5 decimal places are accepted. |
   | **Billing Unit (s)** | The block of time, in seconds, used to meter the call after the initial time. Defaults to 60. For example, with a **Rate** of 0.5 and a **Billing Unit** of 60, the cost rises by 0.5 for every 60 seconds. |
   | **Initial Time (s)** | The opening stretch of the call, in seconds, that is covered by the initial cost. |
   | **Initial Cost** | The flat amount charged for the initial time. For example, an **Initial Time** of 120 with an **Initial Cost** of 2 means the first 2 minutes cost 2, after which the call is metered at the rate above. |

   :::note
   The four pricing fields work together. Take **Initial Time** 120, **Initial Cost** 2, **Rate** 0.5, and **Billing Unit** 60. A 5-minute (300 second) call is charged 2 for the first 120 seconds, then 0.5 for each of the remaining 3 billing units (180 seconds divided by 60), for a total of 3.5.
   :::

4. Click **Save**.

:::tip
You can build several rules to make up your rate deck, one per destination type. For example, use **Match Prefix** and **Number Length** to charge one rate for local calls and a higher rate for long-distance or international calls. Because matching uses the number the PBX sends, model each rule on what your outbound routes actually dial out.
:::

## Result

From now on, when a guest completes an outbound call, Cloud Voice matches it to the applicable rate, calculates the charge, and posts it to that guest's bill.

![A guest bill listing an outbound call with its calculated charge](/images/pbx/call-billing.png)

:::note
Each outbound call is priced with up to 5 decimal places of precision, and the running subtotal is rounded to 2 decimal places.
:::
