I'm publishing a user presence in a Trusted Application Endpoint, but I also would like to clear this presence when it is no longer needed.
Is the only option to do so to terminate the UserEndpoint instance?
I'm using this code snippet:
user.Endpoint.LocalOwnerPresence.BeginPublishPresence(
user.categories,
arBeginPublishPresence =>
{
try
{
user.Endpoint.PresenceServices.EndUpdatePresenceState(arBeginPublishPresence);
logger.log("Published presence for {0} with state {1}.", user.SipUserUri, newState.Availability);
}
catch (RealTimeException ex)
{
logger.log("Failed publishing presence for {0}. {1}", user.SipUserUri, ex);
}
},
null);
where user.Endpoint is the UserEndpoint for that user, and user.categories are the list of PresenceCategoryWithMetaData objects.