# Configure Dial Plans in Microsoft Teams

For Teams users to place outbound calls over your Cloud Voice trunk (the connection that carries calls between Cloud Voice and the outside phone network), Microsoft Teams needs a dial plan rule that permits the numbers those users dial. This page walks you through adding that rule.

:::note
A **dial plan** in Microsoft Teams is a set of **normalization rules**. A normalization rule uses a pattern to decide which dialed numbers are allowed and, if needed, rewrites them into the format the call route expects. If no rule matches a dialed number, Teams will not send the call.
:::

## Before you begin

- You need an account that can sign in to the Microsoft Teams admin center with permission to edit dial plans.
- The Cloud Voice and Microsoft Teams integration must already be set up. That integration is what creates the default **Call2Teams** rule described below.

## Why the default rule is not enough

When you integrate Cloud Voice with Microsoft Teams, a normalization rule called **Call2Teams** is created automatically. Its pattern is:

```
^([\*\#][\*\#\d]+|[1-9]\d{0,5})$
```

This pattern is restrictive: it only accepts numbers of up to six digits that begin with a digit from 1 to 9. Anything longer, such as a full external phone number, is rejected, so you need to add a broader rule of your own.

![Default Call2Teams normalization rule with a six-digit pattern](/images/pbx/default-normalization-rule.png)

## Add a normalization rule

1. Sign in to the [Microsoft Teams admin center](https://admin.teams.microsoft.com/).
2. In the left navigation, go to **Voice > Dial plans**.
3. Open the default dial plan, **Global (Org-wide default)**.
4. Under **Normalization rules**, click **+Add** to create a rule.
5. On the **Add new rule** page, configure the rule:
   1. In **Name**, enter a name for the rule.
   2. Optionally, add a note in the **Description** field.
   3. Choose **Advanced**.
   4. Under **If condition**, in **The number dialed matches this regular expression**, enter `^(\d*)$`. This lets Teams users dial any number.
   5. Under **Then do this**, in **Translate the number based on this regular expression**, enter `$1`. Because this makes no change, Teams sends the dialed number out exactly as entered.
   6. Under **Test this rule**, type a number in **Enter a phone number to test** and click **Test** to confirm it matches the pattern.
   7. Click **Save**.
6. Move the new rule to the top of the list:
   1. In the selection column, select the rule you just created.
   2. On the menu bar, click **Move up** until the rule reaches the top.
   3. Click **Save**.

   ![Custom normalization rule moved to the top of the priority list](/images/pbx/normalization-rule-top-priority.png)

:::note
Both entries are regular expressions (regex), a pattern-matching syntax. `^(\d*)$` means "the entire entry is zero or more digits and nothing else", which is why it accepts any dialed number. `$1` is a back-reference that returns the digits captured by the pattern unchanged, so no digits are added or removed before the call goes out.
:::

:::tip
Always run the number through **Test this rule** before saving. Enter a realistic external number a user would dial (for example, a full 10 or 11 digit number). A match confirms the rule will accept real calls, not just short internal numbers.
:::

:::caution
Teams evaluates normalization rules from the top of the list downward and applies the first one that matches the dialed number. If your rule is not at the top, the narrower default rule can match first and calls may not go through, so make sure your new rule takes priority.
:::

## Result

Teams users can now dial external numbers, and calls follow the dial pattern defined in your Cloud Voice outbound route.

To verify calling works end to end, see [Test Phone Calls on Microsoft Teams](/pbx/integrations/microsoft-teams/test-phone-calls-on-microsoft-teams/).
