共用方式為


Lync Server Admin Guide: Configuring Voice Routing

This article is part of the Microsoft Lync Server 2010 Administration Guide: PowerShell Supplement.

Configuring Dial Plans and Normalization Rules

Create a Dial Plan

  • To create a dial plan

To create a new dial plan, use the New-CsDialPlan cmdlet:

 

New-CsDialPlan -Identity site:Redmond -SimpleName RedmondSiteDialPlan

 

The following command creates a new dial plan, then uses the New-CsVoiceNormalizationRule cmdlet to immediately add a new normalization rule to that dial plan:

 

New-CsDialPlan -Identity site:Redmond -SimpleName RedmondSiteDialPlan

 

New-CsVoiceNormalizationRule -Identity "site:Redmond/SeattlePrefix" -Pattern "^9(\d*){1,5}$" -Translation "+1206$1"

Modify a Dial Plan

  • To modify a dial plan

To modify a dial plan, use the Set-CsDialPlan cmdlet:

Set-CsDialPlan -Identity RedmondDialPlan –ExternalAccessPrefix 8

 

 

For more information

 

 

 

Create or Modify a Normalization Rule Manually

  • To define a normalization rule manually

To create a new voice normalization rule, use the New-CsVoiceNormalizationRule cmdlet. The following rule has the name SeattleFourDigit and will be assigned to the dial plan SeattleUser:

New-CsVoiceNormalizationRule -Parent SeattleUser -Name SeattleFourDigit -Description "Dialing with internal four-digit extension" -Pattern '^(\d{4})$' -Translation '+1206555$1'

 

For more information

 

 

 

Configuring Voice Policies, PSTN Usage Records, and Voice Routes

Configuring Voice Policies and PSTN Usage Records to Authorize Calling Features and Privileges

Create a Voice Policy and Configure PSTN Usage Records

  • To create a voice policy

To create a new voice policy, use the New-CsVoicePolicy cmdlet:

New-CsVoicePolicy –Identity UserVoicePolicy2 -AllowSimulRing $False -PstnUsages @{Add = "Local"}

Modify a Voice Policy and Configure PSTN Usage Records

  • To modify a voice policy

To modify an existing voice policy, use the Set-CsVoicePolicy cmdlet:

Set-CsVoicePolicy UserVoicePolicy2 -AllowSimulRing $False -PstnUsages @{add = "Long Distance"}

 

View PSTN Usage Records

  • To view a PSTN usage record

To view all your PSTN usage records, use the Get-CsPstnUsage cmdlet:

 

Get-CsPstnUsage | Select-Object –ExpandProperty Usage

 

Configuring Voice Routes for Outbound Calls

Create a Voice Route

  • To create a voice route

To create a new voice route, use the New-CsVoiceRoute cmdlet:

 

New-CsVoiceRoute -Identity Route1 -PstnUsages @{add="Long Distance"} -PstnGatewayList @{add="PstnGateway:redmondpool.litwareinc.com"}

Modify a Voice Route

  • To modify a voice route

To modify a voice route, use the Set-CsVoiceRoute cmdlet:

 

Set-CsVoiceRoute -Identity Route1 -Description "Test Route"

 

The following commands use both the Get-CsVoiceRoute and Set-CsVoiceRoute cmdlets to add a new PSTN gateway to a voice route:

 

$y = Get-CsVoiceRoute -Identity Route1

$y.PstnGatewayList.Add("PstnGateway:192.168.0.100")

Set-CsVoiceRoute -Instance $y

For more information

Configuring Trunks and Translation Rules

Configure Media Bypass on a Trunk

  • To configure media bypass on a trunk

To enable media bypass for a new SIP trunk, use the New-CsTrunkConfiguration cmdlet and set the EnableBypass property to True:

New-CsTrunkConfiguration -Identity site:Redmond -EnableBypass $True –MaxEarlyDialogs 40 –SRTPMode Required

Configure a Trunk Without Media Bypass

  • To configure a trunk without media bypass

To disable media bypass for a new SIP trunk, use the New-CsTrunkConfiguration cmdlet and set the EnableBypass property to False:

 

New-CsTrunkConfiguration -Identity site:Redmond -EnableBypass $False –MaxEarlyDialogs 40 –SRTPMode Required

 

Defining Translation Rules

Create or Modify a Translation Rule Manually

  • To define a translation rule manually

To create a new translation rule use the New-CsSipResponseCodeTranslationRule cmdlet:

New-CsSipResponseCodeTranslationRule -Identity "PstnGateway:192.168.0.240/Rule404" -ReceivedResponseCode 434 -TranslatedResponseCode 404

For more information

Exporting and Importing Voice Routing Configuration

Export a Voice Route Configuration File

  • To export a voice routing configuration

With Windows PowerShell you cannot directly export a voice route in the VCFG file format used by the Lync Server Control Panel. However, it is possible to export a voice route in an XML format that can later be imported using Windows PowerShell:

Get-CsVoiceRoute –Identity "RedmondRoute" | Export-Clixml –Path "C:\Routes\RedmondRoute.xml"

Import a Voice Route Configuration File

  • To import a voice routing configuration

To import a voice route that was previously exported using the Export-Clixml cmdlet, use the following command:

Import-Clixml –Path "C:\Routes\RedmondRoute.xml" | Set-CsVoiceRoute

For more information

Test Voice Routing

Create a Voice Routing Test Case

  • To create a test case

To create a new test case for voice routing, use the New-CsVoiceTestConfiguration cmdlet:

New-CsVoiceTestConfiguration -Identity TestConfig1 -DialedNumber 5551212 -ExpectedTranslatedNumber +5551212

Run Voice Routing Test Cases

  • To run all voice routing test cases

Use the following command to run all your voice routing test cases, one after another:

Get-CsVoiceTestConfiguration | Test-CsVoiceTestConfiguration

 

 

  • To run one or more selected voice routing test cases

Use the following command to run a specific voice routing test case:

 

Get-CsVoiceTestConfiguration -Identity TestConfig1 | Test-CsVoiceTestConfiguration

For more information