Subscription Management

Finesse clients can interface directly with the Cisco Finesse Notification Service to send subscribe and unsubscribe requests. Clients subscribe to notification feeds published to their respective nodes (such as /finesse/api/User/1000) by following the XEP-0060 standard.

Each agent is automatically subscribed to the following notification feeds, where {id} represents the agent ID for that agent:

  • User - /finesse/api/User/{id}

  • Dialogs - /finesse/api/User/{id}/Dialogs

  • Media - /finesse/api/User/{id}/Media/{mrd-id}

  • SystemInfo - /finesse/api/SystemInfo

To receive notifications for feeds to which they are not automatically subscribed, clients must explicitly subscribe to the node on which the notifications are published. For example, agent state change notifications for all agents on a specific team are published to the node /finesse/api/Team/{id}/Users. Clients must request a subscription to this node to receive notifications on this feed.

To avoid increasing notification traffic for other users, use a full JID (username@domain/resource) when making explicit subscriptions.

Make sure to unsubscribe to any explicit subscriptions before disconnecting the XMPP session. Any subscriptions that are left behind persist on that node in the Cisco Finesse Notification Service.

The following example shows how to subscribe to agent state change notifications for a specific team:

Code Snippet
Copy
<iq type='set'
    from='CharlesNorrad@finesse-server.cisco.com'
    to='pubsub.finesse-server.cisco.com'
    id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe
        node='/finesse/api/Team/TheA/Users'
        jid='ChuckieNorrad@finesse-server.cisco.com'/>
  </pubsub>
</iq>

The following example shows how to unsubscribe to agent state change notifications for a specific team:

Code Snippet
Copy
<iq type='set'
    from='ChuckieNorrad@finesse-server.cisco.com'
    to='pubsub.finesse-server.cisco.com'
    id='unsub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
     <unsubscribe
         node='/finesse/api/Team/TheA/Users'
         jid='userid@finesse-server.cisco.com'/>
  </pubsub>
</iq>

Perform a GET using the SystemInfo API (https://<server>/finesse/api/SystemInfo) to obtain connection details. The returned payload provides the domain and pubsub addresses used to interact with the Cisco Finesse Notification Service.

Code Snippet
Copy
<SystemInfo>
   <status>IN_SERVICE</status>
   <xmppDomain>xmppserver.cisco.com</xmppDomain>
   <xmppPubSubDomain>pubsub.xmppserver.cisco.com</xmppPubSubDomain>
</SystemInfo>

Users are identified in the following manner: userid@xmppserver.cisco.com

Stanzas are sent to the pubsub domain (pubsub.xmppserver.cisco.com ).

Clients should ensure that any subscriptions that are no longer required are cleaned up.