In the previous article we upgraded our directory synchronization server from the older DirSync to the latest version of AAD Connect to prepare our Skype for Business hybrid environment for Office 365 E5 Cloud PBX with on-premise PSTN Connectivity. In this article, we will configure our Skype for Business on-prem environment with a simulated PSTN connectivity using an Asterisk IP-PBX. We will create the necessary PSTN Gateway and Trunk from the Skype for Business side, and configure the corresponding SIP trunks and inbound/outbound routes on the Asterisk side. Then we will register a Polycom VVX600 and Polycom Trio8800 using accounts homed on the on-premise Skype for Business and make sure they are able to call extensions on the Asterisk IP-PBX. Once this is completed, we will move those accounts to Office365 E5 and test the voice functionality again to confirm that on-premise PSTN connectivity is working. Below is the diagram of the initial setup before moving accounts to Office365: |
Section 1/2: Configuring Skype for Business for on-premise PSTN Connectivity
We first need to configure our mediation server pool to listen on TCP 5060. By default this is not enabled and the mediation server only listens on TLS 5067. To do this we use topology builder and modify the properties of the Front End Pool to enable the TCP listening port 5060 on the mediation server as shown below:
Once completed we proceed to create a new voice route for the PSTN Gateway (Asterisk PBX). Using the Skype for Business Server Control Panel, we add a new voice route and specify the matching pattern for calls going to. As shown below, the numbers matching the pattern "+656445XXXX" will make use of this PSTN Gateway:
Section 2/2: Configuring Asterisk IP-PBX as a PSTN Gateway for Skype for Business on-premises
Now that we have completed the Skype for Business configurations, we proceed to configure the Asterisk IP-PBX. For our lab we are using FreePBX-5.211.65 which is bundled with Asterisk IP-PBX. The full name of the iso image is FreePBX-5.211.65-21-i386-Full-1416756098.iso and the Asterisk version is 11.14.1. This is not the latest version of FreePBX/Asterisk at the time of this post, as the I find that the older version is much simpler to configure and manage. The basic steps of installing and configuring FreePBX/Asterisk on Windows Server Hyper-V are already covered in this article http://www.ucprimer.com/tech-blog/lync-asterisknow-20-integration-guide and won't be repeated here. Therefore, only the key configurations will be mentioned here.
After the FreePBX/Asterisk installation is complete, we need to create a SIP Trunk for the Skype for Business Front End Pool which in this lab consists of 3 Front End servers. The FreePBX GUI will allow us to define a SIP Trunk to the first Front End server as shown below. In the Dialed Number Manipulation Rules, we defined a new rule for normalizing 4 digit extension dialing from Asterisk so that the full E.164 number will be sent over to Skype for Business Mediation Server. We also need to define the PEER Details as shown:
host=10.250.27.52 // This is the IP address of the first FE Server
transport=tcp
type=friend
port=5060
insecure=very
fromdomain=10.222.210.70 // This needs to match the IP address of the Asterisk IP-PBX
context=from-internal
promiscredir=yes
qualify=yes
canreinvite=yes