Hello i been struggling a couple of hours trying to figure out how to get a list of users and their presence.
this is what i have right now:
private List<string> GetOperatorsPresence(List<string> sipTargets, ApplicationEndpoint appEndPoint) { appEndPoint.PresenceServices.BeginPresenceQuery( sipTargets, new string[] { "state" }, null, // EndGetFreeOperator result => { try { // Retrieve the results of the query. IEnumerable<RemotePresentityNotification> notifications = appEndPoint.PresenceServices.EndPresenceQuery(result); operatorAvailableList = new List<string>(); foreach (RemotePresentityNotification notification in notifications) { long v = notification.AggregatedPresenceState.AvailabilityValue; if (v >= 3000 && v <= 4499) { //online operatorAvailableList.Add(notification.PresentityUri); } else if (v >= 4500 && v <= 5999) { //idle online operatorAvailableList.Add(notification.PresentityUri); } } } catch (Exception ex) { Helper.Logger.Error(ex.ToString()); } }, null); waitForOperatorList.WaitOne(); return operatorAvailableList; }
But... is not working at all i think is is in some kind of endless loop :(
Could someone explain me how to use this method with a callback (not the event handler version) Thank you!
If you do not understand me try Spanish :)