Bridge Communications

Saturday, July 11, 2015

Basic Call Control Using the Lync Client SDK III

Last week we learned how to put a Lync/Skype4b audio call on hold and how to resume it from hold.  This week we are going to learn how to park a call in orbit.  Parking takes the call off our client (although in Lync not really) and puts it in a parking lot, when any other user can call the retrieval number and take the call.  This can be useful when someone is roaming the building, that way they can unpark the call and answer it at the nearest phone.

Remember 2 weeks ago how we used the conversation object, when the same principal applies here, as we show an example of how to park a call.

try
            {
                if (c.CanInvoke(ConversationAction.Park))
                {
                    c.BeginPark(myar =>
                    {

                        c.EndPark(myar);

                        try
                        {
                            SetPropertyCall(c, ConversationProperty.Subject, (object)("Call Parked by : " + _yourname));
                        }
                        catch { }

                    }, null);
                }
            }
            catch (Exception ex)
            {
               Console.WriteLine(ex.Message);
            }

Now the call is in orbit in the Lync parking lot.  We can find a list of our parked calls by examining the following.  (and you'll see why I said not really above)

              object cpo;
              c.Properties.TryGetValue(ConversationProperty.CallParkOrbit, out cpo);

                            if (cpo != null)
                            {
                                  //YOU FOUND A PARKED CALL

                                CallParkOrbit mypark = (CallParkOrbit)cpo;

                                if (!string.IsNullOrEmpty(mypark.SafeRetrieveUri.ToString()))
                                {
                                      //THIS IS THE DIAL URI to RETRIEVE THE CALL
                                 }
                             }

You can have anyone dial the uri to retrieve the call, most often it's a 4 or 5 digit number, not anything terribly complicated.

Your normal parking lot numbers can be found here.


That will conclude this weeks blog on call parking with the Lync/Skype4b client sdk.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC Developer  BridgeOC
Twitter - @droutledge @ndbridge




No comments:

Post a Comment