什么是拨号计划?What are dial plans?

拨号计划是一组指定的规范化规则,可将单个用户拨打的电话号码转换为替代格式(通常为 E.164),以用于呼叫授权和呼叫路由。A dial plan is a named set of normalization rules that translate dialed phone numbers by an individual user into an alternate format (typically E.164) for purposes of call authorization and call routing.

拨号计划由一个或多个规范化规则组成,这些规则定义如何将以各种格式表示的电话号码转换为备用格式。A dial plan consists of one or more normalization rules that define how phone numbers expressed in various formats are translated to an alternate format. 同一拨号字符串在不同拨号计划中可能以不同方式解释和转换,因此,根据为给定用户分配的拨号计划,同一个拨号号码可能以不同方式转换和路由。The same dial string may be interpreted and translated differently in different dial plans, so depending on which dial plan is assigned to a given user, the same dialed number may be translated and routed differently. 最多可以有 1,000 个租户拨号计划。There can be a maximum of 1,000 tenant dial plans.

请参阅 创建和管理拨号计划以 创建和管理租户拨号计划。See Create and manage dial plans to create and manage tenant dial plans.

租户拨号计划范围Tenant dial plan scope

拨号计划范围确定可以应用拨号计划的层次结构级别。A dial plan's scope determines the hierarchical level at which the dial plan can be applied. 客户端通过预配设置获取相应的拨号计划,这些设置在用户登录到 Teams 时自动提供。Clients get the appropriate dial plan through provisioning settings that are automatically provided when users sign in to Teams. 作为管理员,可以使用远程管理中心或远程 PowerShell Microsoft Teams和分配拨号计划范围级别。As an admin, you can manage and assign dial plan scope levels by using the Microsoft Teams admin center or Remote PowerShell.

在Teams中,有两种类型的拨号计划:服务范围和租户范围 (适用于组织的) 。In Teams, there are two types of dial plans: service-scoped and tenant-scoped (which is for your organization). 服务范围的拨号计划为可用的每个电话系统定义。A service-scoped dial plan is defined for every country or region where Phone System is available. 系统会自动为每个用户分配与分配给用户的使用位置匹配的服务国家/地区拨号计划。Each user is automatically assigned the service country dial plan that matches the usage location assigned to the user. 你无法更改服务国家/地区拨号计划,但可以创建租户范围的拨号计划,用于增强服务国家/地区拨号计划。You can't change the service country dial plan, but you can create tenant scoped dial plans, which augment the service country dial plan. 在预配客户端时,他们获得"有效拨号计划",这是服务国家/地区拨号计划和适当范围的租户拨号计划的组合。As clients are provisioned, they obtain an "effective dial plan," which is a combination of the service country dial plan and the appropriately scoped tenant dial plan. 因此,在租户拨号计划中不必定义所有规范化规则,因为这些规则已经存在于服务国家/地区拨号计划中。Therefore, it's not necessary to define all normalization rules in tenant dial plans as they might already exist in the service country dial plan.

租户拨号计划可以进一步细分为两个范围 - 租户范围或用户范围。Tenant dial plans can be further broken into two scopes - tenant-scope or user-scope. 如果租户定义并分配用户范围的拨号计划,将为该用户预配用户的服务国家/地区拨号计划和分配的用户拨号计划的有效拨号计划。If a tenant defines and assigns a user-scoped dial plan, that user will be provisioned with an effective dial plan of the user's service country dial plan and the assigned user dial plan. 如果租户定义了租户范围的拨号计划,但没有分配用户范围的拨号计划,则将为该用户预配用户的服务国家/地区拨号计划和租户拨号计划的有效拨号计划。If a tenant defines a tenant-scoped dial plan but doesn't assign a user-scoped dial plan, then that user will be provisioned with an effective dial plan of the user's service country dial plan and the tenant dial plan.

下面是拨号计划中拨号计划的继承Teams。The following is the inheritance model of dial plans in Teams.

拨号计划的继承Teams

下面是可能的有效拨号计划:The following are the possible effective dial plans:

服务国家/地区 如果未定义租户范围的拨号计划,并且未向预配的用户分配租户用户范围的拨号计划,则用户将收到映射到与其使用位置关联的服务国家/地区的有效拨号计划。Service Country If no tenant scoped dial plan is defined and no tenant user scoped dial plan is assigned to the provisioned user, the user will receive an effective dial plan mapped to the service country associated with their usage location.

租户全局 - 服务国家/地区 如果定义了租户用户拨号计划,但没有分配给用户,则预配的用户将收到一个有效的拨号计划,其中包括合并的租户拨号计划以及与其使用位置关联的服务国家/地区拨号计划。Tenant Global - Service Country If a tenant user dial plan is defined but not assigned to a user, the provisioned user will receive an effective dial plan consisting of a merged tenant dial plan and the service country dial plan associated with their usage location.

租户用户 - 服务国家/地区 如果定义了租户用户拨号计划并将其分配给用户,则预配的用户将收到一个有效的拨号计划,其中包括合并的租户用户拨号计划以及与其使用位置关联的服务国家/地区拨号计划。Tenant User - Service Country If a tenant user dial plan is defined and assigned to a user, the provisioned user will receive an effective dial plan consisting of the merged tenant user dial plan and the service country dial plan associated with their usage location.

请参阅 创建和管理拨号计划 以创建租户拨号计划。See Create and manage dial plans to create your tenant dial plans.

备注

在未将拨号计划规范化规则应用于拨号号码的情况下,拨号字符串仍规范化为在"+抄送"前,其中 CC 是拨号用户的使用位置的国家/地区代码。In the scenario where no dial plan normalization rules apply to a dialed number, the dialed string is still normalized to prepend "+CC" where CC is the country code of the dialing user's usage location. 这适用于呼叫计划、直接路由和 PSTN 会议拨出方案。This applies to Calling Plans, Direct Routing and PSTN Conference dial-out scenarios.

规划租户拨号计划Planning for tenant dial plans

要规划自定义拨号计划,请执行以下步骤:To plan custom dial plans, follow these steps:

  • 步骤 1 确定是否需要自定义拨号计划来增强用户拨号体验。Step 1 Decide whether a custom dial plan is needed to enhance the user dialing experience. 通常,需要支持非 E.164 拨号,例如分机号码或缩写国家/直拨。Typically, the need for one would be to support non-E.164 dialing, such as extensions or abbreviated national dialing.

  • 步骤 2 确定是否需要租户全局拨号计划或租户用户范围拨号计划,或同时需要这两者。Step 2 Determine whether tenant global or tenant user scoped dial plans are needed, or both. 如果用户具有不同的本地拨号需求,则需使用用户范围的拨号计划。User scoped dial plans are needed if users have different local dialing requirements.

  • 第 3 步 为需要的每个拨号计划确定有效的号码模式。只需要服务级别的国家/地区拨号计划中未定义的号码模式。Step 3 Identify valid number patterns for each required dial plan. Only the number patterns that are not defined in the service level country dial plans are required.

  • 第 4 步 制定用于命名拨号计划的组织范围的方案。采用标准命名方案可确保在组织范围内的一致性,还便于维护和更新。Step 4 Develop an organization-wide scheme for naming dial plans. Adopting a standard naming scheme assures consistency across an organization and makes maintenance and updates easier.

创建新的拨号计划Creating your new dial plan

在创建新拨号计划时,必须填写必填信息。When you create a new dial plan, you must put in the information that is required.

名称和简单名称Name and simple name

对于用户拨号计划,应指定一个描述性名称,用于标识要为其分配拨号计划的用户。For user dial plans, you should specify a descriptive name that identifies the users to which the dial plan will be assigned. 拨号计划简单名称预填充了派生自拨号计划名称的字符串。The dial plan Simple Name is pre-populated with a string that is derived from the dial plan name. "简单名称"字段可编辑,这样你便可以为自己的拨号计划创建更具描述性的命名约定。The Simple Name field is editable, which enables you to create a more descriptive naming convention for your dial plans. "简单名称"值不能为空,且必须唯一。The Simple Name value cannot be empty and must be unique. 最佳实践是为整个组织制定命名约定,然后在所有网站和用户中一致地使用此约定。A best practice is to develop a naming convention for your entire organization and then use this convention consistently across all sites and users.

描述Description

建议输入对应的拨号计划要应用到的地理位置或用户组的通用可识别名称。We recommend that you type the common, recognizable name of the geographic location or group of users to which the corresponding dial plan applies.

外部访问前缀External access prefix

如果用户需要拨打一个或多个附加的前导数位(例如,9)来获取外线,则可指定最多包含四个字符(#、* 和 0-9)的外部访问前缀。You can specify an external access prefix of up to four characters (#, *, and 0-9) if users need to dial one or more additional leading digits (for example, 9) to get an external line.

备注

[!注释] 如果指定外部访问前缀,则不必创建附加的规范化规则来涵盖该前缀。If you specify an external access prefix, you don't need to create an additional normalization rule to accommodate the prefix.

请参阅 创建和管理拨号计划 以创建租户拨号计划。See Create and manage dial plans to create your tenant dial plans.

规范化规则Normalization rules

规范化规则定义如何转换以不同格式表示的电话号码。同一号码字符串可能得到不同的解释和转换,具体取决于拨叫该号码所在的区域。如果用户需要拨打缩写的内部或外部号码,则需要制定规范化规则。Normalization rules define how phone numbers expressed in various formats are to be translated. The same number string may be interpreted and translated differently, depending on the locale from which it is dialed. Normalization rules may be necessary if users need to be able to dial abbreviated internal or external numbers.

必须为拨号计划分配一条或多条规范化规则。One or more normalization rules must be assigned to the dial plan. 规范化规则从上到下匹配,因此它们在租户拨号计划中的显示顺序非常重要。Normalization rules are matched from top to bottom, so the order in which they appear in a tenant dial plan is important. 例如,如果租户拨号计划有 10 条规范化规则,则会从第一条开始,将拨叫的号码与规范化规则进行逻辑匹配,如果不匹配,则对第二条规则进行匹配,依此类推。For example, if a tenant dial plan has 10 normalization rules, the dialed number matching logic will be tried starting with the first normalization rule, if there isn't a match then the second, and so forth. 如果与某一条规则匹配,则使用该规则,不再继续匹配其他任何定义的规则。If a match is made, that rule is used and there is no effort to match any other rules that are defined. 给定租户拨号计划中最多可以有 50 条规范化规则。There can be a maximum of 50 normalization rules in a given tenant dial plan.

确定所需的规范化规则Determining the required normalization rules

由于任何租户拨号计划有效地与给定用户的服务国家/地区拨号计划合并,因此可能需要评估服务国家/地区拨号计划的规范化规则,以确定需要哪个租户拨号计划规范化规则。Because any tenant dial plan is effectively merged with a given user's service country dial plan, it is likely that the service country dial plan's normalization rules need to be evaluated in order to determine which tenant dial plan normalization rules are needed. Get-CsEffectiveTenantDialPlan cmdlet 可用于此用途。The Get-CsEffectiveTenantDialPlan cmdlet can be used for this purpose. 该 cmdlet 以用户标识作为输入参数,并将所有适用的规范化规则都返回给用户。The cmdlet takes the user's identity as the input parameter and will return all normalization rules that are applicable to the user.

创建规范化规则Creating normalization rules

规范化规则.NET Framework正则表达式来指定服务器用来将拨号字符串转换为 E.164 格式的数字匹配模式。Normalization rules use .NET Framework regular expressions to specify numeric match patterns that the server uses to translate dial strings to E.164 format. 可以通过指定在找到匹配项时要执行的匹配和转换的正则表达式来创建规范化规则。Normalization rules can be created by specifying the regular expression for the match and the translation to be done when a match is found. 完成之后,你可以输入一个测试号码以验证规范化规则是否可按预期工作。When you finish, you can enter a test number to verify that the normalization rule works as expected.

有关使用正则表达式.NET Framework,请参阅.NET Framework正则表达式"。For details about using .NET Framework regular expressions, see .NET Framework Regular Expressions.

请参阅 创建和管理拨号计划 ,以创建和管理租户拨号计划的规范化规则。See Create and manage dial plans to create and manage normalization rules for your tenant dial plans.

备注

3pip 设备目前不支持将第一个令牌作为可选标记的规范化规则 (例如 Polycom VVX 601 模型) 。Normalization rules with the first token as optional are currently not supported on 3pip devices (for example, Polycom VVX 601 model). 如果要在 3pip 设备上应用具有可选属性的规范化规则,应创建两个规范化规则而不是一个规范化规则。If you want to apply normalization rules with optionality on 3pip devices, you should create two normalization rules instead of one. 例如,规则 ^0? (999) $ 应替换为以下两个规则: (999) $ (Translation:$1) 和 ^0 (999) $ (Translation:$1) 。For example, the rule ^0?(999)$ should be replaced by the following two rules: (999)$ (Translation:$1) and ^0(999)$ (Translation:$1).

示例规范化规则Sample normalization rules

下表显示以 .NET Framework 正则表达式形式编写的示例规范化规则。这些示例仅用作示例,不用作创建规范化规则的规范性参考。The following table shows sample normalization rules that are written as .NET Framework regular expressions. The samples are examples only and are not meant to be a prescriptive reference for creating your own normalization rules.

使用正则表达式.NET Framework规范化规则 Normalization rules using .NET Framework regular expressions

规则名称Rule name
描述Description
号码模式Number pattern
转换Translation
示例Example
4digitExtension4digitExtension
转换 4 位数分机号。Translates 4-digit extensions.
^(\d{4})$^(\d{4})$
+1425555$1+1425555$1
将 0100 转换为 +142555501000100 is translated to +14255550100
5digitExtension5digitExtension
转换 5 位数分机号。Translates 5-digit extensions.
^5(\d{4})$^5(\d{4})$
+1425555$1+1425555$1
将 50100 转换为 +1425555010050100 is translated to +14255550100
7digitcallingRedmond7digitcallingRedmond
将 7 位数号码转换为雷德蒙德本地号码。Translates 7-digit numbers to Redmond local numbers.
^(\d{7})$^(\d{7})$
+1425$1+1425$1
将 5550100 转换为 +142555501005550100 is translated to +14255550100
RedmondOperatorRedmondOperator
将 0 转换为雷德蒙德话务员。Translates 0 to Redmond Operator.
^0$^0$
+14255550100+14255550100
将 0 转换为 +142555501000 is translated to +14255550100
RedmondSitePrefixRedmondSitePrefix
转换带有网内前缀 (6) 和雷德蒙德站点代码 (222) 的号码。Translates numbers with on-net prefix (6) and Redmond site code (222).
^6222(\d{4})$^6222(\d{4})$
+1425555$1+1425555$1
将 62220100 转换为 +1425555010062220100 is translated to +14255550100
5digitRange5digitRange
转换以 3-7(含 3 和 7)之间的数字开头的 5 位数分机号。Translates 5-digit extensions starting with the digit range between 3-7 inclusive.
^([3-7]\d{4})$^([3-7]\d{4})$
+142555$1+142555$1
将 54567 转换为 +1425555456754567 is translated to +14255554567
PrefixAddedPrefixAdded
在对第一位和第三位数字有限制的 9 位数号码前添加国家/地区前缀。Adds a country prefix in front of a 9 digit number with restrictions on the first and third digits.
^([2-9]\d\d[2-9]\d{6})$^([2-9]\d\d[2-9]\d{6})$
1$11$1
将 4255554567 转换为 142555545674255554567 is translated to 14255554567
NoTranslationNoTranslation
匹配 5 位数,但不转换。Match 5 digits but no translation.
^(\d{5})$^(\d{5})$
$1$1
将 34567 转换为 3456734567 is translated to 34567

上面显示了基于规范化规则的雷德蒙德拨号计划。Redmond dial plan based on normalization rules shown above.

下表根据上表显示的规范化规则对用于雷德蒙德、华盛顿、美国的示例拨号计划进行说明。The following table illustrates a sample dial plan for Redmond, Washington, United States, based on the normalization rules shown in the previous table.

雷德蒙德拨号计划Redmond dial plan
5digitExtension5digitExtension
7digitcallingRedmond7digitcallingRedmond
RedmondSitePrefixRedmondSitePrefix
RedmondOperatorRedmondOperator

备注

上表中显示的规范化规则名称不包括空格,但这是一种选择。The normalization rules names shown in the preceding table don't include spaces, but this is a matter of choice. 例如,该表中的第一个名称,本应写成"5 digit extension"或"5-digit Extension",但它仍然有效。The first name in the table, for example, could have been written "5 digit extension" or "5-digit Extension" and still be valid.

创建并管理拨号计划Create and manage dial plans

用于通话套餐的不同类型的电话号码Different kinds of phone numbers used for Calling Plans

管理你的组织的电话号码Manage phone numbers for your organization

紧急呼叫条款和条件Emergency calling terms and conditions

紧急呼叫免责声明标签Emergency Calling disclaimer label