Media Bypass

Media Bypass is a new feature in Lync 2010 enabling media to flow directly between clients and PSTN gateways. The basic concept is that the client and the Mediation Server exchanges BypassId’s and if the Id’s match each other media bypass is possible, but not guaranteed (as I’ll discuss later). The BypassId’s are assigned either globally, in which case all servers and clients use the same Id, or per network site, in which case the Id is assigned per subnet membership of the servers and clients. You can control if media bypass is used per PSTN Gateway using Set-CsTrunkConfiguration –EnableBypass.

As I wrote above it is the Mediation Server responsible for the PSTN gateway, which will decide if media bypass can be established. It happens during the signaling in the call setup phase. The PSTN gateway is not necessarily involved.

I’ve set it up in my lab and wanted to share some learning's:

  • When changing between enabling Media Bypass Globally and enabling it based on sites and regions make sure to sign out and in again on the client after you’ve made the change. The reason is that the client receives its BypassId via in-band provisioning in the mediaConfiguration provisioningGroup

    <provisionGroup name="mediaConfiguration" >
    <propertyEntryList >
    <property name="bypassEnabled" >true</property>
    <property name="internalBypassMode" >Any</property>
    <property name="externalBypassMode" >Off</property>
    <property name="bypassId" >c61755ed-402f-4b3b-86e2-2bd96252a23c</property>

  • An easy way to determine, if a given call was using media bypass, is to look at the QoE report sent after the call. You can look at it via the Monitoring Server (User Activity Report –> <user you want to look for> –> Details –> Media Quality Report –> Call Information –> Mediation Server bypass call (true/false). You can also look at it in the uccapilog via Snooper. Find the SERVICE message being sent after the call was completed and look in the XML blob for the tag <v2:MediationServerBypassFlag>true</v2:MediationServerBypassFlag>

  • As I wrote above the BypassId’s needs to match, but that is not enough to get media bypass. The other requirement is that the two end-points are able to communicate media directly between them. This includes network connectivity, but also that the media encryption level being used by both end-points matches. Out of laziness my PSTN gateway was configured to use TCP and RTP to communicate with the Mediation Server. That worked perfect without media bypass, but it didn’t enable media bypass. The client was configured to RequireEncryption (Set-CsMediaConfiguration –EncryptionLevel) and as such wanted to use SRTP for media. Since the PSTN gateway didn’t accept or offer that media bypass was not working. I had to re-configure my PSTN gateway to use TLS and SRTP to get media bypass working.