Presence Provider

Introduction

The Presence Provider is a module which has the following characteristics:

The main drive to develop this feature is to lower the amount of SIPThe Session Initiation Protocol (SIP) is a protocol to make multimedia communication (audio, video and other data communication) possible and it is also used for Voice over IP (VoIP). SIP has similarities with other Internet protocols such as HTTP and SMTP. traffic for presence subscriptions. Therefore the module gathers the usage of agents for all UCC's inside a single application. For each unique agent, the Presence Provider will register only once. It will monitor the presence subscription and will restore the subscription if needed. That will happen in case the presence subscription is terminated or the endpoint used for the presence view is terminated.

 

Configuration

The presence provider needs a separate Application Id, an Application Endpoint (mandatory) and a User Endpoint (optional). The following additional settings can be configured in the configuration file.

<?xml version="1.0" encoding="utf-8"?>

<config version="1.5">

<License>license_app14_anywhere365_net.key</License>

<AgentProviderPort>10000</AgentProviderPort>

<PresenceProvider maxPresenceSubscriptionsPerSecond="15" failedPresenceSubscriptionsResubscribeDelay="900" maxFailedPresenceSubscriptionsPerUri="0">

<UcmaPresenceSource enabled="true" ApplicationId="urn:application:ucc_app01_presenceprovider" >

<UserEndpoint UserUri="sip:ucctestuser999@anywhere365.net" PoolFqdn="" />

<ApplicationEndpoint OwnerUri="sip:ucc_app01_presenceprovider@anywhere365.net" />

</UcmaPresenceSource>

<PstnPresenceSource enabled="true" />

<AttendantServiceSource enabled="true">

<Match pattern="workstreampeople.nl" />

<Match pattern="workstreampeople.com" />

</AttendantServiceSource>

</PresenceProvider>

The PresenceProvider Element contains 3 attributes

  1. FailedPresenceSubscriptionsResubscribeDelay = If a subscription has been failed this delay is applied before a next attempt is issued. Optional parameter. If not defined, the default is taken (900 seconds) [unit is seconds].
  2. MaxPresenceSubscriptionsPerSecond = Throttle for the maximum number of subscriptions per second. Optional parameter. If not defined, the default is taken (15 seconds) [unit is seconds].
  3. MaxFailedPresenceSubscriptionsPerUri = If this limit is exceeded, the Presence Provider quits with retrying. The subscription process is stopped for the particular Uri. If set to zero, this parameter is ignored. Default value if not specified (3).

 

The PresenceProvider Element can contain 3 different sources.

  • AttendantServiceSource =If enabled, then Agents that match the patterns defined in the configuration can use the AttendantService to manage their presence. This is for example used by the Snapper.
  • PstnPresenceSource = If enabled, then Agents that use a E164 lineuri as sipaddress (PSTN agents) will use this source. This source is managed internally by the UCC.
  • UcmaPresenceSource = If enabled, the fallback source if a not more specific source matches. This source reflects the Skype Presence which is obtained via UCMA. The source can be configured with a single Application Endpoint or a Single User Endpoint or both an Application and a User Endpoint. Both endpoints must be on premises. The Single User endpoint must exist, but not be used in a Skype client by a user.

 

Example for the example configuration:

Which PresenceSource is used by example@workstreampeople.com?

  • The AttendantServiceSource is enabled,
    • ' example@workstreampeople.com' does not match the pattern 'workstreampeople.nl'
    • 'example@workstreampeople.com' matches the pattern 'workstreampeople.com'
      • The AttendantServiceSource is used

 

Which PresenceSource is used by tel:+31612345678?

  • The AttendantServiceSource is enabled,
    • 'tel:+31612345678' does not match the pattern 'workstreampeople.nl'
    • 'tel:+31612345678 ' does not match the pattern 'workstreampeople.com'
  • The PstnPresenceSource is enabled
    • 'tel:+31612345678' matches an E164 lineuri
      • The PstnPresenceSource is used

 

Which presence source is used by example@anywhere365.net?

  • The AttendantServiceSource is enabled,
    • 'example@anywhere365.net' does not match the pattern 'workstreampeople.nl'
    • 'example@anywhere365.net ' does not match the pattern 'workstreampeople.com'
  • The PstnPresenceSource is enabled
    • 'example@anywhere365.net' does not match an E164 lineuri
  • The UcmaPresenceSource is enabled
    • The UcmaPresenceSource is used

You always want to enable the PstnPresenceSource if you are using PSTN Agents. It means that your PSTN Agents will not be called by a UCC if they are already in call with this UCC.

You may want to enable the AttendantServiceSource for Agents that use other clients in which they can set their presence, such as the Snapper.

You always want to enable the UcmaPresenceSource as a reliable fallback.

You want to configure a UserEndpoint in the UcmaPresecenSource if you are using a Hybrid environment and want to subscribe to presence on a user in the same topology that is homed on Skype Online. This does not apply when the user is federatedFederation makes it possible to communicate with customers, suppliers, partners and others, via Lync Server 2010 and Lync Server 2013, which are not in the same Lync environment. for the topology.

 

Attributes

UcmaPresenceSource has 2 attributes (enabled:true/false, ApplicationId)

  1. Enabled Indicates that this source is enabled
  2. ApplicationId (mandatory). This is an additional application id.

The source must contain 1 ApplicationEndpoint element and 0/1 UserEndpoint ​elements

ApplicationEndpoint has 1 attribute

  1. OwnerUri = The sipuri of the endpoint

​UserEndpoint has 2 attributes

  1. UserUri = The sipuri of the user
  2. PoolFqdn (optional) = the pool fqdnA fully qualified domain name (FQDN), sometimes also referred as an absolute domain name, is a domain name that specifies its exact location in the tree hierarchy of the Domain Name System (DNS). of the user, if autodiscovery fails (possible formats: <fqdn> / <fqdn:port>)

PstnPresenceSource has 1 attribute

  1. Enabled = Indicates that this source is enabled

AttendantServiceSource has 1 attribute

Enabled Indicates that this source is enabled

The source must contain 1 or more Match elements

Match has 1 attribute

  1. pattern= ​The regex pattern to match the presentity uri

 

Ucc service needs to be restarted for the changes to take effect. Every new subscribtion request that matches one of the patterns will be using the AttendentService presence source.

There is no limitation in the amount of Match elements added to the AttendantServiceSource element.

 

Logging

In this section some of the most interesting logging entries.

Description

Log

Configuration line, which shows all parameters. In this case one application endpoint and no user endpoint.

2018-05-08 14:05:26,467 [1] UccStarter INFO  - PresenceProviderConfiguration:: MaxFailedPresenceSubscriptionsPerUri: 3, FailedPresenceSubscriptionsResubscribeDelay: 60MaxPresenceSubscriptionsPerSecond 15, ApplicationId: urn:application:ucc_app14_1, ApplicationEndpoints:[sip:ucc_app01@anywhere365.net] UserEndpoints:[]

​​
​​

Request from within Ucc for subscribing an agent.

2018-05-08 14:05:48,159 [5] ucc_app01 INFO  - PresenceProviderClient::Subscribe sipUrisip:user1@domain.com

Presence change (Ucc level, reported on behave of the UCC)

2018-05-08 14:07:11,174 [6] ucc_app01 DEBUG - ucc_app01 Presence change: 'sip:user1@domain.com' Away : 15500 :  : Computer : SameEnterprise Formal:False, Active:True. WspModalityCapabilities: (audio: True, video: True, text: True)

Presence change event received by UCC. Reports both the new and the previous presence state. 

2018-05-08 14:05:49,222 [31] ucc_app01 INFO  - PresenceProviderClient::event PresenceChangedEventArgs:  PreviousPresence: [],  NewPresence: [PresenceNotificationEventArgs:: SipUri: sip:user1@domain.com WspModalityCapabilities: (audio: True, video: True, text: True), WspDeviceType: Computer, WspSourceNetwork: SameEnterprise, WspPresenceAvailability: Away, WspPresenceAvailabilityValue: 15500, ActivityToken: ]