Microsoft Lync and Skype for Business have a rich set of .NET APIs which make it easy to extend the platform and integrate it with other applications. This blog helps explain how to use those APIs.

Calling an Exchange UM voicemail box directly

Posted: January 22nd, 2012 | Author: | Filed under: Lync Development, UCMA 2.0, UCMA 3.0 | Tags: , | 4 Comments »

A few posts ago I explained how you can determine whether a call placed by your UCMA application has been answered by an Exchange voicemail box. In this post I want to share another quick tip on UCMA and voicemail: how to place a call directly to a voicemail box.

If you use the Lync client much you’re probably aware that you can call a contact’s Exchange voicemail box directly by selecting one of the options in the “call” menu next to the person’s name. This comes in handy from time to time when you want to leave someone a message without actually calling them and waiting for the phone to ring or possibly disturbing them.

Call voicemail button in LyncWhat if you want to do the same thing — call someone’s voicemail box directly — from a UCMA application? If you’ve ever looked for a built-in way to do this in UCMA, you were probably disappointed. There is no BeginCallVoicemail method, and no DirectToVoicemail flag on AudioVideoCallEstablishOptions. So how do you do it?

As it turns out, you can call an Exchange UM voicemail box directly by tacking on ;opaque=app:voicemail to the end of the corresponding Lync user’s SIP URI. So, for example, to call the voicemail box of sip:user@domain.local, you would do something like this:

Conversation conversation = new Conversation(_endpoint);
AudioVideoCall avCall = new AudioVideoCall(conversation);

avCall.BeginEstablish("sip:user@domain.local;opaque=app:voicemail", OnCallEstablished, null);

That’s all there is to it. Instead of ringing to the user’s various active endpoints, it will go straight to the voicemail box. You can use the same SIP URI format for other operations, like transfers.

4 Comments on “Calling an Exchange UM voicemail box directly”

  1. 1 Greg Thomas said at 12:33 pm on January 23rd, 2012:

    Cool trick Michael, thanks.

  2. 2 Chris Barkley said at 12:31 pm on December 19th, 2012:

    Is there a way to use the same SIP URI directly in Lync client? When I try it i just calls the user, it doesn’t go straight to their voicemail.

  3. 3 Michael said at 11:44 pm on December 19th, 2012:

    No, entering it in the Lync client UI doesn’t work. You can call someone’s voicemail directly from the client though by going to the “call” menu next to someone’s name in the contact list and selecting “Voice Mail.”

  4. 4 charles said at 5:51 pm on April 14th, 2015:

    hi I have been playing around with MSPL (still very new) scripts but haven’t had any luck so far. I am looking for a way to route pstn calls to list of users that will go directly to voice mail. Thanks for your help.

Leave a Reply

  • Note: Comment moderation is in use because of excessive spam. Your comment may not appear immediately.