If you have ever had to configure multiple Pools with associated gateways you may have noticed that creating a resilient routing environment can be a challenge.
For instance, its rather common to setup route failover by simply adding the alternative route\s in the Associated PSTN Usages. Ken Lasko has documented this and the associated misconception here. Nice post Ken 🙂
What if you need to route to the same SBC from any (or a selection of your choice) Mediation Server? Simple you may say..
A common mistake\assumption is that if you add all the Mediation server and Gateway combinations in the Topology builder so that a view of the PSTN Gateways reveals all the required Mediation Servers (as in the image below) then the routing logic would select whatever Mediation Server was available.
THIS IS INCORRECT.
Once you have added the Trunks and the associated Mediation Servers you will notice the view of the PSTN Gateway tab similar to below.
So here I have 4 Mediation Servers to route to, the first marked as Root. What does this Root mean?
The Initial Mediation Server that was selected when you add the PSTN Gateway in the Topology is considered the Root. When you are selecting the Associated Trunk in Voice Routing, the PSTN Gateway Name is presented (in My case I used the IP Address as the name – 10.50.253.3 also referred to as AKL_SBC_02 in my Trunks)
. . This also means that outbound calls will use ONLY the associated Mediation Server referred to as per the Root Trunk. You can test this by disabling the Lync Mediation Service, you will notice that you cant make any outbound calls.
WARNING – If you have multiple PSTN Usages associated then the Voice Policy the call may failover to the next PSTN Usage in the list, this may fool you into believing that the next Mediation Server was selected.
How do you add additional Mediation Servers to allow routing of Lync calls to the same gateway?
This is done from the Voice Policy when selecting the Associated Trunks. When you click Add you will notice that the trunks added in the Topology builder are shown.
In my example I have 4 trunks for each gateway. That’s because I have 4 Mediation Servers and wanted a Trunk to represent each Gateway and Mediation Server combination. Looking at the next image you will see all 4 my options, the first highlighted in yellow is the Root Trunk for this PSTN Gateway, the other 3 are one each for each mediation server that will connect to the same Gateway.
So the Associated Trunks represent each Mediation Server that will connect to the SBC and after selecting each Trunk as required looks as follows:-
The next question is how to order the Mediation Server selection order. The short answer is that the Root is always selected as the first choice as long as its available. The other remaining Mediation Servers are selected in a random order and can not be managed.
To test, simply stop the Lync Mediation Service on each Front End to force the selection of the next available Mediation Service.