在 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 提示符处运行以下命令: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 内部企业语音网络连接到以下任一项:SIP trunks connect the Lync Server internal Enterprise Voice network to any of the following:

  • 公开交换的电话网络 (PSTN) 。The Public Switched Telephone network (PSTN).

  • (PBX) 的 IP 公共分支 exchange。An IP-public branch exchange (PBX).

  • (SBC) 的会话边界控制器。A Session Border Controller (SBC).

Test-CsTrunkConfiguration cmdlet 验证) 用户拨打的电话号码 (是否可以转换为 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 中继配置设置的实例;然后,将该实例通过管道传递到 Remove-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 可以呼叫已拨打的号码,则转换的电话号码将 (以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全球/雷德蒙+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 cmdlet 将新规则添加到集合中。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.