为直接路由配置语音路由Configure voice routing for Direct Routing

本文介绍如何为手机系统直接路由配置语音路由。This article describes how to configure voice routing for Phone System Direct Routing. 这是用于配置直接路由的以下步骤的步骤3:This is step 3 of the following steps for configuring Direct Routing:

有关设置直接路由所需的所有步骤的信息,请参阅 配置直接路由For information on all the steps required for setting up Direct Routing, see Configure Direct Routing.

语音路由概述Voice routing overview

Microsoft Phone 系统具有一种路由机制,可用于将呼叫发送到特定的会话边界控制器 (SBC) ,具体取决于:Microsoft Phone System has a routing mechanism that allows a call to be sent to a specific Session Border Controller (SBC) based on:

  • 被叫号码模式The called number pattern
  • 被叫号码模式和进行呼叫的特定用户The called number pattern plus the specific user who makes the call

SBCs 可以指定为 "活动" 和 "备份"。SBCs can be designated as active and backup. 当配置为活动的 SBC 不能用于特定呼叫路由时,该呼叫将路由到 backup SBC。When the SBC that is configured as active is not available for a specific call route, then the call will be routed to a backup SBC.

语音路由由以下元素组成:Voice routing is made up of the following elements:

  • 语音路由策略 -PSTN 使用的容器,可分配给用户或多个用户。Voice routing policy – A container for PSTN usages, which can be assigned to a user or to multiple users.

  • PSTN 用法 -用于语音路由和 PSTN 用途的容器,可在不同的语音路由策略中共享。PSTN usages – A container for voice routes and PSTN usages, which can be shared in different voice routing policies.

  • 语音路由 -一种数字模式和一组联机 PSTN 网关,用于呼叫号码匹配模式的呼叫。Voice routes – A number pattern and set of online PSTN gateways to use for calls where the calling number matches the pattern.

  • 联机 PSTN 网关 -指向 sbc 的指针,该指针还存储在通过 SBC 放置调用时应用的配置,例如,将 P 声明身份 (PAI) 或首选编解码器。可添加到语音路由。Online PSTN gateway - A pointer to an SBC that also stores the configuration that is applied when a call is placed through the SBC, such as forward P-Asserted-Identity (PAI) or Preferred Codecs; can be added to voice routes.

语音路由策略注意事项Voice routing policy considerations

如果用户具有呼叫计划许可证,则该用户的传出呼叫将通过 Microsoft 呼叫计划 PSTN 基础结构自动路由。If a user has a Calling Plan license, that user’s outgoing calls are automatically routed through the Microsoft Calling Plan PSTN infrastructure. 如果将联机语音路由策略配置并分配给呼叫计划用户,则会检查该用户的传出呼叫以确定所拨号码是否与联机语音路由策略中定义的数字模式匹配。If you configure and assign an online voice routing policy to a Calling Plan user, that user’s outgoing calls are checked to determine whether the dialed number matches a number pattern defined in the online voice routing policy. 如果存在匹配项,则通过直接路由主干路由呼叫。If there’s a match, the call is routed through the Direct Routing trunk. 如果没有匹配项,则通过呼叫计划 PSTN 基础结构路由呼叫。If there’s no match, the call is routed through the Calling Plan PSTN infrastructure.

注意

如果你配置并应用全球 (组织范围的默认) 联机语音路由策略,则你组织中的所有支持语音的用户将继承该策略,这可能会导致来自呼叫计划用户的 PSTN 呼叫不小心路由到直接路由主干。If you configure and apply the global (Org-wide default) online voice routing policy, all voice-enabled users in your organization will inherit that policy, which may result in PSTN calls from Calling Plan users being inadvertently routed to a Direct Routing trunk. 如果不希望所有用户都使用全局联机语音路由策略,请配置自定义联机语音路由策略,并将其分配给单个支持语音的用户。If you don't want all users to use the global online voice routing policy, configure a custom online voice routing policy and assign it to individual voice-enabled users.

示例1:使用一个 PSTN 使用的语音路由Example 1: Voice routing with one PSTN usage

下图显示了一个呼叫流中的语音路由策略的两个示例。The following diagram shows two examples of voice routing policies in a call flow.

通话流 1 (左侧) : 如果用户拨打 + 1 425 XXX xx 或 + 1 206 XXX xx xx,则该呼叫将路由到 SBC sbc1.contoso.biz 或 sbc2.contoso.biz。Call Flow 1 (on the left): If a user makes a call to +1 425 XXX XX XX or +1 206 XXX XX XX, the call is routed to SBC sbc1.contoso.biz or sbc2.contoso.biz. 如果 sbc1.contoso.biz 和 sbc2.contoso.biz 都不可用,则呼叫将被丢弃。If neither sbc1.contoso.biz nor sbc2.contoso.biz are available, the call is dropped.

** (右侧) 的 "呼叫流程 2":** 如果用户拨打 + 1 425 XXX xx 或 + 1 206 XXX xx xx,则该调用首先路由到 SBC sbc1.contoso.biz 或 sbc2.contoso.biz。Call Flow 2 (on the right): If a user makes a call to +1 425 XXX XX XX or +1 206 XXX XX XX, the call is first routed to SBC sbc1.contoso.biz or sbc2.contoso.biz. 如果两个 SBC 均不可用,将尝试使用较低优先级的路由 (sbc3.contoso.biz 和 sbc4.contoso.biz) 。If neither SBC is available, the route with lower priority will be tried (sbc3.contoso.biz and sbc4.contoso.biz). 如果没有 SBCs 可用,将丢弃呼叫。If none of the SBCs are available, the call is dropped.

显示语音路由策略示例

在这两个示例中,虽然为语音路由分配了优先级,但路由中的 SBCs 按随机顺序尝试。In both examples, while the voice route is assigned priorities, the SBCs in the routes are tried in random order.

备注

除非用户也有 Microsoft 通话计划许可证,否则将删除示例配置中除与模式 + 1 425 XXX xx xx 或 + 1 206 XXX xx 之间的任何号码。Unless the user also has a Microsoft Calling Plan license, calls to any number except numbers matching the patterns +1 425 XXX XX XX or +1 206 XXX XX XX in the example configuration are dropped. 如果用户有呼叫计划许可证,则会根据 Microsoft 通话计划的政策自动路由呼叫。If the user has a Calling Plan license, the call is automatically routed according to the policies of the Microsoft Calling Plan. Microsoft 通话计划将自动应用为具有 Microsoft 呼叫计划许可证的所有用户的最后一个路由,并且不需要其他呼叫路由配置。The Microsoft Calling Plan applies automatically as the last route to all users with the Microsoft Calling Plan license and does not require additional call routing configuration.

在下图所示的示例中,添加了一个语音路由,用于将呼叫发送给您的所有其他美国和加拿大的号码 (呼叫号码模式 + 1 XXX XXX xx xx) 。In the example shown in the following diagram, a voice route is added to send calls to all other US and Canadian numbers (calls that go to called number pattern +1 XXX XXX XX XX).

显示具有第三个路线的语音路由策略

对于所有其他呼叫,如果用户在 Microsoft Phone 系统和 Microsoft 通话计划) 中同时具有两个许可证 (,则使用自动路由。For all other calls, if a user has both licenses (Microsoft Phone System and Microsoft Calling Plan), the automatic route is used. 如果没有与管理员创建的在线语音路线中的数字模式匹配的内容,则呼叫将通过 Microsoft 通话计划进行路由。If nothing matches the number patterns in the administrator-created online voice routes, then the call is routed through Microsoft Calling Plan. 如果用户仅有 Microsoft Phone 系统,则呼叫将被丢弃,因为没有可用的匹配规则。If the user only has Microsoft Phone System, the call is dropped because no matching rules are available.

备注

在此情况下,路由 "其他 + 1" 的优先级值不重要,因为只有一条路线与模式 + 1 XXX XXX xx 相匹配。The Priority value for route "Other +1" doesn't matter in this case because there is only one route that matches the pattern +1 XXX XXX XX XX. 如果用户拨打 + 1 324 567 89 89 且 sbc5.contoso.biz 和 sbc6.contoso.biz 都不可用,则呼叫将被丢弃。If a user makes a call to +1 324 567 89 89 and both sbc5.contoso.biz and sbc6.contoso.biz are unavailable, the call is dropped.

下表总结了使用三个语音路由的配置。The following table summarizes the configuration using three voice routes. 在此示例中,所有三个路由都属于同一 PSTN 使用,即 "美国和加拿大"。In this example, all three routes are part of the same PSTN usage, "US and Canada". 所有路线均与 "美国和加拿大" PSTN 使用相关联,PSTN 使用与 "仅美国" 语音路由策略相关联。All routes are associated with the "US and Canada" PSTN usage and the PSTN usage is associated with the "US Only" voice routing policy.

PSTN 用法PSTN usage 语音路由Voice route 号码模式Number pattern 优先级Priority SBCSBC 说明Description
美国和加拿大US and Canada "雷德蒙 1""Redmond 1" ^\+ 1 (425 | 206) # A2\d {7}) $^\+1(425|206)(\d{7})$ 11 sbc1.contoso.bizsbc1.contoso.biz
sbc2.contoso.bizsbc2.contoso.biz
拨打的号码的活动路线 + 1 425 XXX xx XX 或 + 1 206 XXX xx xxActive route for called numbers +1 425 XXX XX XX or +1 206 XXX XX XX
美国和加拿大US and Canada "雷德蒙 2""Redmond 2" ^\+ 1 (425 | 206) # A2\d {7}) $^\+1(425|206)(\d{7})$ 22 sbc3.contoso.bizsbc3.contoso.biz
sbc4.contoso.bizsbc4.contoso.biz
已呼叫号码的备份路由 + 1 425 XXX xx XX 或 + 1 206 XXX xx xxBackup route for called numbers +1 425 XXX XX XX or +1 206 XXX XX XX
美国和加拿大US and Canada "其他 + 1""Other +1" ^\+ 1 ( \d {10}) $^\+1(\d{10})$ 33 sbc5.contoso.bizsbc5.contoso.biz
sbc6.contoso.bizsbc6.contoso.biz
呼叫号码的路由 + 1 XXX XXX xx (,但 + 1 425 XXX xx 或 + 1 206 XXX xx) Route for called numbers +1 XXX XXX XX XX (except +1 425 XXX XX XX or +1 206 XXX XX XX)

示例1:配置步骤Example 1: Configuration steps

以下示例显示了如何:The following example shows how to:

  1. 创建单个 PSTN 使用。Create a single PSTN usage.
  2. 配置三个语音路由。Configure three voice routes.
  3. 创建语音路由策略。Create a voice routing policy.
  4. 将策略分配给名为 Spencer Low 的用户。Assign the policy to a user named Spencer Low.

你可以使用 Microsoft 团队管理中心PowerShell 执行这些步骤。You can use the Microsoft Teams admin center or PowerShell to perform these steps.

使用 Microsoft Teams 管理中心Using the Microsoft Teams admin center

步骤1:创建 "美国和加拿大" PSTN 使用Step 1: Create the "US and Canada" PSTN usage

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 直接路由",然后在右上角选择 "管理 PSTN 使用情况记录"。In the left navigation of the Microsoft Teams admin center, go to Voice > Direct Routing, and then in the upper-right corner, select Manage PSTN usage records.
  2. 单击 " 添加",键入 " 美国和加拿大",然后单击 " 应用"。Click Add, type US and Canada, and then click Apply.

步骤2:创建三个语音路线 (雷德蒙1、雷德蒙2和其他 + 1) Step 2: Create three voice routes (Redmond 1, Redmond 2, and Other +1)

以下步骤介绍如何创建语音路由。The following steps describe how to create a voice route. 使用这些步骤,通过使用前面表中所述的设置,为本示例创建三个名为 Redmond 1、Redmond 2 和其他 + 1 的语音路线。Use these steps to create the three voice routes named Redmond 1, Redmond 2, and Other +1 for this example by using the settings outlined in the earlier table.

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 直接路由",然后选择 "语音路由" 选项卡。In the left navigation of the Microsoft Teams admin center, go to Voice > Direct Routing, and then select the Voice routes tab.
  2. 单击 " 添加",然后输入语音路线的名称和说明。Click Add, and then enter a name and description for the voice route.
  3. 设置优先级并指定拨出的号码模式。Set the priority and specify the dialed number pattern.
  4. 若要将 SBC 注册到语音路由,请在 " **SBCs 注册 (可选) **中,单击" 添加 sbcs",选择要注册的 SBCs,然后单击" 应用"。To enroll an SBC with the voice route, under SBCs enrolled (optional), click Add SBCs, select the SBCs you want to enroll, and then click Apply.
  5. 要添加 PSTN 使用记录,请在 " **PSTN 使用记录 (可选) **下,单击" 添加 PSTN 使用情况",选择要添加的 PSTN 记录,然后单击" 应用"。To add PSTN usage records, under PSTN usage records (optional), click Add PSTN usage, select the PSTN records you want to add, and then click Apply.
  6. 单击“保存”。Click Save.

步骤3:创建名为 "仅美国" 的语音路由策略,并向策略添加 "美国和加拿大" PSTN 使用情况Step 3: Create a voice routing policy named "US Only" and add the "US and Canada" PSTN usage to the policy

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 语音路由策略",然后单击 "添加"。In the left navigation of the Microsoft Teams admin center, go to Voice > Voice routing policies, and then click Add.
  2. 仅键入 US作为名称,然后添加说明。Type US Only as the name and add a description.
  3. 在 " PSTN 使用记录" 下,单击 " 添加 PSTN 使用情况",选择 "美国和加拿大" PSTN 使用记录,然后单击 " 应用"。Under PSTN usage records, click Add PSTN usage, select the "US and Canada" PSTN usage record, and then click Apply.
  4. 单击“保存”。Click Save.

若要了解详细信息,请参阅 管理语音路由策略To learn more, see Manage voice routing policies.

步骤4:将语音路由策略分配给名为 Spencer Low 的用户Step 4: Assign the voice routing policy to a user named Spencer Low

  1. 在 Microsoft Teams 管理员中心的左侧导航中,转到“用户”,然后单击相应的用户。****In the left navigation of the Microsoft Teams admin center, go to Users, and then click the user.
  2. 单击 " 策略",然后单击 " 分配的策略" 旁边的 " 编辑"。Click Policies, and then next to Assigned policies, click Edit.
  3. 在 " 语音路由策略" 下,选择 "仅美国" 策略,然后单击 " 保存"。Under Voice routing policy, select the "US Only" policy, and then click Save.

若要了解详细信息,请参阅 管理语音路由策略To learn more, see Manage voice routing policies.

使用 PowerShellUsing PowerShell

步骤1:创建 "美国和加拿大" PSTN 使用Step 1: Create the "US and Canada" PSTN usage

在 Skype for Business Online 中的远程 PowerShell 会话中,键入:In a remote PowerShell session in Skype for Business Online, type:

Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="US and Canada"}

通过输入以下内容验证是否已创建使用:Verify that the usage was created by entering:

Get-CSOnlinePSTNUsage

这将返回可能被截断的名称的列表:Which returns a list of names that may be truncated:

Identity    : Global
Usage        : {testusage, US and Canada, International, karlUsage. . .}

以下示例显示运行 (Get-CSOnlinePSTNUsage).usage Powershell 命令以显示全名 (未截断) 的结果:The following example shows the result of running the (Get-CSOnlinePSTNUsage).usage Powershell command to display full names (not truncated):

 testusage
 US and Canada
 International
 karlUsage
 New test env
 Tallinn Lab Sonus
 karlUsage2
 Unrestricted
 Two trunks

步骤2:创建三个语音路线 (雷德蒙1、雷德蒙2和其他 + 1) Step 2: Create three voice routes (Redmond 1, Redmond 2, and Other +1)

若要在 Skype for business Online 的 PowerShell 会话中创建 "Redmond 1" 路线,请输入:To create the "Redmond 1" route, in a PowerShell session in Skype for Business Online, enter:

New-CsOnlineVoiceRoute -Identity "Redmond 1" -NumberPattern "^\+1(425|206)
(\d{7})$" -OnlinePstnGatewayList sbc1.contoso.biz, sbc2.contoso.biz -Priority 1 -OnlinePstnUsages "US and Canada"

返回:Which returns:

Identity                : Redmond 1
Priority                : 1
Description             :
NumberPattern           : ^\+1(425|206) (\d{7})$
OnlinePstnUsages        : {US and Canada}
OnlinePstnGatewayList   : {sbc1.contoso.biz, sbc2.contoso.biz}
Name                    : Redmond 1

若要创建雷德蒙2路线,请输入:To create the Redmond 2 route, enter:

New-CsOnlineVoiceRoute -Identity "Redmond 2" -NumberPattern "^\+1(425|206)
(\d{7})$" -OnlinePstnGatewayList sbc3.contoso.biz, sbc4.contoso.biz -Priority 2 -OnlinePstnUsages "US and Canada"

若要创建其他 + 1 路线,请输入:To create the Other +1 route, enter:

New-CsOnlineVoiceRoute -Identity "Other +1" -NumberPattern "^\+1(\d{10})$"
-OnlinePstnGatewayList sbc5.contoso.biz, sbc6.contoso.biz -OnlinePstnUsages "US and Canada"

注意

请确保 NumberPattern 属性中的正则表达式是有效的表达式。Make sure that your regular expression in the NumberPattern attribute is a valid expression. 你可以使用此网站对其进行测试: https://www.regexpal.comYou can test it using this website: https://www.regexpal.com

在某些情况下,需要将所有调用路由到同一 SBC;使用-NumberPattern ". *"In some cases, there is a need to route all calls to the same SBC; use -NumberPattern ".*"

将所有调用路由到同一个 SBC。Route all calls to the same SBC.

Set-CsOnlineVoiceRoute -id "Redmond 1" -NumberPattern ".*" -OnlinePstnGatewayList sbc1.contoso.biz

通过 Get-CSOnlineVoiceRoute 使用如下所示的选项运行 PowerShell 命令验证是否已正确配置路由:Verify that you've correctly configured the route by running the Get-CSOnlineVoiceRoute PowerShell command using options as shown:

Get-CsOnlineVoiceRoute | Where-Object {($_.priority -eq 1) -or ($_.priority -eq 2) or ($_.priority -eq 4) -Identity "Redmond 1" -NumberPattern "^\+1(425|206) (\d{7})$" -OnlinePstnGatewayList sbc1.contoso.biz, sbc2.contoso.biz -Priority 1 -OnlinePstnUsages "US and Canada"

应返回:Which should return:

Identity            : Redmond 1 
Priority               : 1
Description         : 
NumberPattern         : ^\+1(425|206) (\d{7})$
OnlinePstnUsages     : {US and Canada}     
OnlinePstnGatewayList    : {sbc1.contoso.biz, sbc2.contoso.biz}
Name             : Redmond 1
Identity        : Redmond 2 
Priority               : 2
Description         : 
NumberPattern         : ^\+1(425|206) (\d{7})$
OnlinePstnUsages     : {US and Canada}     
OnlinePstnGatewayList    : {sbc3.contoso.biz, sbc4.contoso.biz}
Name             : Redmond 2
    
Identity        : Other +1 
Priority               : 4
Description         : 
NumberPattern         : ^\+1(\d{10})$
OnlinePstnUsages     : {US and Canada}     
OnlinePstnGatewayList    : {sbc5.contoso.biz, sbc6.contoso.biz}
Name             : Other +1

在此示例中,自动为 "其他 + 1" 路由分配优先级4。In the example, the route "Other +1" was automatically assigned priority 4.

步骤3:创建名为 "仅美国" 的语音路由策略,并向策略添加 "美国和加拿大" PSTN 使用情况Step 3: Create a voice routing policy named "US Only" and add the "US and Canada" PSTN usage to the policy

在 Skype for Business Online 的 PowerShell 会话中,键入:In a PowerShell session in Skype for Business Online, type:

New-CsOnlineVoiceRoutingPolicy "US Only" -OnlinePstnUsages "US and Canada"

此示例中显示了结果:The result is shown in this example:

Identity            : Tag:US only
OnlinePstnUsages    : {US and Canada}
Description         :
RouteType           : BYOT

步骤4:将语音路由策略分配给名为 Spencer Low 的用户Step 4: Assign the voice routing policy to a user named Spencer Low

在 Skype for Business Online 的 PowerShell 会话中,键入:In a PowerShell session in Skype for Business Online, type:

Grant-CsOnlineVoiceRoutingPolicy -Identity "Spencer Low" -PolicyName "US Only"

通过输入以下命令验证策略分配:Validate the policy assignment by entering this command:

Get-CsOnlineUser "Spencer Low" | select OnlineVoiceRoutingPolicy

该命令将返回以下内容:The command returns the following:

OnlineVoiceRoutingPolicy
---------------------
US Only

示例2:具有多个 PSTN 用法的语音路由Example 2: Voice routing with multiple PSTN usages

在示例1中创建的 "语音路由策略" 仅允许拨打美国和加拿大的电话号码,除非还为用户分配了 Microsoft 通话计划许可证。The voice routing policy created in Example 1 only allows calls to phone numbers in the US and Canada--unless the Microsoft Calling Plan license is also assigned to the user.

在下面的示例中,您可以创建 "无限制" 语音路由策略。In the example that follows, you can create the "No Restrictions" voice routing policy. 该策略重用在示例1中创建的 "美国和加拿大" PSTN 使用情况,以及新的 "国际" PSTN 使用。The policy reuses the "US and Canada" PSTN usage created in Example 1, as well as the new "International" PSTN usage. 此策略将所有其他调用路由到 SBCs sbc2.contoso.biz 和 sbc5.contoso.biz。This policy routes all other calls to the SBCs sbc2.contoso.biz and sbc5.contoso.biz.

显示的示例将 "仅美国" 策略分配给用户 Spencer Low,将 "无限制" 策略分配给用户 John 的,以便按如下方式进行路由:The examples that are shown assign the US Only policy to user Spencer Low, and the No Restrictions policy to the user John Woods so that routing occurs as follows:

  • Spencer 低–美国的政策。Spencer Low – US Only policy. 通话仅允许使用美国和加拿大号码。Calls are allowed only to US and Canadian numbers. 当调用 Redmond 数字范围时,必须使用特定的 SBCs 集。When calling to the Redmond number range, the specific set of SBCs must be used. 除非向用户分配了通话计划许可证,否则不会路由非美国号码。Non-US numbers will not be routed unless the Calling Plan license is assigned to the user.

  • John 的 54777-国际政策。John Woods – International policy. 任何号码都允许通话。Calls are allowed to any number. 当调用 Redmond 数字范围时,必须使用特定的 SBCs 集。When calling to the Redmond number range, the specific set of SBCs must be used. 非 US 数字将使用 sbc2.contoso.biz 和 sbc5.contoso.biz 进行路由。Non-US numbers will be routed using sbc2.contoso.biz and sbc5.contoso.biz.

显示分配给用户 Spencer 低的语音路由策略

对于所有其他呼叫,如果用户在 Microsoft Phone 系统和 Microsoft 通话计划) 中同时具有两个许可证 (,则使用自动路由。For all other calls, if a user has both licenses (Microsoft Phone System and Microsoft Calling Plan), automatic route is used. 如果没有与管理员创建的在线语音路线中的数字模式匹配的内容,则使用 Microsoft 通话计划路由呼叫。If nothing matches the number patterns in the administrator-created online voice routes, then the call is routed using Microsoft Calling Plan. 如果用户仅有 Microsoft Phone 系统,则呼叫将被丢弃,因为没有可用的匹配规则。If the user has only Microsoft Phone System, the call is dropped because no matching rules are available.

显示分配给用户 John 的的语音路由策略

下表总结了路由策略 "无限制" 的用法标识和语音路由。The following table summarizes routing policy "No Restrictions" usage designations and voice routes.

PSTN 用法PSTN usage 语音路由Voice route 号码模式Number pattern 优先级Priority SBCSBC 说明Description
美国和加拿大US and Canada "雷德蒙 1""Redmond 1" ^\+ 1 (425 | 206) # A2\d {7}) $^\+1(425|206)(\d{7})$ 11 sbc1.contoso.bizsbc1.contoso.biz
sbc2.contoso.bizsbc2.contoso.biz
被呼叫方号码的活动路由 + 1 425 XXX XX XX 或 + 1 206 XXX xx xxActive route for callee numbers +1 425 XXX XX XX or +1 206 XXX XX XX
美国和加拿大US and Canada "雷德蒙 2""Redmond 2" ^\+ 1 (425 | 206) # A2\d {7}) $^\+1(425|206)(\d{7})$ 22 sbc3.contoso.bizsbc3.contoso.biz
sbc4.contoso.bizsbc4.contoso.biz
被呼叫方号码的备份路由 + 1 425 XXX xx XX 或 + 1 206 XXX xx xxBackup route for callee numbers +1 425 XXX XX XX or +1 206 XXX XX XX
美国和加拿大US and Canada "其他 + 1""Other +1" ^\+ 1 ( \d {10}) $^\+1(\d{10})$ 33 sbc5.contoso.bizsbc5.contoso.biz
sbc6.contoso.bizsbc6.contoso.biz
被呼叫方号码的路由 + 1 XXX XXX xx (,但 + 1 425 XXX xx 或 + 1 206 XXX xx) Route for callee numbers +1 XXX XXX XX XX (except +1 425 XXX XX XX or +1 206 XXX XX XX)
InternationalInternational InternationalInternational \d +\d+ 44 sbc2.contoso.bizsbc2.contoso.biz
sbc5.contoso.bizsbc5.contoso.biz
任何数字模式的路由Route for any number pattern

备注

  • 语音路由策略中的 PSTN 用法的顺序非常重要。The order of PSTN usages in voice routing policies is critical. 使用实例按顺序应用,如果在第一次使用中发现匹配项,则从不计算其他用法。The usages are applied in order, and if a match is found in the first usage, then other usages are never evaluated. "国际" PSTN 使用必须位于 "美国和加拿大" PSTN 使用后。The "International" PSTN usage must be placed after the "US and Canada" PSTN usage. 若要更改 PSTN 用法的顺序,请运行 Set-CSOnlineVoiceRoutingPolicy 命令。To change the order of the PSTN usages, run the Set-CSOnlineVoiceRoutingPolicy command.
    例如,若要将订单从 "美国和加拿大" 的第一个和 "国际" 的订单更改为反向顺序,请执行以下操作:For example, to change the order from "US and Canada" first and "International" second to the reverse order run:
    Set-CsOnlineVoiceRoutingPolicy -id tag:"no Restrictions" -OnlinePstnUsages @{Replace="International", "US and Canada"}
  • 将自动分配 "其他 + 1" 和 "国际" 语音路由的优先级。The priority for "Other +1" and "International" voice routes are assigned automatically. 它们的优先级与 "Redmond 1" 和 "雷德蒙 2" 相比,不是很重要。They don't matter as long as they have lower priorities than "Redmond 1" and "Redmond 2."

示例2:配置步骤Example 2: Configuration steps

以下示例显示了如何:The following example shows how to:

  1. 创建名为 "国际" 的新 PSTN 使用。Create a new PSTN usage called International.
  2. 创建名为 "国际" 的新语音路线。Create a new voice route called International.
  3. 创建名为 "无限制" 的语音路由策略。Create a voice routing policy called No Restrictions.
  4. 将策略分配给用户 John 的一对用户。Assign the policy to user John Woods.

你可以使用 Microsoft 团队管理中心PowerShell 执行这些步骤。You can use the Microsoft Teams admin center or PowerShell to perform these steps.

使用 Microsoft Teams 管理中心Using the Microsoft Teams admin center

步骤1:创建 "国际" PSTN 使用Step 1: Create the "International" PSTN usage

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 直接路由",然后在右上角选择 "管理 PSTN 使用情况记录"。In the left navigation of the Microsoft Teams admin center, go to Voice > Direct Routing, and then in the upper-right corner, select Manage PSTN usage records.
  2. 单击 " 添加",键入 " 国际",然后单击 " 应用"。Click Add, type International, and then click Apply.

步骤2:创建 "国际" 语音路由Step 2: Create the "International" voice route

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 直接路由",然后选择 "语音路由" 选项卡。In the left navigation of the Microsoft Teams admin center, go to Voice > Direct Routing, and then select the Voice routes tab.
  2. 单击 " 添加",输入 "国际" 作为名称,然后添加说明。Click Add, enter "International" as the name, and then add the description.
  3. 将 "优先级" 设置为 "4",然后将 "拨打的号码" 模式设置为 "\d +"。Set the priority to 4, and then set the dialed number pattern to \d+.
  4. 在 " **SBCs 注册 (可选) **中,单击" 添加 SBCs",选择" sbc2.contoso.biz "和" sbc5.contoso.biz ",然后单击" 应用"。Under SBCs enrolled (optional), click Add SBCs, select sbc2.contoso.biz and sbc5.contoso.biz, and then click Apply.
  5. 在 " **PSTN 使用记录 (可选) **" 下,单击 " 添加 PSTN 使用情况",选择 "国际" PSTN 使用记录,然后单击 " 应用"。Under PSTN usage records (optional), click Add PSTN usage, select the "International" PSTN usage record, and then click Apply.
  6. 单击“保存”。Click Save.

步骤3:创建名为 "无限制" 的语音路由策略,并将 "美国和加拿大" 和 "国际" PSTN 使用情况添加到策略Step 3: Create a voice routing policy named "No Restrictions" and add the "US and Canada" and "International" PSTN usages to the policy

PSTN 使用 "美国和加拿大" 将在此语音路由策略中重复使用,以保留对号码 "+ 1 425 XXX xx" 和 "+ 1 206 XXX xx xx" 的特殊处理,作为本地或本地呼叫。The PSTN usage "US and Canada" are reused in this voice routing policy to preserve special handling for calls to number "+1 425 XXX XX XX" and "+1 206 XXX XX XX" as local or on-premises calls.

  1. 在 Microsoft 团队管理中心的左侧导航中,转到 "语音 > 语音路由策略",然后单击 "添加"。In the left navigation of the Microsoft Teams admin center, go to Voice > Voice routing policies, and then click Add.

  2. 键入 " 无限制 " 作为名称并添加说明。Type No Restrictions as the name and add a description.

  3. 在 " PSTN 使用记录" 下,单击 " 添加 PSTN 使用情况",选择 "美国和加拿大" pstn 使用记录,然后选择 "国际" pstn 使用记录。Under PSTN usage records, click Add PSTN usage, select the "US and Canada" PSTN usage record, and then select the "International" PSTN usage record. 单击“应用”。Click Apply.

    记下 PSTN 用法的顺序:Take note of the order of PSTN usages:

    • 如果对号码 "+ 1 425 XXX XX XX" 的调用与此示例中配置的用法相同,则呼叫将遵循 "美国和加拿大" 使用中设置的路由,并应用特殊路由逻辑。If a call made to number "+1 425 XXX XX XX" with the usages configured as in this example, the call follows the route set in "US and Canada" usage and the special routing logic is applied. 也就是说,将首先使用 sbc1.contoso.biz 和 sbc2.contoso.biz 路由呼叫,然后 sbc3.contoso.biz 和 sbc4.contoso.biz 作为备份路由。That is, the call is routed using sbc1.contoso.biz and sbc2.contoso.biz first, and then sbc3.contoso.biz and sbc4.contoso.biz as the backup routes.

    • 如果 "国际" PSTN 使用早于 "美国和加拿大",则对 + 1 425 XXX xx 的调用将作为路由逻辑的一部分路由到 sbc2.contoso.biz 和 sbc5.contoso.biz。If "International" PSTN usage is before "US and Canada," calls to +1 425 XXX XX XX are routed to sbc2.contoso.biz and sbc5.contoso.biz as part of the routing logic.

  4. 单击“保存”。Click Save.

若要了解详细信息,请参阅 管理语音路由策略To learn more, see Manage voice routing policies.

步骤4:将语音路由策略分配给名为 John 的的用户Step 4: Assign the voice routing policy to a user named John Woods

  1. 在 Microsoft Teams 管理员中心的左侧导航中,转到“用户”,然后单击相应的用户。****In the left navigation of the Microsoft Teams admin center, go to Users, and then click the user.
  2. 单击 " 策略",然后单击 " 分配的策略" 旁边的 " 编辑"。Click Policies, and then next to Assigned policies, click Edit.
  3. 在 " 语音路由策略" 下,选择 "无限制" 策略,然后单击 " 保存"。Under Voice routing policy, select the "No Restrictions" policy, and then click Save.

结果是,应用到 John 54777 的语音政策不受限制,并且将遵循呼叫路由的逻辑,可用于美国、加拿大和国际通话。The result is that the voice policy applied to John Woods' calls is unrestricted and will follow the logic of call routing available for US, Canada, and International calling.

使用 PowerShellUsing PowerShell

步骤1:创建 "国际" PSTN 使用Step 1: Create the "International" PSTN usage

在 Skype for Business Online 中的远程 PowerShell 会话中,输入:In a remote PowerShell session in Skype for Business Online, enter:

Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="International"}

步骤2:创建名为 "国际" 的新语音路线Step 2: Create a new voice route named "International"

New-CsOnlineVoiceRoute -Identity "International" -NumberPattern ".*" -OnlinePstnGatewayList sbc2.contoso.biz, sbc5.contoso.biz -OnlinePstnUsages "International"

返回:Which returns:

Identity                  : International
Priority                  : 5
Description               :
NumberPattern             : .*
OnlinePstnUsages          : {International}
OnlinePstnGatewayList     : {sbc2.contoso.biz, sbc5.contoso.biz}
Name                      : International

步骤3:创建名为 "无限制" 的语音路由策略Step 3: Create a voice routing policy named "No Restrictions"

PSTN 使用 "Redmond 1" 和 "Redmond" 在此语音路由策略中重复使用,以保留对号码 "+ 1 425 XXX xx" 和 "+ 1 206 XXX xx xx" 的特殊处理,作为本地或本地呼叫。The PSTN usage "Redmond 1" and "Redmond" are reused in this voice routing policy to preserve special handling for calls to number "+1 425 XXX XX XX" and "+1 206 XXX XX XX" as local or on-premises calls.

New-CsOnlineVoiceRoutingPolicy "No Restrictions" -OnlinePstnUsages "US and Canada", "International"

记下 PSTN 用法的顺序:Take note of the order of PSTN usages:

  • 如果对数字 "+ 1 425 XXX XX XX" 的调用配置为以下示例中所示的使用实例,则呼叫将遵循 "美国和加拿大" 使用中设置的路由,并应用特殊路由逻辑。If a call made to number "+1 425 XXX XX XX" with the usages configured as in the following example, the call follows the route set in "US and Canada" usage and the special routing logic is applied. 也就是说,将首先使用 sbc1.contoso.biz 和 sbc2.contoso.biz 路由呼叫,然后 sbc3.contoso.biz 和 sbc4.contoso.biz 作为备份路由。That is, the call is routed using sbc1.contoso.biz and sbc2.contoso.biz first, and then sbc3.contoso.biz and sbc4.contoso.biz as the backup routes.

  • 如果 "国际" PSTN 使用早于 "美国和加拿大",则对 + 1 425 XXX xx 的调用将作为路由逻辑的一部分路由到 sbc2.contoso.biz 和 sbc5.contoso.biz。If "International" PSTN usage is before "US and Canada," calls to +1 425 XXX XX XX are routed to sbc2.contoso.biz and sbc5.contoso.biz as part of the routing logic. 输入命令:Enter the command:

New-CsOnlineVoiceRoutingPolicy "No Restrictions" -OnlinePstnUsages "US and Canada", "International"

返回:Which returns:

<pre>
Identity              : International 
OnlinePstnUsages : {US and Canada, International}     
Description         :  
RouteType               : BYOT
</pre>

步骤4:将语音路由策略分配给名为 John 的的用户Step 4: Assign the voice routing policy to the user named John Woods

Grant-CsOnlineVoiceRoutingPolicy -Identity "John Woods" -PolicyName "No Restrictions"

然后使用以下命令验证作业:Then verify the assignment using the command:

Get-CsOnlineUser "John Woods" | Select OnlineVoiceRoutingPolicy

返回:Which returns:

OnlineVoiceRoutingPolicy
------------------------
No Restrictions

结果是,应用到 John 54777 的语音政策不受限制,并且将遵循可用于美国、加拿大和国际通话的呼叫路线逻辑。The result is that the voice policy applied to John Woods' calls is unrestricted, and will follow the logic of call routing available for US, Canada, and International calling.

另请参阅See also

规划直接路由Plan Direct Routing

配置直接路由Configure Direct Routing