title: Clearing a published presence with UCMA 3.0
body: <p>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. </p>
  
  <p>Is the only option to do so to terminate the UserEndpoint instance?</p>
  
  <p>I'm using this code snippet:</p>
  
  <pre><code>    user.Endpoint.LocalOwnerPresence.BeginPublishPresence(
          user.categories,
          arBeginPublishPresence =&gt;
          {
              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);
  </code></pre>
  
  <p>where user.Endpoint is the UserEndpoint for that user, and user.categories are the list of PresenceCategoryWithMetaData objects.</p>