Lync call handling script updated

Articles in the "Lync call handling script" series

  1. Trigger something whenever you’re on a Lync call
  2. Update to Lync call handling script
  3. Lync call handling script updated [This article]

The call handling script has been updated to version 1.4.4.  It resolves an issue that took me quite awhile to diagnose, where it would sometimes hang when signing out of Lync.  When the client state change event occurs, the corresponding function would check if you are signed in or not.  If not, it will unregister the off-hook handler event so it can be created anew when you sign in again.

The problem was because the client state change event fires multiple times when you sign out: once when signing out and again when you are signed out.  Since I was running the cmdlet to unregister the off-hook handler for any state that wasn’t equal to being signed in, the client state handler function was being called again (and attempting to unregister the off-hook handler event) before it could finish doing so the first time.  This caused the PowerShell session to hang.  The script now only unregisters the event if you are signed out, rather than on any event that isn’t equal to being signed in.

The script has also been updated to work with Lync 2013.  You will want to comment line 62 (and uncomment 63) if you are using Communicator or Lync 2010, or leave it as is if you are using Lync 2013.

  Monitor-LyncSelfActivityChange.zip (640.5 KiB)

Leave a Reply

Your email address will not be published. Required fields are marked *

*