Enable stateful SIP applications (LoggingNotice sample)

Lync 2013

Learn about the Microsoft Lync Server 2013 SDK LoggingNotice sample application.

Last modified: August 16, 2013

Applies to: Lync 2013 | Lync Server 2013

Note Note

By default, the LoggingNotice application is copied to the %progfile%\Microsoft Lync Server 2013\SDK\Samples\LoggingNotice folder. LoggingNotice and related code samples can also be downloaded from the MSDN Code Gallery.

The LoggingNotice application that is distributed with the Lync Server 2013 SDK shows how to implement stateful application logic and message modification. The application maintains dialog state, and appends text to the first IM in each session.

Session state is maintained in a Hashtable and indexed by call-id. An incoming ACK moves a dialog to the modify-IM state, where incoming IM messages are appended with warning text until all parties in the conversation are notified. A separate session-participant table is used to determine the parties that have already been notified, so that each party is notified one time only. When all parties in a session are notified, the session state is deleted.

Note Note

Clients that create a session and never send a message move the LoggingNotice application to the leak state.

If necessary, copy the %progfile%\Microsoft Lync Server 2013\SDK\Samples\LoggingNotice folder to a Microsoft Lync Server 2013 computer on which the application runs.

To build the application

  1. Open a command console in a user account that has elevated permission.

  2. Open the %progfile%\Microsoft Lync Server 2013\SDK\Samples folder.

  3. Use the following command to build the application.

    Compile LoggingNotice

To run the application

  1. Log on to a Lync Server 2013 RTC Server Applications local security group account.

  2. Copy the LoggingNotice.exe, LoggingNotice.exe.config, and LoggingNotice.am files to the %progfile%\Microsoft Lync Server 2013\Server\Core directory.

  3. Register the application by running the following commands in a Lync Server Management Shell window.

    Note Note

    <lync.Server.Fdqn> is the placeholder for the fully qualified domain name for the test server.

    new-csServerApplication -uri " http://www.microsoft.com/LC/SDK/Samples/LoggingNotice" -identity "service:registrar:<lync.Server.Fdqn>/LoggingNotice" -critical $false -priority 6 -enabled $true


    You must register the application before the managed code is invoked.

  4. Start the application by using the LoggingNotice.exe program.

  5. In two active client sessions, add each client to the other client contact list, if not already present. Start a new IM session and then send messages in both directions. The following text appears in the first IM message that is sent to each client:

    (*** This conversation may be logged. ***)