JEP-0142: Workgroups

This JEP defines an XMPP protocol extension that enables a user to communicate with a representative of an organization, department, or workgroup (e.g., the support group).


WARNING: This Standards-Track JEP is Experimental. Publication as a Jabber Enhancement Proposal does not imply approval of this proposal by the Jabber Software Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.


JEP Information

Status: Experimental
Type: Standards Track
Number: 0142
Version: 0.1
Last Updated: 2004-09-03
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: workgroup

Author Information

Iain Shigeoka

Email: iain@jivesoftware.com
JID: smirk@jabber.org

Matt Tucker

Email: matt@jivesoftware.com
JID: jivematt@jabber.org

Legal Notice

This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.


Table of Contents

1. Introduction
1.1. Overview
1.2. Motivation
1.3. Concepts
1.4. Prerequisites
2. Terminology
3. Roles and Responsibilities
3.1. Roles
3.2. Responsibilities
4. Protocol
4.1. Workgroup Presence
4.2. User States
4.3. User Packet Exchanges
4.3.1. User Join Protocol
4.3.1.1. Error Conditions
4.3.1.2. Example
4.3.2. User Depart Protocol
4.3.2.1. Error Conditions
4.3.2.2. Example
4.3.3. User Status Update Protocol
4.3.3.1. User Status Updates
4.3.3.2. Error Conditions
4.3.3.3. Example
4.3.4. User Invite Protocol
4.3.4.1. Error Conditions
4.3.4.2. Example
4.4. Agent States
4.5. Agent Packet Exchanges
4.5.1. Agent Presence Protocol
4.5.1.1. Error Conditions
4.5.1.2. Example
4.5.2. Agent Status Update Protocol
4.5.2.1. Error Conditions
4.5.2.2. Example
4.5.3. Agent Offer Protocol
4.5.3.1. Error Conditions
4.5.3.2. Example
4.5.4. Agent Offer Accept/Reject Protocol
4.5.4.1. Error Conditions
4.5.4.2. Example
4.5.5. Agent Offer Revoke Protocol
4.5.5.1. Error Conditions
4.5.5.2. Example
4.5.6. Agent Invite Protocol
4.5.6.1. Error Conditions
4.5.6.2. Example
5. Complete Protocol Example
6. Implementation Notes
7. Security Considerations
8. IANA Considerations
9. Jabber Registrar Considerations
9.1. Protocol Namespaces
10. XML Schema
Notes
Revision History


1. Introduction

1.1 Overview

This JEP documents a protocol that provides a generic service allowing users to contact a representative of an organization or workgroup without knowing the address of a particular member of that organization or workgroup. This functionality is similar to an 'email alias' with the addition of queuing pending communication requests and quality of service negotiation to accommodate the real-time nature of IM/chat. Although this protocol is generic enough to handle many use cases, specific features have been added that make it particularly suitable for customer support environments.

1.2 Motivation

This protocol addresses the need of starting a private XMPP conversation with a qualified member of a workgroup. In a standard XMPP exchange of messages, users either connect directly to another user for a one on one conversation, or connect to a chat room for a conversation between many people. The current protocols do not allow users to initiate a private conversation with any person playing a particular role in an organization or workgroup.

For example, a customer has a question and needs to talk to a support representative. The conversation is private and therefore cannot be conducted in a well-known chat room. Using the workgroup protocol, the user requests a chat with support@company.com. The chat request is put into a queue and the server routes the chat request to individual support representatives in the support@company.com workgroup. The support representative can accept or reject the chat request. Once the request is accepted, the conversation takes place through standard XMPP messaging protocols.

1.3 Concepts

The namespace governing this protocol is "http://jabber.org/protocol/workgroup". This namespace relies on the <iq/> element for execution, and uses the <presence/> element for announcing status updates.

This protocol depends on Service Discovery for reporting and announcing available workgroup services. However, support for service discovery is entirely optional and workgroup services may be made known through other means (e.g. web pages, word of mouth, etc).

The end result of a workgroup interaction is to negotiate and route a user and workgroup member (a.k.a. agent) to an appropriate chatroom for a chat conversation. Therefore, this JEP also relies on the groupchat and groupchat invitation protocols. However, groupchat essentially 'takes over' when the workgroup protocol successfully completes so there is no overlap between the two protocols. It is highly recommended that groupchat implementations support basic groupchat (a.k.a. Groupchat 1.0) for maximum client compatibility.

1.4 Prerequisites

There are no requirements for supporting the workgroup protocol beyond XMPP Core [1] and Multi-User Chat [2]. Support for Data Forms [3] is optional if users need to submit additional data before joining (see User Join section of this document).

2. Terminology

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [4].

3. Roles and Responsibilities

This protocol has clearly defined roles and responsibilities for its participants.

3.1 Roles

The workgroup protocol involves three distinct participants that fill the following roles:

Note: A service MAY contain several queues to help organize, route and handle incoming user chat requests. Implementations supporting multiple queues in a workgroup will respond differently to requests, and send different status information for each queue. Workgroup queues are identified by a unique resource name: e.g. support@company.com/platinum- plan or support@company.com/xmpp-products. Implementation should gracefully handle services with only one queue (using support@company.com) or multiple queues. Users should only be aware of one workgroup (users should never see workgroup queue resource names).

3.2 Responsibilities

Each participant is responsible for certain behaviors in the workgroup protocol.

Users should:

Workgroup agents should:

The workgroup service:

4. Protocol

The workgroup protocol consists of several XMPP packet exchanges that occur during the lifetime of the protocol. These packet exchanges change the state of the relationship between user, agent and service.

4.1 Workgroup Presence

The workgroup is a normal XMPP messaging node and MUST maintain its own presence. We also recommend that the workgroup service be able to respond to arbitrary chat messages sent to it (preferably by responding with instructions on how to join the queue). Other users may subscribe to the workgroup services' presence using standard XMPP presence-subscribe and presence-unsubscribe protocols. The workgroup service's presence can be used to determine the workgroup's status without joining the workgroup as a user or agent. Workgroup presence updates SHOULD contain the queue summary and agent summary meta-data defined in the Agent Status Update Protocol detailed later in this JEP. For example, a website server-side component can subscribe to the workgroup presence and indicate on web pages whether a workgroup is available to offer live chat to website visitors.

4.2 User States

Users join the workgroup queue to wait for a conversation with an agent. Once they have joined the queue, they may receive zero or more status updates from the workgroup service informing them of their status in the queue. Users have the option to cancel their chat request at any time.

When an agent is ready to chat with the user, the user will be sent a standard XMPP groupchat invitation to a chat room. Receipt of the invitation indicates that the user is no longer in the queue and that they should join the chat room using the standard XMPP groupchat protocol in order to converse with an agent. Groupchat is used because it offers several advantages in workgroup conversations including:

The user's states and packet exchanges that cause state transitions are shown below:

              +-------+
              | Start |<------+
              +-------+       |
                  |           |
                  | Join      |
                  v           |
             +---------+      |
      +----->| Queued  |      |
      |      +---------+      |
      | Status |  |  | Depart |
      +--------+  |  +--------+
                  |
                  | Invite
                  v
            +-----------+
            | Chat room |
            +-----------+
    

4.3 User Packet Exchanges

Packets are exchanged between the user and service to trigger state changes in the user. These packet exchanges are described next.

4.3.1 User Join Protocol

This section describes the packet exchange allowing users to join a workgroup service queue. This protocol MUST be supported by compliant implementations.

Example 1. Transactions

User                          Service
  |        Join Request          |
  |----------------------------->|
  |                              |
  |        Join Response         |
  |<-----------------------------|
  |                              |
      

The user sends a join request to the workgroup service in order to join the workgroup queue. The workgroup service may either accept or reject the request. A user session (e.g. user@server.com/home) may only join the workgroup service queue once. Subsequent, simultaneous joins will result in an error (see error section).

Some workgroups require that the user submit certain information before the user is allowed to join. In these cases, the workgroup will reject the initial join request with a <not-acceptable/> error. The user should then use the Data Forms (JEP-0004) [4] protocol within iq-join-queue to obtain a form, and submit it. Once the server accepts the submitted data, the user join should be retried.

Example 2. Request Element

U: <iq to='service-jid' from='user-jid' id='id' type='set'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <queue-notifications/>
U:   </join-queue>
U: </iq>
      

The request may contain meta-data to help the service determine queuing of the user or Data Forms data when submitting form information. There is one optional standard workgroup sub-element of <join-queue>:

A successful join results in a success response:

Example 3. Response Element

S: <iq to='user-jid' from='service-jid' id='id' type='result'>
S:    <join-queue xmlns='http://jabber.org/protocol/workgroup'>
S:      <queue-notifications/>
S:    </join-queue>
S: </iq>
      

If the user indicated interest in their queue status information, the supported status updates that will be sent by the server is included in the response. Compliant implementations do not have to support any status update types. Status updates requested by the user and supported by the server will be pushed to the user by the service until the user departs or is invited to a chat room.

4.3.1.1 Error Conditions

Table 1:

Condition Description
<not-authorized/> The user is not authorized to join the queue. A determination of who has permission to join a queue is left to implementations.
<item-not-found/> The address the user requests a chat with does not exist or is not a workgroup. Compliant workgroup service implementations MUST NOT return this error if the requested address is a valid workgroup.
<not-acceptable/> The user must submit valid form data (using the Data Forms protocol [4]) before joining the queue. Note that this error is sent when user tries to join, or if the user submits form data that is not filled out correctly.
<conflict/> The user has already joined the queue.
<service-unavailable/> The workgroup is valid but closed (not accepting new join-queue requests).

4.3.1.2 Example

The following protocol flows show an example of a user successfully joining a workgroup queue for support@company.com.

Example 4. Successful Join

U: <iq type='set'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id1'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <queue-notifications/>
U:   </join-queue>
U: </iq>
S: <iq type='result'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id1'>
S:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
S:     <queue-notifications/>
S:   </join-queue>
S: </iq>
        

The following XML is another example where meta-data is sent by the user to assist the workgroup server in queuing and routing (naturally, the custom namespace that qualified the <crm/> element in this example would be defined outside the context of this specification). The service does not support the requested <queue-notifications> status updates and indicates this by not including it in the response.

Example 5. Join With Meta-Data

U: <iq type='set'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id2'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <crm xmlns="http://www.company.com/xmpp/workgroup">
U:       <customer-id>the24th498onth</customer-id>
U:       <referrer>
U:         http://www.company.com/portal/
U:       </referrer>
U:       <product>Widget 1.0</product>
U:     </crm>
U:     < queue-notifications/>
U:   </join-queue>
U: </iq>
S: <iq type='result'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id2'/>
        

Finally an example of a required form submission before a user is allowed to the workgroup queue for support@company.com. The data form in this example is trivial; please see the Data Forms specification [4] for a complete data form example. The example begins as normal, but the workgroup returns a <not-acceptable/> error.

Example 6. Join With Form

U: <iq type='set'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id1'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <queue-notifications/>
U:   </join-queue>
U: </iq>
S: <iq type='error'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id1'>
S:   <error code='406' type='modify'>
S:     <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
S:   </error>
S: </iq>
        

The <not-acceptable/> error indicates that a data form is required. The user requests the required data form from the workgroup.

Example 7. Join With Form (2)

U: <iq type='get'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id2'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'/>
U: </iq>
S: <iq type='result'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id2'>
S:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
S:     <x xmlns='jabber:iq:data' type='form'>
S:       <title>Support.com Chat Customer Information</title>
S:       <instructions>Welcome to support.com! Please provide us with
S:         some information about yourself so we can serve you better.
S:       </instructions>
S:       <field type='text-single' label='First Name' var='first' />
S:       <field type='text-single' label='Last Name' var='last' />
S:       <field type='list-single' label='Contract Type'
var='contract_type'>
S:         <value>0</value>
S:         <option label='None'><value>0</value></option>
S:         <option label='Bronze'><value>1</value></option>
S:         <option label='Silver'><value>2</value></option>
S:         <option label='Gold'><value>3</value></option>
S:       </field>
S:     </x>
S:   </join-queue>
S: </iq>
        

After presenting the form to the user and gathering the form data, the user submits the form data to the workgroup and the workgroup accepts it.

Example 8. Join With Form (3)

U: <iq type='set'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id3'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <x xmlns='jabber:iq:data' type='submit'>
U:       <field var='first'><value>John</value></field>
U:       <field var='last'><value>Doe</value></field>
U:       <field var='contract_type'><value>2</value></field>
U:     </x>
U:   </join-queue>
U: </iq>
S: <iq type='result'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id3' />
        

A standard user join is attempted again. The workgroup now has the required form data so it allows the user to join.

Example 9. Join With Form (4)

U: <iq type='set'
U:     from='user@server.com/home'
U:       to='support@company.com'
U:       id='id4'>
U:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <queue-notifications/>
U:   </join-queue>
U: </iq>
S: <iq type='result'
S:     from='support@company.com'
S:       to='user@server.com/home'
S:       id='id4'>
S:   <join-queue xmlns='http://jabber.org/protocol/workgroup'>
S:     <queue-notifications/>
S:   </join-queue>
S: </iq>
        

4.3.2 User Depart Protocol

Describes the packet exchange allowing users to depart a workgroup service queue, or for a workgroup service to remove a user from the workgroup queue. This protocol MUST be supported by compliant implementations.

The user no longer wishes to be in the queue and issues a depart queue command.

Example 10. Transactions

Requester                     Service
  |        Depart Request        |
  |----------------------------->|
  |        Depart Response       |
  |<-----------------------------|
  |                              |
      

The service notifies the user that they have been removed from the workgroup queue.

Example 11. Transactions (2)

User                          Service
  |        Depart Message        |
  |<-----------------------------|
  |                              |
      

Example 12. Depart Request

U: <iq from='user-jid' to='service-jid' id='id' type='set'>
U:   <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
U: </iq>
      

In the typical case, the sender is the user departing the queue. However, it is possible for other users (system administrators for example) to request that another user be removed from the queue. In this case, the jid of the user who is departing is included in the depart request:

Example 13. Depart Request With JID

U: <iq from='admin-jid' to='service-jid' id='id' type='set'>
U:   <depart-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <jid>user-jid</jid>
U:   </depart-queue>
U: </iq>
      

It is expected that implementations will determine who is allowed to remove other users from the queue based on an implementation specific permissions model. These administrator depart requests may result in <not-authorized/> errors (see error section). A user removing their own queue entry MUST NOT receive unauthorized errors (the workgroup service may not refuse to allow a user to depart the queue).

The sender of the depart request receives a successful result packet:

Example 14. Depart Request

S: <iq from='service-jid' to=user-jid' id='id' type='result'/>
      

And the user who is departing receives a depart message (the user may not have been the sender of the request):

Example 15. Depart Message

S: <message from='service-jid' to='user-jid'>
S:    <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
S: </message>
      

The user will not be in the queue after a response is received unless the error response code is <not-authorized/>.

4.3.2.1 Error Conditions

Table 2:

Condition Description
<not-authorized/> The sender did not have permission to remove the user from the queue. This error code MUST NOT be used when a user is removing their queue entry.
<item-not-found/> The user was not in the queue.

4.3.2.2 Example

A user leaves the workgroup queue support@company.com.

Example 16. User Departs

U: <iq from='user@server.com/home'
U:       to='support@company.com'
U:       id='id1'
U:     type='set'>
U:   <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
U: </iq>
S: <iq from='support@company.com'
S:     to='user@server.com/home'
S:     id='id1'
S:     type='result'/>
S: <message from='support@company.com' to='user@server.com/home'>
S:    <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
S: </message>
        

An administrator removes a user from the workgroup queue support@company.com. Notice that the depart-queue message is sent to the user that has left the queue.

Example 17. Administrator Removes User

U: <iq from='admin@company.com/work'
U:       to='support@company.com'
U:       id='id1'
U:     type='set'>
U:   <depart-queue xmlns='http://jabber.org/protocol/workgroup'>
U:     <jid>user@server.com/home</jid>
U:   </depart-queue>
U: </iq>
S: <iq from='support@company.com'
S:     to='admin@company.com/work'
S:     id='id1'
S:     type='result'/>
S: <message from='support@company.com' to='user@server.com/home'>
S:    <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
S: </message>
        

4.3.3 User Status Update Protocol

Describes the packet exchange for updating users on their queue status. This protocol MAY be supported by compliant implementations.

Example 18. Transactions

User                          Service
  |      User Status Push        |
  |<-----------------------------|
  |      User Status Ack         |
  |----------------------------->|
  |                              |
  |     User Status Request      |
  |----------------------------->|
  |     User Status Response     |
  |<-----------------------------|
  |                              |
      

The workgroup service pushes updates to the user as their queue status changes and the user may request their queue status at any time.

4.3.3.1 User Status Updates

User status updates are contained in a <queue-status/> element that updates the user on their queue position and estimated time. The position contained in a <position> sub-element is a non-negative integer indicating the number of queue entries that must be routed to an agent before the user is routed to an agent. A position of 0 (zero) indicates the user is currently being routed. Clients may use this information to display the current queue position to the user.

The queue time status is contained in a <time/> sub-element that updates the user with the estimated time until they will be routed to an agent. The time is a non-negative integer indicating the estimated number of seconds remaining before being routed. Services should send this update at regular intervals. We recommend every 15 seconds, but the best solution will depend on application dependent factors and the service may decide to send updates at any interval or never (relying on the client to request the information). User clients should assume the estimated time counts down at a rate of one second per second between status updates. Clients may use this information to display the running estimated time to the user.

A server 'push' occurs asynchronously to client, and the client acknowledges the update:

Example 19. User Status Push

S: <iq to='user-jid' from='service-jid' id='id' type='set'>
S:   <queue-status xmlns='http://jabber.org/protocol/workgroup'>
S:     <position>4</position>
S:     <time>60</time>
S:   </queue-status>
S: </iq>
U: <iq to='service-jid' from='user-jid' id='id' type='result'/>
        

Alternately the client may poll their position:

Example 20. User Status Poll

U: <iq to='service-jid' from='user-jid' id='id' type='get'>
U:   <queue-status xmlns='http://jabber.org/protocol/workgroup'/>
U: </iq>
S: <iq to='user-jid' from='service-jid' id='id' type='result'>
S:   <queue-status xmlns='http://jabber.org/protocol/workgroup'>
S:     <position>4</position>
S:     <time>60</time>
S:   </queue-status>
S: </iq>
        

4.3.3.2 Error Conditions

Table 3:

Condition Description
<not-authorized/> Sent by the server to the user in response to a status query only if the user is not a member of the queue.
<feature-not-implemented/> Sent only if status updates are not implemented in either the client or server.

4.3.3.3 Example

A user receives a position update from the workgroup queue support@company.com.

Example 21. Position Update

S: <iq from='support@company.com'
S:       to='user@server.com/home'
S:       id='id1'
S:     type='set'>
S:   <queue-status xmlns='http://jabber.org/protocol/workgroup'>
S:     <position>4</position>
S:     <time>60</time>
S:   </queue-status>
S: </iq>
U: <iq from='user@server.com/home'
U:       to='support@company.com'
U:       id='id1'
U:     type='result'/>
        

4.3.4 User Invite Protocol

This section describes the packet exchange for inviting a queued user to a chat room for conversation with an agent. This protocol MUST be supported by compliant implementations.

Example 22. Transactions

User                          Service
  |          User Invite         |
  |<-----------------------------|
  |                              |
      

The server sends a standard JEP-0045 groupchat invitation to the user to begin their conversation with an agent.

User invitations use JEP-0045 standard multi-user chat invitations. The invitation indicates that the user is no longer in the workgroup queue. The user MUST NOT receive any more user queue status updates once they receive an invitation.

In order to match invitations to offers, all invitations should carry meta data in the workgroup namespace in the 'workgroup' element with a 'user' and 'agent' attribute set to the address of each party in the invite. The typical meta-data fragment would appear as:

Example 23. Invitation Meta-Data

<workgroup user='user-jid' agent='agent-jid'/>
      

4.3.4.1 Error Conditions

There are no valid error conditions for user invitations.

4.3.4.2 Example

An invitation from the support@server.com workgroup:

Example 24. An Invitation

<message from='support@company.com' to='user@server.com/home>
  <body>You have been invited to chat with a support@company.com
agent.</body>
  <x jid='roomname@chatserver.company.com' xmlns='jabber:x:conference'/>
  <workgroup xmlns='http://jabber.org/protocol/workgroup'
             user='user@server.com/home'
             agent='agent-alice@company.com/work'/>
</message>
        

4.4 Agent States

Agents join a workgroup to indicate they are capable of handling conversations with users. Agent membership in the workgroup is expected to be a long term, persistent relationship similar to roster membership. For example, a customer support agent may join the support@company.com workgroup when they begin working at company.com and will only depart when they leave that position. The wide variety of relationships, processes and permissions associated with joining and leaving workgroups lies outside the scope of this JEP.

Once an agent has joined a workgroup they will receive workgroup status updates to inform them of the status of other members of the workgroup. Agents are responsible for updating the workgroup service with their presence so the service can intelligently route chat requests to the 'best' agent. Workgroup agent presence uses standard XMPP presence packets with optional meta-data to help routing of chat requests to agents. Some meta- data will be standard and defined later in this JEP. It is expected that other deployment specific meta-data will also be needed to make routing decisions.

The general agent workgroup state diagram is shown below:

            +-----------+
      +---->| Workgroup |<-----+
      |     +-----------+      |
      |        |     |Agent    |
      | Status |     |Presence |
      +--------+     +---------+
    

Once an agent has joined a workgroup and is available, the agent will receive offers to chat with users by the workgroup service. Chat offers will be made to the agent and the agent has the opportunity to accept or reject each offer. The workgroup service may also revoke an offer. For example, a service may revoke chat offers if the offer is not responded to within a certain period of time to ensure fast responses to user chat requests.

Once an offer has been accepted, the agent must wait for a standard groupchat invitation from the workgroup service. The workgroup service may revoke the offer at this stage of the protocol as well. This enables workgroup services to send offers to several agents in parallel, and choose the 'best' agent that accepts. A diagram showing the agent workgroup sub- states and transitions is shown below:

              +-------+
              | Start |<---------+
              +-------+          |
                  |              |
                  | Offer        |
                  v              |
            +---------------+    |
            | Offer Pending |    |
            +---------------+    |
                 |  |  | Revoke  |
                 |  |  +-------->|
                 |  | Reject     |
          Accept |  +----------->|
                 v               |
            +--------------+     |
            | Chat Pending |     |
            +--------------+     |
                 |   | Revoke    |
          Invite |   +-----------+
                 V
              +-----------+
              | Chat room |
              +-----------+
    

4.5 Agent Packet Exchanges

Packets are exchanged between the agent and service to trigger state changes in the agent client. These packet exchanges are described next.

4.5.1 Agent Presence Protocol

Describes the packet exchange allowing agents to update a workgroup with their current presence. This protocol MUST be supported by compliant implementations.

Example 25. Transactions

Agent                         Service
  |       Presence Update        |
  |----------------------------->|
  |                              |
      

The agent must inform the workgroup of its presence by sending it a presence update packet. Agent presence updates use standard XMPP presence with optional meta-data. However, there must always be an agent-status workgroup sub-element in the presence packet to indicate that the presence update relates to agent workgroup presence. Agent workgroup presence is designed to allow a separation between the agent's normal XMPP presence (server-managed via rosters) and their presence with the workgroup.

Example 26. Presence Update

U: <presence from='agent-jid' to='service-jid' id='id'>
U:   <agent-status xmlns='http://jabber.org/protocol/workgroup'>
U:     <max-chats>count</max-chats>
U:     <current-chats>count</current-chats>
U:   </agent-status>
U: </presence>
      

Agent presence updates use standard XMPP presence packets and should contain the normal sub elements as needed (e.g. <show/>, <status/>, etc) and can be of type='unavailable' to indicate the agent is not available for workgroup routing or for receiving workgroup agent updates. The standard XMPP show states have specific meaning within the context of the workgroup protocol:

Agents may also wish to embed meta-data to help the workgroup service route chat requests. The two optional standard presence updates in the workgroup namespace are:

4.5.1.1 Error Conditions

There are no valid error conditions for presence updates.

4.5.1.2 Example

An agent becomes available to the workgroup support@company.com.

Example 27. Agent Becomes Available

U: <presence from='agent-alice@company.com/work'
U:             to='support@company.com'
U:             id='id1'>
U:   <show>chat</show>
U:   <agent-status xmlns='http://jabber.org/protocol/workgroup'>
U:     <max-chats>3</max-chats>
U:     <current-chats>0</current-chats>
U:   </agent-status>
U: </presence>
        

4.5.2 Agent Status Update Protocol

This section describes the packet exchange used to update agents on the status of the workgroup. This protocol MAY be supported by compliant implementations.

Example 28. Transactions

Agent                         Service
  |         Agent Status         |
  |<-----------------------------|
  |                              |
      

The workgroup service pushes updates to the agent as the workgroup and queue status changes.

There are four standard status types currently defined. The first is , which updates the agent on the detailed status of other agents in the workgroup. All fields except for the embedded <presence> are optional:

Example 29. Agent Status Type

S: <presence to='agent-jid' from='service-jid' id='id'>
S:   <agent-status xmlns='http://jabber.org/protocol/workgroup'>
S:     <agent jid='agent-jid'>
S:       <presence>standard XMPP presence attributes</presence>
S:       <current-chats>count</current-chats>
S:       <max-chats>max</max-chats>
S:     </agent>
S:   </agent-status>
S: </presence>
      

An update may contain one or more agent entries detailing the current status of other agents in the workgroup. The defined sub-elements of <agent> are:

The second defined agent status type is , which updates the agent with a summary of the status of agents in the workgroup. All fields are optional:

Example 30. Notify-Agent Status Type

S: <presence to='agent-jid' from='service-jid' id='id'>
S:   <notify-agents xmlns='http://jabber.org/protocol/workgroup'>
S:     <available>count</available>
S:     <current-chats>count</current-chats>
S:     <max-chats>max</max-chats>
S:   </notify-agents>
S: </presence>
      

The defined sub-elements of <notify-agents> are:

The third defined agent status type is , which updates the agent with details on the status of the workgroup queue. All fields are optional:

Example 31. Notify-Queue-Details Status Type

S: <presence to='agent-jid' from='service-jid' id='id'>
S:   <notify-queue-details xmlns='http://jabber.org/protocol/workgroup'>
S:     <user jid='user-jid'>
S:       <position>pos</position>
S:       <time>estimated-time</time>
S:       <join-time>YYYYMMDDTHH:mm:SS</join-time>
S:     </user>
S:   </notify-queue-details>
S: </presence>
      

An update may contain one or more <user> entries (one per user in the queue whose status has changed). The defined sub-elements of <user> are:

The fourth defined user status type is , which updates the agent with a summary of the status of the workgroup queue. All fields are optional:

Example 32. Notify-Queue Status Type

S: <presence to='agent-jid' from='service-jid' id='id'>
S:   <notify-queue xmlns='http://jabber.org/protocol/workgroup'>
S:     <count>count</count>
S:     <oldest>YYYYMMDDTHH:mm:ss</oldest>
S:     <time>average-time-to-chat</time>
S:     <status>open</status>
S:   </notify-queue>
S: </presence>
      

The defined sub-elements of <lnotify-queue> are:

4.5.2.1 Error Conditions

There are no valid error conditions for agent status updates.

4.5.2.2 Example

An agent receives an update from workgroup support@company.com.

Example 33. Agent Receives Update

S: <presence from='support@company.com'
S:             to='agent-alice@company.com/work'
S:             id='id1'>
S:   <agent-status xmlns='http://jabber.org/protocol/workgroup'>
S:       <available>7</available>
S:       <current-chats>12</current-chats>
S:       <max-chats>21</max-chats>
S:   </agent-status>
S: </presence>
        

4.5.3 Agent Offer Protocol

This section describes the packet exchange involved in a service offering a chat to an agent. This protocol MUST be supported by compliant implementations.

Example 34. Transactions

Agent                         Service
  |         Offer Request        |
  |<-----------------------------|
  |         Offer Response       |
  |----------------------------->|
  |                              |
      

The agent is offered a chat with a user. A successful offer results in the agent owning the offer, but does not mean it has accepted the chat. Accepting an offer is handled by the Agent Accept protocol. The separation between offer and acceptance is made so that agents may receive offers while engaged in other activities (busy with other chats) and accept them at a later time.

Example 35. Offer Request

S: <iq from='service-jid' to='agent-jid' id='id' type='set'>
S:   <offer xmlns='http://jabber.org/protocol/workgroup' jid='user-jid'>
S:       <timeout>seconds</timeout>
S:   </offer>
S: </iq>
      

Application specific meta-data will normally be added as a sub-element of <offer> to help agents decide whether to accept or not. An optional <timeout> sub-element may be included indicating the amount of time the offer stands before the service will revoke it.

Example 36. Offer Response

A: <iq from='agent-jid' to='service-jid' id='id' type='result'/>
      

The agent may respond only with a successful result.

4.5.3.1 Error Conditions

There are no valid error results for an offer response.

4.5.3.2 Example

An agent is offered a chat with a user. The offer will be revoked in 30 seconds.

Example 37. Agent is Offered a Chat

S: <iq to='agent-alice@company.com/work'
S:     from='support@company.com'
S:     id='id1'
S:     type='set'>
S:     <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@server.com/home'>
S:       <timeout>30</timeout>
S:     </offer>
S: </iq>
A: <iq to='support@company.com'
A:     from='agent-alice@company.com/work'
A:     id='id1'
A:     type='result'/>
        

The following is a more typical offer containing meta-data about the user. The offer will be revoked in 30 seconds.

Example 38. Offer Including Meta-Data

S: <iq to='agent-alice@company.com/work'
S:     from='support@company.com'
S:     id='id1'
S:     type='set'>
S:     <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@server.com/home'>
S:       <timeout>30</timeout>
S:       <crm xmlns="http://www.company.com/xmpp/workgroup'>
S:         <user-id>423498ae84f</user-id>
S:         <product>Widget 1.0</product>
S:       </crm>
S:     </offer>
S: </iq>
A: <iq to='support@company.com'
A:     from='agent-alice@company.com/work'
A:     id='id1'
A:     type='result'/>
        

4.5.4 Agent Offer Accept/Reject Protocol

This section describes the packet exchange involved in an agent rejecting an offering a chat to a user. This protocol MUST be supported by compliant implementations.

Example 39. Transactions

Agent                         Service
  |  Offer Accept/Reject Request |
  |----------------------------->|
  | Offer Accept/Reject Response |
  |<-----------------------------|
  |                              |
      

The agent accepts or rejects an offer to chat with a user.

Example 40. Offer Accept Request

A: <iq to='service-jid' from='agent-jid' id='id' type='set'>
A:   <offer-accept jid='user-jid' xmlns='http://jabber.org/protocol/workgroup' />
A: </iq>
      

Example 41. Offer Reject Request

A: <iq to='service-jid' from='agent-jid' id='id' type='set'>
A:   <offer-reject jid='user-jid' xmlns='http://jabber.org/protocol/workgroup'/>
A: </iq>
      

Example 42. Offer Response

S: <iq to='agent-jid' from='service-jid' id='id' type='result'/>
      

The service may respond only with a successful result.

4.5.4.1 Error Conditions

There are no valid error results for an accept/reject offer response.

4.5.4.2 Example

Example 43. Agent Accepts Chat

A: <iq from='agent-alice@company.com/work'
A:       to='support@company.com'
A:       id='id1'
A:     type='set'>
A:   <offer-accept jid='user@server.com/home' xmlns='http://jabber.org/protocol/workgroup'/>
A: </iq>
S: <iq from='support@company.com'
S:     to='agent-alice@company.com/work'
S:     id='id1'
S:     type='result'/>
        

4.5.5 Agent Offer Revoke Protocol

This section describes the packet exchange involved in a service revoking an offer to an agent to chat to a user. This protocol MUST be supported by compliant implementations.

Example 44. Transactions

Agent                         Service
  |     Offer Revoke Request     |
  |<-----------------------------|
  |    Offer Revoke Response     |
  |----------------------------->|
  |                              |
      

The service revokes an earlier offer to chat to a user. Offer revocations typically occur when the original offer times out, or a better agent was found to handle the chat. Note that offer revocations may occur anytime after an offer has been made, and before an invitation is sent (see agent state diagram). In other words, even though an agent has accepted an offer to chat, the agent may still receive an offer revocation (e.g. a better agent was found to handle the chat).

Example 45. Offer Revoke Request

S: <iq from='service-jid' to='agent-jid' id='id' type='set'>
S:     <offer-revoke jid='user-jid' xmlns='http://jabber.org/protocol/workgroup'>
S:       <reason>
S:         [reason]
S:       </reason>
S:     </offer-revoke>
S: </iq>
      

The reason element may optionally contain free form text explaining the reason the offer was revoked.

Example 46. Offer Response

A: <iq from='agent-jid' to='service-jid' id='id' type='result'/>
      

The agent may respond only with a successful result.

4.5.5.1 Error Conditions

There are no valid error results for an offer response.

4.5.5.2 Example

Example 47. Offer Revoked Due to Timeout

S: <iq   to='agent-alice@company.com/work'
S:     from='support@company.com'
S:       id='id1'
S:     type='set'>
S:     <offer-revoke xmlns='http://jabber.org/protocol/workgroup' jid='user@server.com/home'>
S:         <reason>
S:           Offer timed out
S:         </reason>
S:     </offer-revoke>
S: </iq>
A: <iq   to='support@company.com'
A:     from='agent-alice@company.com/work'
A:       id='id1'
A:     type='result'/>
        

4.5.6 Agent Invite Protocol

This section describes the packet exchange inviting an agent to a chat room for conversation with a user. This protocol MUST be supported by compliant implementations.

Example 48. Transactions

Agent                         Service
  |         Agent Invite         |
  |<-----------------------------|
  |                              |
      

The server sends a standard JEP-0045 groupchat invitation to the agent to begin their conversation with a user. The invitation follows the same format as shown in the User Invite Protocol.

Agent invitations use JEP-0045 standard multi-user chat invitations. The agent will continue to receive agent status updates from the workgroup.

4.5.6.1 Error Conditions

There are no valid error conditions for agent invitations.

4.5.6.2 Example

See JEP-0045: Multi-User Chat for examples.

5. Complete Protocol Example

The following is a complete example showing the typical process flow and protocol packet exchanges between user, service, and agent.

To follow.

6. Implementation Notes

If workgroup goes offline, all queued users SHOULD be notified of workgroup cancellation.

An implementation MAY support for anonymous login by users, which makes it easier to deploy such a system on a website.

A user MAY pass in arbitrary meta-data during the initial chat request, which allows for more complex routing and queue processing decisions by the server. Such meta-data SHOULD be included as xxx.

7. Security Considerations

To follow.

8. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].

9. Jabber Registrar Considerations

1. Protocol Namespaces

Upon advancement of this JEP to a status of Draft, the Jabber Registrar [8] shall add 'http://jabber.org/protocol/workgroup' to its registry of protocol namespaces.

10. XML Schema

To follow.


Notes

1. RFC 3920: Extensible Messaging and Presence Protocol (XMPP): Core <http://www.ietf.org/rfc/rfc3920.txt>.

2. JEP-0045: Multi-User Chat <http://www.jabber.org/jeps/jep-0045.html>.

3. JEP-0004: Data Forms <http://www.jabber.org/jeps/jep-0004.html>.

4. RFC 2119: Key words for use in RFCs to Indicate Requirement Levels <http://www.ietf.org/rfc/rfc2119.txt>.

5. The max-chats value sent from agent to workgroup service is a 'hint' or recommended value. The workgroup service is not obliged to accept this value. The actual max-chats value for the agent will be sent to the agent via the next Agent Status Update. This allows administrators to constrain agent behavior in order to enforce company policy, quality assurance, etc.

6. Presence values are not "sticky". For example, if a presence show value is 'dnd' and another presence is sent without a show value, the entity's presence show is the default show, and NOT 'dnd'. The same non- sticky behavior applies to workgroup presence values such as max-chats and current-chats.

7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

8. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.


Revision History

Version 0.1 (2004-09-03)

Initial version. (is/mt)


END