Configuring PSTN usage – voice policy

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:

  • Deploying mediation servers
  • Configuring trunks with PSTN gateways, IP-PBXs, or using SIP with an Internet Telephony Service Provider (ITSP)
  • Defining dial plans
  • Configuring the following parameters:
    • Voice policies
    • PSTN usage records
    • Voice routes
  • Integrating with Exchange
  • Deploying advanced voice features such as call admission control, emergency services (E9-1-1), media bypass, and Location-Based Routing

Another aspect to consider is that there is no predefined naming convention. A recommended approach could be the following one, suggested by Ken Lasko:

  • PSTN usage names relate to calls of the same type, such as local, long distance/national, or international. If we have multiple sites, it is useful to add site information in the country-state/prov-city-callclass or country-city-callclass (for example, UK-London-Local) format. We can use the same naming convention for voice policies.
  • Routes: at least five for each gateway, that is, local, national (long distance), international, toll-free, and service codes (for example, UK-London-TollFree).
  • National and international routes will be added into the national and international PSTN usages respectively. Local, toll-free into the local PSTN usage. It is a good idea to add service codes into a dedicated PSTN usage (service PSTN usage). Service numbers generally don't work outside of the country, and this could result in unintended behavior when using least-cost routing.
  • Normalization rules: country-state/prov-city-routeclass or country-city-routeclass.

How to do it...

  1. We will start with creating empty voice policies that are not associated with PSTN usage records. The logic here is to have three different profiles of authorization for our Lync users: local calls, national calls, and international calls. The default policy for our site (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"
  2. For every policy, we will receive the following screentext: WARNING: No PSTN Usage specified. Users granted this Voice Policy will not be able to make outbound PSTN calls. We will populate them later.
  3. Now, we have to define PSTN usage policies. The logic will be the same that we used for voice policies, with different policies to identify different levels of service:
    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.

  4. Now, it is possible to associate the voice policies and the PSTN usage policies. We will start with the default voice policy associated with the site:
    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
  5. Then, we will associate PSTN usage policies with the remaining voice policies, starting with the one that authorizes international/premium calls:
    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
  6. Let's proceed with the authorization policy for national and local calls:
    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
  7. The following cmdlets will perform the last step, generating voice routes and associating them with PSTN usage records. The scenario that we are using has a single PSTN gateway. If there are multiple gateways, the rules have to be modified accordingly:
    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"

There's more...

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"}

See also

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/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.217.198