編輯

共用方式為


Test-CsVoiceNormalizationRule

Tests a telephone number against a voice normalization rule and returns the number after the normalization rule has been applied. Voice normalization rules are typically used to convert a telephone dialing requirement (for example, you must dial 9 to access an outside line) to the E.164 phone number format. This cmdlet was introduced in Lync Server 2010.

Syntax

Test-CsVoiceNormalizationRule
    -DialedNumber <PhoneNumber>
    -NormalizationRule <NormalizationRule>
    [<CommonParameters>]

Description

This cmdlet allows you to see the results of applying a voice normalization rule to a given telephone number. Voice normalization rules are a required part of phone authorization and call routing. They define the requirements for converting--or translating-- numbers from a format typically entered by users to a standard (E.164) format. Use this cmdlet to troubleshoot dialing issues or to verify that rules will work as expected against given numbers.

Examples

-------------------------- Example 1 --------------------------

Get-CsVoiceNormalizationRule -Identity "global/11 digit number rule" | Test-CsVoiceNormalizationRule -DialedNumber 14255559999

For Lync or Skype for Business Server, this example runs a voice normalization test against the voice normalization rule with the Identity "global/11 digit number rule". First the Get-CsVoiceNormalizationRule cmdlet is run to retrieve the rule with the Identity "global/11 digit number rule". That rule object is then piped to the Test-CsVoiceNormalizationRule cmdlet, where the rule is tested against the telephone number 14255559999. The output will be the DialedNumber after the voice normalization rule "global/11 digit number rule" has been applied. If this rule does not apply to the DialedNumber value (for example, if the normalization rule matches the pattern for an 11-digit number and you supply a 7-digit number) no value will be returned.

-------------------------- Example 2 --------------------------

$a = Get-CsVoiceNormalizationRule -Identity "global/11 digit number rule"
Test-CsVoiceNormalizationRule -DialedNumber 5551212 -NormalizationRule $a

For Lync or Skype for Business Server, example 2 is identical to Example 1 except that instead of piping the results of the Get operation directly to the Test cmdlet, the object is first stored in the variable $a and then is passed as the value to the parameter NormalizationRule to be used as the voice normalization rule against which the test will run.

-------------------------- Example 3 --------------------------

Get-CsVoiceNormalizationRule | Test-CsVoiceNormalizationRule -DialedNumber 2065559999

For Lync or Skype for Business Server, this example runs a voice normalization test against all voice normalization rules defined within the Skype for Business Server deployment. First the Get-CsVoiceNormalizationRule cmdlet is run (with no parameters) to retrieve all the voice normalization rules. The collection of rules that is returned is then piped to the Test-CsVoiceNormalizationRule cmdlet, where each rule in the collection is tested against the telephone number 2065559999. The output will be a list of translated numbers, one for each rule tested. If a rule does not apply to the DialedNumber value (for example, if the normalization rule matches the pattern for an 11-digit number and you supply a 7-digit number) there will be a blank line in the list for that rule.

-------------------------- Example 4 --------------------------

$nr=(Get-CsTenantDialPlan -Identity dp1).NormalizationRules
$nr[0]

Description         :
Pattern             : ^(\d{4})$
Translation         : +1206555$1
Name                : nr1
IsInternalExtension : False

Test-CsVoiceNormalizationRule -DialedNumber 1234 -NormalizationRule $nr[0]

TranslatedNumber
----------------
+12065551234

For Microsoft Teams, this example gets all the normalization rules in the tenant dial plan DP1, shows the first of these rules, and then test that rule on the dialed number 1234. The output shows that the rule normalize the dialed number to +12065551234.

Parameters

-DialedNumber

The phone number against which you want to test the normalization rule specified in the NormalizationRule parameter.

Full Data Type: Microsoft.Rtc.Management.Voice.PhoneNumber

Type:PhoneNumber
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:Lync Server 2010, Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019, Microsoft Teams

-NormalizationRule

An object containing a reference to the normalization rule against which you want to test the number specified in the DialedNumber parameter.

For Lync and Skype for Business Server, you can retrieve voice normalization rules by calling the Get-CsVoiceNormalizationRule cmdlet. For Microsoft Teams, you can retrieve voice normalization rules by calling the Get-CsTenantDialPlan cmdlet.

Type:NormalizationRule
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:Lync Server 2010, Lync Server 2013, Skype for Business Server 2015, Skype for Business Server 2019, Microsoft Teams

Inputs

Microsoft.Rtc.Management.WritableConfig.Policy.Voice.NormalizationRule object. Accepts pipelined input of voice normalization rule objects.

Outputs

Returns an object of type Microsoft.Rtc.Management.Voice.NormalizationRuleTestResult.