# Reformat Inbound Caller ID on a Trunk

Some carriers deliver inbound caller ID in a form that is awkward to dial back: a missing leading digit, an extra area code, or a prefix that no one would type when returning the call. Cloud Voice lets you rewrite that number on the way in, per trunk, so the version your users see in call history and on their phones is one they can redial directly.

Reformatting works on every trunk type. Because each carrier presents numbers differently, the rule you need depends on the provider feeding that trunk.

:::note
This rule only touches **inbound** caller ID (the number of the person calling you). It does not change your outbound caller ID, and it changes only how the number is displayed and redialed, not how the call is routed.
:::

## Add a reformatting rule

1. Sign in to the PBX (Private Branch Exchange) portal and go to **Extension and Trunk > Trunk**, then open the trunk you want to change.
2. Select the **Inbound Caller ID Reformatting** tab.
3. Click **Add**.
4. In the dialog, define the rule, then click **Confirm**:
   - **Patterns**: The caller IDs the rule applies to. Any incoming number matching this pattern is reformatted; others pass through unchanged.
   - **Strip**: How many digits to remove from the front of the number.
   - **Prepend**: Digits to add to the front of the number.
5. Click **Save**, then **Apply**.

:::note
In a pattern, `X` stands for any single digit (0 through 9), and each `X` fills one digit position. So `1XXXXXXXXXX` matches any 11-digit number whose first digit is `1`. Type literal digits where the number must match exactly.
:::

:::note
When a rule sets both **Strip** and **Prepend**, Cloud Voice removes the leading digits first and then adds the prepend digits to what remains.
:::

:::caution
The rule applies only to the one trunk you edited; other trunks keep their own behavior. Changes are not live until you click **Apply**, so finish both **Save** and **Apply** before you test a call.
:::

## Example 1: add a leading zero

Company A receives 11-digit numbers that begin with `1` and wants a `0` in front of each one so staff can redial without editing the number, for instance, showing `012345678910` rather than `12345678910`.

Configure the rule like this:

- **Patterns**: `1XXXXXXXXXX`
- **Strip**: leave empty
- **Prepend**: `0`

![Reformatting rule that matches an 11-digit number starting with 1 and prepends a zero](/images/pbx/reformate-inbound-callerid-1.png)

## Example 2: drop the area code

Company B wants local calls shown without the `0592` area code, for example, `5503301` instead of `05925503301`.

Because the four area-code digits sit at the start of the number, strip them:

- **Patterns**: `0592XXXXXXX`
- **Strip**: `4`
- **Prepend**: leave empty

![Reformatting rule that matches a local number and strips the four-digit area code](/images/pbx/reformate-inbound-callerid-2.png)
