Learn about the Microsoft Lync Server 2013 SDK ApplicationStamping sample application.
By default, the ApplicationStamping application is copied to the %progfile%\Microsoft Lync Server 2013\SDK\Samples\ApplicationStamping folder. ApplicationStamping and related code samples can also be downloaded from the MSDN Code Gallery.
The ApplicationStamping application that is distributed with the Lync Server 2013 SDK shows how to use a script-only SIP application to tag a message with a string that is used to communicate between two identical application instances that run on different Microsoft Lync Server 2013 computers in the same topology. A message stamp is exposed on the Stampproperty of a Message (MSPL) instance and is visible only to the applications of the same URI.
The following logic is implemented by the Microsoft SIP Processing Language (MSPL) script:
Inspect the Stampproperty on the incoming request ( sipRequest.Stamp).
If the stamp is unspecified (not null), append the "+" character to the existing stamp. Otherwise, assign a ServerPoolvalue to the message stamp.
Route the newly stamped message to the server by calling the ProxyRequest function that uses an empty string as the URI parameter value.
Other features that are implemented include logging the application run time to ApiLogger by using Logfunction.
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\ApplicationStamping folder to a Lync Server 2013 computer on which the application runs.
To run the application
Log on to the Lync Server 2013 RTC Server Applications local security group account.
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/ApplicationStamping" -identity "service:registrar:<lync.Server.Fdqn>/ ApplicationStamping " -critical $false -priority 6 -scriptname ApplicationStamping.am -enabled $true
Send IM messages from a SIP client to another user.