Troubleshooting UCMA applications-Lync, DNS entries, and failed calls

One of the most frustrating things that you can run into when working with UCMA is starting your application, placing a call (or IM) to it, and having that call fail.  As far as your code is concerned, everything is great.  Calls worked yesterday, calls work for other developers, but for some reason, your call is failing.  At this point, the only real way to track down what’s going on is to go on the server and run OCSLogger.exe and trace the call.

At this point, you may notice that Lync is routing calls to the wrong IP address, which can happen for several reasons, usually to do with something like switching from wired to wireless, or going on or off a VPN.  If you go to a command prompt and run an nslookup on your machine, you may even see the same, incorrect address coming back.  If you run the same nslookup from the lync server, you’ll almost definitely see the wrong address coming back from DNS. 

The solution to this is reasonably simple.  From your dev machine, run “ipconfig /registerDNS”, which forces your DNS registration to update with your actual IP address.  Then run “ipconfig /flushDNS” and then nslookup to verify that the new address is being returned.  Do the same on the lync server (flush DNS and nslookup) to verify that everyone does indeed know what the correct address for your server is.  Now, try your call again. 

Surprise-your call will probably fail this time too!  Even though the OS knows what your IP address is now, Lync appears to keep its own DNS cache that I have yet to find a way to clear.  The good news is that it will time out (it appears to be about 15 minutes) so calls will eventually work again.  If you’re really impatient though, you can restart the front end service at this point, however this isn’t always an option. 

Now, the likelihood of this coming up in production is pretty minimal, but in development I’ve run into it all the time.  It’s a fairly simple fix once you know what to look for.  Note that if anyone knows how to clear the internal Lync DNS cache from powershell, please let me know in the comments.

This entry was posted in Unified Communications and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s