With PSTN usage records, we specify what is managed as a local call, a long distance call, an international call and so on. We must connect PSTN usage records with voice policies (assigned to users) and routes (assigned to phone numbers). What we are going to see now is a possible sequence of steps to configure voice policies and PSTN usages. However, there is no fixed order in Lync, so there is no single way to organize the various aspects of Enterprise Voice. Microsoft TechNet offers some information, starting with the Deploying Enterprise Voice in Lync Server 2013 post at http://technet.microsoft.com/en-us/library/gg412876.aspx. The suggested order in the previously mentioned document is as follows:
Another aspect to consider is that there is no predefined naming convention. A recommended approach could be the following one, suggested by Ken Lasko:
site:site001
) is the last one we are going to create, and it allows local, national, and mobile calls:New-CSVoicePolicy "UK-London-Local" -Description "Allows local calls from London, United Kingdom" New-CSVoicePolicy "UK-London-National" -Description "Allows local/national calls from London, United Kingdom" New-CSVoicePolicy "UK-London-International" -Description "Allows local/national/international calls from London, United Kingdom" New-CSVoicePolicy site:site001 -Description "Allows local/national calls from London, United Kingdom"
Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-Local"} Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-Service"} Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-National"} Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-Mobile"} Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-Premium"} Set-CsPSTNUsage -Identity global -Usage @{Add="UK-London-International"}
Again, our PSTN usage policies are empty and will be populated later.
Set-CsVoicePolicy -Identity site:site001 -PstnUsages UK-London-Local Set-CsVoicePolicy -Identity site:site001 -PstnUsages UK-London-Mobile Set-CsVoicePolicy -Identity site:site001 -PstnUsages UK-London-National Set-CsVoicePolicy -Identity site:site001 -PstnUsages UK-London-Service
Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-Local Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-Mobile Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-National Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-Service Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-Premium Set-CsVoicePolicy -Identity UK-London-International -PstnUsages UK-London-International
Set-CsVoicePolicy -Identity UK-London-National -PstnUsages UK-London-Local Set-CsVoicePolicy -Identity UK-London-National -PstnUsages UK-London-Mobile Set-CsVoicePolicy -Identity UK-London-National -PstnUsages UK-London-National Set-CsVoicePolicy -Identity UK-London-National -PstnUsages UK-London-Service Set-CsVoicePolicy -Identity UK-London-Local -PstnUsages UK-London-Local Set-CsVoicePolicy -Identity UK-London-Local -PstnUsages UK-London-National
New-CSVoiceRoute -Name "UK-London-Local" -Priority 0 -PSTNUsages "UK-London-Local" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+4420([378]d{7})$' -Description "Local routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-Mobile" -Priority 2 -PSTNUsages "UK-London-Mobile" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+447([1-57-9]d{8}|624d{6})$' -Description "Mobile routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-TollFree" -Priority 3 -PSTNUsages "UK-London-Local" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+44(80(0d{6,7}|8d{7}|01111)|500d{6})$' -Description "TollFree routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-Premium" -Priority 4 -PSTNUsages "UK-London-Premium" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+44(9[018]d|87[123]|70d)d{7}$' -Description "Premium routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-National" -Priority 5 -PSTNUsages "UK-London-National" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+44(1[1-9]d{7,8}|2[03489]d{8}|3[0347]d{8}|5[56]d{8}|8((4[2-5]|70)d{7}|45464d))$' -Description "National routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-International" -Priority 7 -PSTNUsages "UK-London-International" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+((1[2-9]dd[2-9]d{6})|(?(?!(44))([2-9]d{6,14})))$' -Description "International routing for London, United Kingdom" New-CSVoiceRoute -Name "UK-London-Service" -Priority 6 -PSTNUsages "UK-London-Service" -PSTNGatewayList test.wonderland.lab -NumberPattern '^+(1(47d|70d|800d|1[68]d{3}|dd)|999|[*#][*#d]*#)$' -Description "Service routing for London, United Kingdom"
In the various steps, to keep the logic as clear as possible, I have used a cmdlet for every single configuration. A more compact form is the one that uses the @
operator. For example, we can define the International
voice policy with the following single cmdlet:
Set-CsVoicePolicy -Identity UK-London-International -PstnUsages @{add="UK-London-Local", "UK-London-Mobile", "UK-London-National", "UK-London-Service", "UK-London-Premium", "UK-London-International"}
Yoav Barzilay has published an interesting script that allows assigning Lync policies (with a user scope, including voice policies) to Lync-enabled users based on their membership in an Active Directory group. The script requires administrative rights to run. The Lync Management Shell and the Active Directory PowerShell module are required on the computer where the script will run. To download the script and know more about it, please refer to this post Assign Lync Policies To Lync Users Based On Active Directory Group Membership at http://y0av.me/2014/07/07/adpt/.
3.133.138.14