設定直接路由的語音路由Configure voice routing for Direct Routing

本文說明如何設定手機系統 Direct 路由的語音路由。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. 當兩個 SBC 在一個路由中設定時,必須在 SBC 或媒體之間路由的網路流量,因為可能會將傳輸的新邀請傳送到路由中的其他 SBC。When two SBC's are configured in one route, network traffic must be routable between both SBC's or media will fail to be established on transfers as it is possible that the new invite for the transfer will be sent to a different SBC in the route.

注意

除非使用者也有 Microsoft 通話方案授權,否則呼叫範例設定中的 [除了模式 + 1 425 XXX xx xx] 或 [+ 1 206 XXX xx 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 手機系統和 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 手機系統,就會中斷通話,因為沒有可用的相符規則。If the user only has Microsoft Phone System, the call is dropped because no matching rules are available.

注意

在此情況下,路由 "Other + 1" 的優先順序值不重要,因為只有一個路由符合模式 + 1 XXX 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 xx 的活動路由Active 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 or + 1 206 XXX XX xxBackup route for called numbers +1 425 XXX XX XX or +1 206 XXX XX XX
美國和加拿大US and Canada "Other + 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 xx 或 + 1 206 XXX xx 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. 您可以使用這些步驟,透過舊版表格中所述的設定,為此範例建立三個名為 [雷蒙德 1]、[雷蒙德 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,然後按一下 [套用 ]。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. 以名稱輸入,並新增描述。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 低的使用者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 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 Online 的 PowerShell 會話中建立「雷蒙德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

使用以下所示的選項,確認您是否已透過執行 PowerShell 命令來正確設定路由 Get-CSOnlineVoiceRouteVerify 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 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 低的使用者Step 4: Assign the voice routing policy to a user named Spencer Low

在商務用 Skype 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 低,並將 [無限制] 原則指派給使用者 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. 呼叫雷德蒙的數位範圍時,必須使用一組特定的半形。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 Woods – International policy. 允許通話至任何號碼。Calls are allowed to any number. 呼叫雷德蒙的數位範圍時,必須使用一組特定的半形。When calling to the Redmond number range, the specific set of SBCs must be used. 使用 sbc2.contoso.biz 和 sbc5.contoso.biz 來路由非美國數位。Non-US numbers will be routed using sbc2.contoso.biz and sbc5.contoso.biz.

顯示指派給使用者 Spencer 低的語音路由策略

針對所有其他通話,如果使用者同時擁有兩個授權 (Microsoft 手機系統和 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 手機系統,就會中斷通話,因為沒有可用的相符規則。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 "Other + 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 xx or + 1 206 XXX xx xx) Route for callee numbers +1 XXX XXX XX XX (except +1 425 XXX XX XX or +1 206 XXX XX XX)
國際International 國際International \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. 只要其優先順序低於「雷蒙德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" (作為本機或內部部署的呼叫)的特殊處理。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 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 使用 "雷德蒙 1" 和 "雷德蒙" 會重複使用,以保留對號碼 "+ 1 425 XXX XX" 和 "+ 1 206 XXX 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",且使用下列範例所述的使用方式,則呼叫會遵循「美國和加拿大」用法中的路由設定,並套用特殊路由邏輯。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