Learn about the Microsoft Lync Server 2013 SDK ClientVerFilter sample application.
By default, the ClientVerFilter application is copied to the %progfile%\Microsoft Lync Server 2013\SDK\Samples\ClientVerFilter folder. ClientVerFilter and related code samples can also be downloaded from the MSDN Code Gallery.
The ClientVerFilter application that is distributed with the Lync Server 2013 SDK shows how to use a script-only SIP application to enforce a simple user-based IM filtering policy. The application includes an application manifest file (ClientFilter.am) and two configuration files (FullMatch_Config.txt and PartialMatch_Config.txt). The configuration files are used to specify a list of permissions for various versions of the Microsoft Lync 2013 client.
The following logic is implemented by the Microsoft SIP Processing Language (MSPL) script:
Get the UserAgentheader value for the incoming Request instance.
Get the permission by using the FullMatch_Config file setting for the obtained user agent.
Do a prefix match by using the partial-match configuration setting for the obtained user agent to determine the final client permission.
If the client permission is "allow", then route the message back to the server by calling the ProxyRequest function. Otherwise, reject the request with a 403 Response that contains a Forbidden error message.
The sample application accesses the configuration text files through the declaration of the applicationManifest element elements that are listed in the application manifest and the application parses the data by using column names. The file is not declared as static and the application will reread the file when the file content changes.
You may have to change any occurrences of Log("Debug", …);in the application manifest to Log("Debugr", …);, if they are not already updated.
Testing the application
If necessary, copy the %progfile%\Microsoft Lync Server 2013\SDK\Samples\ClientVerFilter folder to a Microsoft Lync Server 2013 computer on which the application runs.
To run the application
Log on to the Lync Server 2013 computer by using an RTC Server Applications local security group account.
Update the configuration files, and then copy the application manifest (.am) and configuration files to the %progfile%\Microsoft Lync Server 2013\Server\Core folder.
Register the application by running the following commands in a Lync Server Management Shell window:
<lync.Server.Fdqn>is the placeholder for the fully qualified domain name for the test server. You may have to change the priority value so that it is larger than the UserServicesapplication value.
new-csServerApplication -uri " http://www.microsoft.com/LC/SDK/Samples/ClientFilter" -identity "service:registrar:<lync.Server.Fdqn>/ClientFilter" -critical $false -priority 6 -scriptname ClientFilter.am -enabled $true
Send IM messages to another user by using various Lync 2013 clients.