對照 Lync Server 2013 中的電話號碼檢查主幹設定Check trunk configuration against a phone number in Lync Server 2013

 

主題上次修改日期: 2014-05-20Topic Last Modified: 2014-05-20

驗證排程Verification schedule

每月Monthly

測試控管Testing tool

Windows PowerShellWindows PowerShell

必要的權限Permissions required

使用 Lync Server 管理命令介面在本機執行時,使用者必須是 RTCUniversalServerAdmins 安全性群組的成員。When run locally using the Lync Server Management Shell, users must be members of the RTCUniversalServerAdmins security group.

使用 Windows PowerShell 的遠端實例執行時,必須為使用者指派具有執行 Test-CsTrunkConfiguration Cmdlet 許可權的 RBAC 角色。When run using a remote instance of Windows PowerShell, users must be assigned an RBAC role that has permission to run the Test-CsTrunkConfiguration cmdlet. 若要查看可使用此 Cmdlet 的所有 RBAC 角色清單,請從 Windows PowerShell prompt 中執行下列命令:To see a list of all RBAC roles that can use this cmdlet, run the following command from the Windows PowerShell prompt:

Get-CsAdminRole | Where-Object {$_.Cmdlets -match "Test-CsTrunkConfiguration"}

描述Description

SIP 主幹將 Lync Server internal Enterprise Voice 網路連接至下列任何一種:SIP trunks connect the Lync Server internal Enterprise Voice network to any of the following:

  • 公用交換電話網路 (PSTN) 。The Public Switched Telephone network (PSTN).

  • IP 公用 exchange 交換器 (PBX) 。An IP-public branch exchange (PBX).

  • (SBC) 的會話邊界控制器。A Session Border Controller (SBC).

Test-CsTrunkConfiguration 指令程式會驗證使用者 (所撥打的電話號碼,) 可轉換成 e.164 網路,並透過指定的 SIP 主幹進行路由傳送。The Test-CsTrunkConfiguration cmdlet verifies that a phone number (as dialed by a user) can be converted to the E.164 network and routed over a specified SIP trunk.

執行測試Running the test

若要執行 Test-CsTrunkConfiguration Cmdlet,您必須先使用 Get-CsTrunkConfiguration Cmdlet,以取得 SIP 主幹設定設定的實例;然後,該實例會管線傳送至 Test-CsTrunkConfiguration:To run the Test-CsTrunkConfiguration cmdlet you must first use the Get-CsTrunkConfiguration cmdlet to retrieve an instance of your SIP trunk configuration settings; that instance is then piped to Test-CsTrunkConfiguration:

Get-CsTrunkConfiguration -Identity "Global" | Test-CsTrunkConfiguration -DialedNumber "12065551219"

執行 Test-CsTrunkConfiguration 但未先執行 Get-CsTrunkConfiguration 將無法運作。Running Test-CsTrunkConfiguration without first running Get-CsTrunkConfiguration won't work. 例如,此命令將會失敗,而不會傳回任何資料:For example, this command will fail without returning any data:

Test-CsTrunkConfiguration -DialedNumber "12065551219" -TrunkConfiguration "Global"

如果您有多個 SIP 主幹設定的集合,您可以使用類似下列的命令,對相同的電話號碼測試每個集合:If you have multiple collections of SIP trunk configuration settings, you can use a command similar to the following to at the same time test each collection against the same phone number:

Get-CsTrunkConfiguration | Test-CsTrunkConfiguration -DialedNumber "12065551219"

如需詳細資訊,請參閱 Test-CsTrunkConfiguration Cmdlet 的說明文件。For more information, see the Help documentation for the Test-CsTrunkConfiguration cmdlet.

決定成功或失敗Determining success or failure

如果 Test-CsTrunkConfiguration 可以撥打撥號號碼,則已轉譯的電話號碼 (為 e.164 格式) 而且用於轉譯該電話號碼的規則會顯示在畫面上:If Test-CsTrunkConfiguration can place a call to the dialed number then the translated phone number (in the E.164 format) and the rule used to translate that phone number will both be displayed on screen:

TranslatedNumber MatchingRuleTranslatedNumber MatchingRule

---------------- ---------------------------- ------------

+12065551219全球/Redmond+12065551219 Global/Redmond

測試失敗時,Test-CsTrunkConfiguration 會傳回空的屬性值:If the test fails, Test-CsTrunkConfiguration will return empty property values:

TranslatedNumber MatchingRuleTranslatedNumber MatchingRule

---------------- ---------------------------- ------------

測試可能失敗的原因Reasons why the test might have failed

如果 Test-CsTrunkConfiguration 不會傳回符合,通常表示所測試的主幹設定設定沒有可以將撥號號碼轉換為 e.164 格式的撥出電話號碼轉譯規則。If Test-CsTrunkConfiguration does not return a match that typically means that the trunk configuration settings being test do not have an outgoing calling number translation rule capable to converting the dialed number to the E.164 format. 若要取得指派給主幹設定設定集合的轉譯規則,您可以使用類似下列的語法:To retrieve the translation rules assigned to a collection of trunk configuration settings, you can use syntax similar to this:

Get-CsTrunkConfiguration -Identity "global" | Select-Object -ExpandProperty OutboundTranslationRulesList

針對每個轉譯規則傳回類似下列的資訊:That returns information similar to this for each translation rule:

描述:沒有國家或地區代碼的電話號碼。Description : Phone numbers without a country code or area code.

模式: ^ \ + (\ d *) $Pattern : ^\+(\d*)$

Translation : $1

名稱: NoAreaCodeName : NoAreaCode

此時,您會檢查 Pattern 屬性的值 (它是 正則運算式 字串) ,以查看是否有任何轉譯規則設定為處理撥號號碼。At that point, you check the value of the Pattern property (which is a regular expression string) to see whether any of the translation rules are configured to handle the dialed number. 如果不是,您必須變更其中一個現有的規則 (CsOutboundTranslationRule) 或使用 New-CsOutboundTranslationRule 指令程式將新規則新增至集合。If not, you'll either have to change one of the existing rules (Set-CsOutboundTranslationRule) or use the New-CsOutboundTranslationRule cmdlet to add a new rule to the collection.