One fine day one of the solutions sales engineers approached me with a problem which was turning out to be a blocker for a very huge contract.

They needed a solution to this very badly. Problem was that their customer wanted to enable federation with other domains but they did not want to allow any p2p audio video calls with the federated domains but wanted to have audio video in conference calls.

Following is the solution I gave and it worked like a charm.

 Lync Server does not have any built in option to block audio/video calls with a federated domain but it can be achieved by using a MSPL application deployed on Edge Servers.

 Following is the MSPL script and the steps to install and configure the application.

<?xml version="1.0"?> <lc:applicationManifest lc:appUri="http://fabrikam.com/BlockFederatedAudioCalls" xmlns:lc="http://schemas.microsoft.com/lcs/2006/05"> <lc:requestFilter methodNames="INVITE" strictRoute="true"  phoneUris="true"/>   <lc:responseFilter reasonCodes="ALL"/>   <lc:scriptOnly/>   <lc:proxyByDefault action="true"/> <lc:splScript><![CDATA[

                if (sipRequest) {                         

if (!ContainsString(sipRequest.To, "conf:audio-video"))    

    {

      if (ContainsString(sipRequest.From, "@contoso.com"))   

 {          if (IndexOfString(sipRequest.Content, "m=audio") >= 0)       

        {     

Respond(403, "AV call with federated domain is not allowed"); 

 }     

}

                                                  if (ContainsString(sipRequest.To, "@contoso.com")) 

{     

if (IndexOfString(sipRequest.Content, "m=audio") >= 0)   

{       

Respond(403, "AV call with federated domain is not allowed");    

  }       

}    

     }

                  }          ]]>

</lc:splScript> </lc:applicationManifest>

 

Following are the Steps to deploy the application

1. Modify the Script replace @contoso.com with the domain name of the Federated partner and save the file as BlockFederatedAudioCalls.am    in following folder C:\LyncScripts\BlockFederatedAudioCalls  on all the Edge Servers.

2. On FrontEnd Server run following command to create a server application

New-CsServerApplication -Identity "EdgeServer:edgepool.fabrkam.com/BlockFederatedAudioCalls" -Uri "http://fabrikam.com/BlockFederatedAudioCalls" -ScriptName "C:\LyncScripts\BlockFederatedAudioCalls\BlockFederatedAudioCalls.am" -Enabled $true

3. This change needs to be replicated to all the Edge Servers so wait for CMS  replication to complete with Edge servers    Or Export the Configuration and Import it on the Edge servers.

5. Restart Access Edge Service on All Edge Servers