No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0142.xml 71KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205
  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Workgroup Queues</title>
  10. <abstract>This document defines an XMPP protocol extension that enables a user to communicate with a representative of an organization, department, or workgroup.</abstract>
  11. &LEGALNOTICE;
  12. <number>0142</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0030</spec>
  19. <spec>XEP-0045</spec>
  20. </dependencies>
  21. <supersedes/>
  22. <supersededby/>
  23. <shortname>Not yet assigned</shortname>
  24. <author>
  25. <firstname>Matt</firstname>
  26. <surname>Tucker</surname>
  27. <email>matt@jivesoftware.com</email>
  28. <jid>jivematt@jabber.org</jid>
  29. </author>
  30. <revision>
  31. <version>0.3</version>
  32. <date>2005-05-09</date>
  33. <initials>psa</initials>
  34. <remark><p>Editorial revision; defined XML schema.</p></remark>
  35. </revision>
  36. <revision>
  37. <version>0.2</version>
  38. <date>2005-02-28</date>
  39. <initials>mt/is</initials>
  40. <remark><p>General re-organization, refined agent status protocol, removed queue-notification element from join request replies, user status pushes now use a message instead of IQ.</p></remark>
  41. </revision>
  42. <revision>
  43. <version>0.1</version>
  44. <date>2004-08-10</date>
  45. <initials>mt/is</initials>
  46. <remark><p>Initial version.</p></remark>
  47. </revision>
  48. </header>
  49. <section1 topic='Introduction' anchor='intro'>
  50. <section2 topic='Overview' anchor='intro-over'>
  51. <p>The protocol defined herein enables 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.</p>
  52. </section2>
  53. <section2 topic='Motivation' anchor='intro-motive'>
  54. <p>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.</p>
  55. <p>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@workgroup.example.com. The chat request is put into a queue and the server routes the chat request to individual support representatives in the support@workgroup.example.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.</p>
  56. </section2>
  57. <section2 topic='Concepts' anchor='intro-concepts'>
  58. <p>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.</p>
  59. <p>This protocol depends on &xep0030; 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 or word of mouth .</p>
  60. <p>The end result of a workgroup interaction is to negotiate and route a user and workgroup member (a.k.a. agent) to an appropriate chat room for a chat conversation using the multi-user chat (MUC) protocol. However, multi-user chat essentially 'takes over' when the workgroup protocol successfully completes so there is no overlap between the two protocols. It is RECOMMENDED that groupchat implementations support basic groupchat (a.k.a. Groupchat 1.0) for maximum client compatibility.</p>
  61. </section2>
  62. <section2 topic='Prerequisites' anchor='intro-prereq'>
  63. <p>There are no requirements for supporting the workgroup protocol beyond &xmppcore; and &xep0045;. Support for &xep0004; is optional if users need to submit additional data before joining (see User Join section of this document).</p>
  64. </section2>
  65. </section1>
  66. <section1 topic='Roles and Responsibilities' anchor='roleresp'>
  67. <p>This protocol has clearly defined roles and responsibilities for its participants.</p>
  68. <section2 topic='Roles' anchor='roles'>
  69. <p>The workgroup protocol involves three distinct participants that fill the following roles:</p>
  70. <ul>
  71. <li><strong>User</strong> - The user requests a private conversation with a member of a workgroup.</li>
  72. <li><strong>Service</strong> - The workgroup service receives and sends messages using the workgroup address. The workgroup address represents a general contact address which allows users to find workgroup members to talk to without the need to know any particular workgroup member's individual address. The workgroup service manages the interactions between users and agents.</li>
  73. <li><strong>Agent</strong> - The agent is a member of the workgroup and can carry out conversations with users on behalf of their workgroup organization or company.</li>
  74. </ul>
  75. <p>In the examples shown throughout this document, the user address &lt;user@example.net/home&gt;, the service address is &lt;support@workgroup.example.com&gt;, and the agent addresses are &lt;alice@example.com/work&gt; and &lt;bob@example.com/work&gt;.</p>
  76. <p>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@workgroup.example.com/platinum-plan or support@workgroup.example.com/xmpp-products. Implementations should gracefully handle services with only one queue (using support@workgroup.example.com) or multiple queues. Users should only be aware of one workgroup (users should never see workgroup queue resource names).</p>
  77. </section2>
  78. <section2 topic='Responsibilities' anchor='responsibilities'>
  79. <p>Each participant is responsible for certain behaviors in the workgroup protocol.</p>
  80. <p>Users should:</p>
  81. <ul>
  82. <li>Know the status of the workgroup queue before requesting a conversation. This information allows users to see if the workgroup is available, and how long a wait they may have before a chat is initiated.</li>
  83. <li>Know the status of their request while in the request queue.</li>
  84. <li>Be able to cancel a chat request at any time.</li>
  85. </ul>
  86. <p>Workgroup agents should:</p>
  87. <ul>
  88. <li>Know the status of the workgroup queue(s).</li>
  89. <li>Be able to accept or reject chat requests.</li>
  90. <li>Indicate their availability for handling workgroup chats.</li>
  91. </ul>
  92. <p>The workgroup service:</p>
  93. <ul>
  94. <li>Controls the workgroup request queue(s).</li>
  95. <li>Manages the updating of queue status information.</li>
  96. <li>Determines how users are queued and how queue requests are routed to workgroup
  97. members. The queue routing algorithm is beyond the scope of this document and left to
  98. implementers (simple round-robin, priority based, rules based, etc).</li>
  99. <li>Maintains its presence, indicating the availability of the workgroup service.</li>
  100. </ul>
  101. </section2>
  102. </section1>
  103. <section1 topic='User Protocol' anchor='user'>
  104. <p>The workgroup protocol consists of several XMPP packet exchanges that occur during the
  105. lifetime of the protocol. These packet exchanges change the state of the relationship
  106. between user, agent and service.</p>
  107. <section2 topic='User States' anchor='proto-states'>
  108. <p>Users join the workgroup queue to wait for a chat 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.</p>
  109. <p>When an agent is ready to chat with the user, the user MUST 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:</p>
  110. <ul>
  111. <li>Allowing more than one agent to join the conversation (useful for bringing in experts to join the conversation).</li>
  112. <li>Allowing managers to monitor conversations for quality of service.</li>
  113. <li>Creating a simple way of determining what is in a 'conversation' for logging and gathering other statistical information about the conversation.</li>
  114. <li>Allowing a convenient mechanism for bringing 'chatbot' services into the conversation (e.g. answering FAQs).</li>
  115. </ul>
  116. <p>The user's states and packet exchanges that cause state transitions are shown below:</p>
  117. <code><![CDATA[
  118. +-------+
  119. | Start |<------+
  120. +-------+ |
  121. | |
  122. | Join |
  123. v |
  124. +---------+ |
  125. +----->| Queued | |
  126. | +---------+ |
  127. | Status | | | Depart |
  128. +--------+ | +--------+
  129. |
  130. | Invite
  131. v
  132. +-----------+
  133. | Chat room |
  134. +-----------+
  135. ]]></code>
  136. </section2>
  137. <section2 topic='User Packet Exchanges' anchor='proto-user'>
  138. <p>Packets are exchanged between the user and service to trigger state changes in the user. These packet exchanges are described next.</p>
  139. <section3 topic='User Join Protocol' anchor='proto-user-join'>
  140. <p>This section describes the packet exchange allowing users to join a workgroup service queue. This protocol MUST be supported by compliant implementations.</p>
  141. <example caption='Transactions'><![CDATA[
  142. User Service
  143. | Join Request |
  144. |----------------------------->|
  145. | |
  146. | Join Response |
  147. |<-----------------------------|
  148. | |
  149. ]]></example>
  150. <p>The user sends a join request to the workgroup service in order to join the workgroup queue.
  151. The workgroup service may either accept or reject the request. A user session (e.g. user@example.net/home)
  152. may have only one active join request. Subsequent, simultaneous joins MUST result in an error.</p>
  153. <p>Some workgroups require that the user submit certain information before the user is allowed to join.
  154. In these cases, the workgroup MUST reject the initial join request with a &e406; error. The user should then
  155. use the Data Forms protocol within iq-join-queue to obtain a form, and submit it to join
  156. the queue.</p>
  157. <example caption='Request Element'><![CDATA[
  158. U: <iq to='support@workgroup.example.com' from='user@example.net/home' id='id1' type='set'>
  159. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  160. U: <queue-notifications/>
  161. U: </join-queue>
  162. U: </iq>
  163. ]]></example>
  164. <p>The request may contain application-specific meta-data to help the service determine queuing of the user or Data Forms data when submitting form information (definition of such data is out of scope for this document). In addition, the &lt;join-queue&gt; element MAY contain a standard &lt;queue-notifications/&gt; element, which indicates that the user would like to receive user status updates about their state in the queue.</p>
  165. <p>A successful join results in a success response:</p>
  166. <example caption='Response Element'><![CDATA[
  167. S: <iq to='user@example.net/home' from='support@workgroup.example.com' id='id1' type='result'/>
  168. ]]></example>
  169. <p>If the user indicated interest in their queue status information, the supported status updates MUST be sent by the server. Compliant implementations do not have to support any status update types. Status updates requested by the user and supported by the server MUST be pushed to the user by the service until the user departs or is invited to a chat room.</p>
  170. <section4 topic='Error Conditions' anchor='proto-user-join-errors'>
  171. <table caption='Join-Queue Error Conditions'>
  172. <tr>
  173. <th>Condition</th>
  174. <th>Description</th>
  175. </tr>
  176. <tr>
  177. <td>&e401;</td>
  178. <td>The user is not authorized to join the queue. A determination of who has permission to join a queue is left to implementations.</td>
  179. </tr>
  180. <tr>
  181. <td>&e404;</td>
  182. <td>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.</td>
  183. </tr>
  184. <tr>
  185. <td>&e406;</td>
  186. <td>The user must submit valid form data before joining the queue. Note that this error is sent when the user tries to join, or if the user submits form data that is not filled out correctly.</td>
  187. </tr>
  188. <tr>
  189. <td>&e409;</td>
  190. <td>The user has already joined the queue.</td>
  191. </tr>
  192. <tr>
  193. <td>&e503;</td>
  194. <td>The workgroup is valid but not accepting new join-queue requests.</td>
  195. </tr>
  196. </table>
  197. </section4>
  198. <section4 topic='Example' anchor='proto-user-join-example'>
  199. <p>The following protocol flows show an example of a user successfully joining a workgroup queue for support@workgroup.example.com.</p>
  200. <example caption='Successful Join'><![CDATA[
  201. U: <iq type='set'
  202. U: from='user@example.net/home'
  203. U: to='support@workgroup.example.com'
  204. U: id='id1'>
  205. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  206. U: <queue-notifications/>
  207. U: </join-queue>
  208. U: </iq>
  209. S: <iq type='result'
  210. S: from='support@workgroup.example.com'
  211. S: to='user@example.net/home'
  212. S: id='id1'/>
  213. ]]></example>
  214. <p>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 qualifies the &lt;crm/&gt; element in this example would be defined outside the context of this specification).</p>
  215. <example caption='Join With Meta-Data'><![CDATA[
  216. U: <iq type='set'
  217. U: from='user@example.net/home'
  218. U: to='support@workgroup.example.com'
  219. U: id='id2'>
  220. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  221. U: <crm xmlns='http://www.example.com/xmpp/workgroup'>
  222. U: <customer-id>the24th498onth</customer-id>
  223. U: <referrer>
  224. U: http://www.example.com/portal/
  225. U: </referrer>
  226. U: <product>Widget 1.0</product>
  227. U: </crm>
  228. U: <queue-notifications/>
  229. U: </join-queue>
  230. U: </iq>
  231. S: <iq type='result'
  232. S: from='support@workgroup.example.com'
  233. S: to='user@example.net/home'
  234. S: id='id2'/>
  235. ]]></example>
  236. <p>Finally an example of a required form submission before a user is allowed to the workgroup queue for support@workgroup.example.com. The data form in this example is trivial; please see <cite>XEP-0004</cite> for a complete data form example. The example begins as normal, but the workgroup returns a &e406; error.</p>
  237. <example caption='Join With Form'><![CDATA[
  238. U: <iq type='set'
  239. U: from='user@example.net/home'
  240. U: to='support@workgroup.example.com'
  241. U: id='id1'>
  242. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  243. U: <queue-notifications/>
  244. U: </join-queue>
  245. U: </iq>
  246. S: <iq type='error'
  247. S: from='support@workgroup.example.com'
  248. S: to='user@example.net/home'
  249. S: id='id1'>
  250. S: <error code='406' type='modify'>
  251. S: <not-acceptable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  252. S: </error>
  253. S: </iq>
  254. ]]></example>
  255. <p>The &e406; error indicates that a data form is required. The user requests the required data form from the workgroup.</p>
  256. <example caption='Join With Form (2)'><![CDATA[
  257. U: <iq type='get'
  258. U: from='user@example.net/home'
  259. U: to='support@workgroup.example.com'
  260. U: id='id2'>
  261. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'/>
  262. U: </iq>
  263. S: <iq type='result'
  264. S: from='support@workgroup.example.com'
  265. S: to='user@example.net/home'
  266. S: id='id2'>
  267. S: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  268. S: <x xmlns='jabber:iq:data' type='form'>
  269. S: <title>Support.com Chat Customer Information</title>
  270. S: <instructions>Welcome to example.com! Please provide us with
  271. S: some information about yourself so we can serve you better.
  272. S: </instructions>
  273. S: <field type='text-single' label='First Name' var='first' />
  274. S: <field type='text-single' label='Last Name' var='last' />
  275. S: <field type='list-single' label='Contract Type'
  276. var='contract_type'>
  277. S: <value>0</value>
  278. S: <option label='None'><value>0</value></option>
  279. S: <option label='Bronze'><value>1</value></option>
  280. S: <option label='Silver'><value>2</value></option>
  281. S: <option label='Gold'><value>3</value></option>
  282. S: </field>
  283. S: </x>
  284. S: </join-queue>
  285. S: </iq>
  286. ]]></example>
  287. <p>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. The user is now in the queue.</p>
  288. <example caption='Join With Form (3)'><![CDATA[
  289. U: <iq type='set'
  290. U: from='user@example.net/home'
  291. U: to='support@workgroup.example.com'
  292. U: id='id3'>
  293. U: <join-queue xmlns='http://jabber.org/protocol/workgroup'>
  294. U: <queue-notifications/>
  295. U: <x xmlns='jabber:iq:data' type='submit'>
  296. U: <field var='first'><value>John</value></field>
  297. U: <field var='last'><value>Doe</value></field>
  298. U: <field var='contract_type'><value>2</value></field>
  299. U: </x>
  300. U: </join-queue>
  301. U: </iq>
  302. S: <iq type='result'
  303. S: from='support@workgroup.example.com'
  304. S: to='user@example.net/home'
  305. S: id='id3' />
  306. ]]></example>
  307. </section4>
  308. </section3>
  309. <section3 topic='User Depart Protocol' anchor='proto-user-depart'>
  310. <p>This section 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.</p>
  311. <p>The user no longer wishes to be in the queue and issues a depart queue command.</p>
  312. <example caption='Transactions'><![CDATA[
  313. Requester Service
  314. | Depart Request |
  315. |----------------------------->|
  316. | Depart Response |
  317. |<-----------------------------|
  318. | |
  319. ]]></example>
  320. <p>The service notifies the user that they have been removed from the workgroup queue.</p>
  321. <example caption='Transactions (2)'><![CDATA[
  322. User Service
  323. | Depart Message |
  324. |<-----------------------------|
  325. | |
  326. ]]></example>
  327. <example caption='Depart Request'><![CDATA[
  328. U: <iq from='user@example.net/home' to='support@workgroup.example.com' id='id1' type='set'>
  329. U: <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
  330. U: </iq>
  331. ]]></example>
  332. <p>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:</p>
  333. <example caption='Depart Request With JID'><![CDATA[
  334. U: <iq from='admin-jid' to='support@workgroup.example.com' id='id1' type='set'>
  335. U: <depart-queue xmlns='http://jabber.org/protocol/workgroup'>
  336. U: <jid>user@example.net/home</jid>
  337. U: </depart-queue>
  338. U: </iq>
  339. ]]></example>
  340. <p>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 &e401; errors (see error section). A user removing their own queue entry MUST NOT receive unauthorized errors (the workgroup service MUST NOT prevent a user from departing the queue).</p>
  341. <p>The sender of the depart request receives a successful result packet:</p>
  342. <example caption='Depart Request'><![CDATA[
  343. S: <iq from='support@workgroup.example.com' to=user@example.net/home' id='id1' type='result'/>
  344. ]]></example>
  345. <p>And the user who is departing receives a depart message (the user may not have been the sender of the request):</p>
  346. <example caption='Depart Message'><![CDATA[
  347. S: <message from='support@workgroup.example.com' to='user@example.net/home'>
  348. S: <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
  349. S: </message>
  350. ]]></example>
  351. <p>The user will not be in the queue after a response is received unless the error response code is &e401;.</p>
  352. <section4 topic='Error Conditions' anchor='proto-user-depart-errors'>
  353. <table caption='Depart-Queue Error Conditions'>
  354. <tr>
  355. <th>Condition</th>
  356. <th>Description</th>
  357. </tr>
  358. <tr>
  359. <td>&e401;</td>
  360. <td>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.</td>
  361. </tr>
  362. <tr>
  363. <td>&e404;</td>
  364. <td>The user was not in the queue.</td>
  365. </tr>
  366. </table>
  367. </section4>
  368. <section4 topic='Example' anchor='proto-user-depart-example'>
  369. <p>A user leaves the workgroup queue support@workgroup.example.com.</p>
  370. <example caption='User Departs'><![CDATA[
  371. U: <iq from='user@example.net/home'
  372. U: to='support@workgroup.example.com'
  373. U: id='id1'
  374. U: type='set'>
  375. U: <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
  376. U: </iq>
  377. S: <iq from='support@workgoup.example.com'
  378. S: to='user@example.net/home'
  379. S: id='id1'
  380. S: type='result'/>
  381. S: <message from='support@workgroup.example.com' to='user@example.net/home'>
  382. S: <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
  383. S: </message>
  384. ]]></example>
  385. <p>An administrator removes a user from the workgroup queue support@workgroup.example.com.
  386. Notice that the depart-queue message is sent to the user that has left the queue.</p>
  387. <example caption='Administrator Removes User'><![CDATA[
  388. U: <iq from='admin@example.com/work'
  389. U: to='support@workgroup.example.com'
  390. U: id='id1'
  391. U: type='set'>
  392. U: <depart-queue xmlns='http://jabber.org/protocol/workgroup'>
  393. U: <jid>user@example.net/home</jid>
  394. U: </depart-queue>
  395. U: </iq>
  396. S: <iq from='support@workgroup.example.com'
  397. S: to='admin@example.com/work'
  398. S: id='id1'
  399. S: type='result'/>
  400. S: <message from='support@workgroupexample.com' to='user@example.net/home'>
  401. S: <depart-queue xmlns='http://jabber.org/protocol/workgroup'/>
  402. S: </message>
  403. ]]></example>
  404. </section4>
  405. </section3>
  406. <section3 topic='User Status Update Protocol' anchor='proto-user-status'>
  407. <p>This section describes the packet exchange for updating users on their queue status. This protocol MAY
  408. be supported by compliant implementations.</p>
  409. <example caption='Transactions'><![CDATA[
  410. User Service
  411. | User Status Push |
  412. |<-----------------------------|
  413. | |
  414. | User Status Request |
  415. |----------------------------->|
  416. | User Status Response |
  417. |<-----------------------------|
  418. | |
  419. ]]></example>
  420. <p>The workgroup service pushes updates to the user as their queue status changes. Furthermore, the user may request their queue status at any time.</p>
  421. <section4 topic='User Status Updates' anchor='proto-user-status-updates'>
  422. <p>User status updates are contained in a &lt;queue-status/&gt; element that updates the user on their queue position and estimated time. The position contained in a &lt;position&gt; 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.</p>
  423. <p>The queue time status is contained in a &lt;time/&gt; 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 per second between status updates. Clients may use this information to display the running estimated time to the user.</p>
  424. <p>A server 'push' occurs asynchronously to client:</p>
  425. <example caption='User Status Push'><![CDATA[
  426. S: <message to='user@example.net/home' from='support@workgroup.example.com'>
  427. S: <queue-status xmlns='http://jabber.org/protocol/workgroup'>
  428. S: <position>4</position>
  429. S: <time>60</time>
  430. S: </queue-status>
  431. S: </message>
  432. ]]></example>
  433. <p>Alternately the client may poll their position:</p>
  434. <example caption='User Status Poll'><![CDATA[
  435. U: <iq to='support@workgroup.example.com' from='user@example.net/home' id='id1' type='get'>
  436. U: <queue-status xmlns='http://jabber.org/protocol/workgroup'/>
  437. U: </iq>
  438. S: <iq to='user@example.net/home' from='support@workgroup.example.com' id='id1' type='result'>
  439. S: <queue-status xmlns='http://jabber.org/protocol/workgroup'>
  440. S: <position>4</position>
  441. S: <time>60</time>
  442. S: </queue-status>
  443. S: </iq>
  444. ]]></example>
  445. </section4>
  446. <section4 topic='Error Conditions' anchor='proto-user-status-errors'>
  447. <table caption='Queue-Status Error Conditions'>
  448. <tr>
  449. <th>Condition</th>
  450. <th>Description</th>
  451. </tr>
  452. <tr>
  453. <td>&e401;</td>
  454. <td>Sent by the server to the user in response to a status query only if
  455. the user is not a member of the queue.</td>
  456. </tr>
  457. <tr>
  458. <td>&e501;</td>
  459. <td>Sent only if status updates are not implemented in either the client or server.</td>
  460. </tr>
  461. </table>
  462. </section4>
  463. </section3>
  464. <section3 topic='User Invite Protocol' anchor='proto-user-invite'>
  465. <p>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.</p>
  466. <example caption='Transactions'><![CDATA[
  467. User Service
  468. | User Invite |
  469. |<-----------------------------|
  470. | |
  471. ]]></example>
  472. <p>The server sends an invitation to the user to begin their conversation with an agent, structured according to the format defined in <cite>XEP-0045</cite>. The 'from' attribute of the &lt;invite/&gt; element MUST be set to the JID of the workgroup. 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.</p>
  473. <section4 topic='Error Conditions' anchor='proto-user-invite-errors'>
  474. <p>There are no defined error conditions for user invitations.</p>
  475. </section4>
  476. <section4 topic='Example' anchor='proto-user-invite-example'>
  477. <p>An invitation from the server on behalf of the support@example.net workgroup:</p>
  478. <example caption='An Invitation'><![CDATA[
  479. S: <message
  480. S: from='roomname@chatserver.example.com'
  481. S: to='user@example.net/home'>
  482. S: <x xmlns='http://jabber.org/protocol/muc#user'>
  483. S: <invite from='support@workgroup.example.com'>
  484. S: <reason>
  485. S: You have been invited to chat with a support@workgroup.example.com
  486. agent.
  487. S: </reason>
  488. S: </invite>
  489. S: </x>
  490. S: </message>
  491. ]]></example>
  492. </section4>
  493. </section3>
  494. </section2>
  495. </section1>
  496. <section1 topic='Agent Protocol' anchor='agent'>
  497. <section2 topic='Agent States' anchor='proto-agent-states'>
  498. <p>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@workgroup.example.com workgroup when they begin working at example.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 document.</p>
  499. <p>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 document. It is expected that other deployment specific meta-data will also be needed to make routing decisions.</p>
  500. <p>The general agent workgroup state diagram is shown below:</p>
  501. <code><![CDATA[
  502. +-----------+
  503. +---->| Workgroup |<-----+
  504. | +-----------+ |
  505. | | |Agent |
  506. | Status | |Presence |
  507. +--------+ +---------+
  508. ]]></code>
  509. <p>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.</p>
  510. <p>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:</p>
  511. <code><![CDATA[
  512. +-------+
  513. | Start |<---------+
  514. +-------+ |
  515. | |
  516. | Offer |
  517. v |
  518. +---------------+ |
  519. | Offer Pending | |
  520. +---------------+ |
  521. | | | Revoke |
  522. | | +-------->|
  523. | | Reject |
  524. Accept | +----------->|
  525. v |
  526. +--------------+ |
  527. | Chat Pending | |
  528. +--------------+ |
  529. | | Revoke |
  530. Invite | +-----------+
  531. V
  532. +-----------+
  533. | Chat room |
  534. +-----------+
  535. ]]></code>
  536. </section2>
  537. <section2 topic='Agent Packet Exchanges' anchor='proto-agent'>
  538. <p>Packets are exchanged between the agent and service to trigger state changes in the agent client. These packet exchanges are described next.</p>
  539. <section3 topic='Agent Presence Protocol' anchor='proto-agent-presence'>
  540. <p>This section describes the packet exchange allowing agents to update a workgroup with their current presence. This protocol MUST be supported by compliant implementations.</p>
  541. <example caption='Transactions'><![CDATA[
  542. Agent Service
  543. | Presence Update |
  544. |----------------------------->|
  545. | |
  546. ]]></example>
  547. <p>The agent must inform the workgroup of its presence by sending it a directed (not broadcast) 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.</p>
  548. <example caption='Presence Update'><![CDATA[
  549. U: <presence from='alice@example.com/work' to='support@workgroup.example.com'>
  550. U: <agent-status xmlns='http://jabber.org/protocol/workgroup'>
  551. U: <max-chats>count</max-chats>
  552. U: </agent-status>
  553. U: </presence>
  554. ]]></example>
  555. <p>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:</p>
  556. <ul>
  557. <li>chat - Indicates the agent is available to chat (is idle and ready to handle more conversations).</li>
  558. <li>away - The agent is busy (possibly with other chats). The agent may still be able to handle other chats but an offer rejection is likely.</li>
  559. <li>xa - The agent is physically away from their terminal and should not have a chat routed to them.</li>
  560. <li>dnd - The agent is busy and should not be disturbed. However, special case, or extreme urgency chats may still be offered to the agent although offer rejection or offer timeouts are highly likely.</li>
  561. </ul>
  562. <p>Agents MAY also embed meta-data to help the workgroup service route chat requests, using the &lt;max-chats&gt; element, which specifies the maximum number of chats the agent can handle. If a presence is sent to the workgroup that does not contain the max-chats value, the "default setting" will be assumed. The value of the default setting for an agent is up to an implementation. <note>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.</note></p>
  563. <section4 topic='Error Conditions' anchor='proto-agent-presence-errors'>
  564. <p>There are no defined error conditions for presence updates.</p>
  565. </section4>
  566. <section4 topic='Example' anchor='proto-agent-presence-example'>
  567. <p>An agent (alice) becomes available to the workgroup support@workgroup.example.com.</p>
  568. <example caption='Agent Becomes Available'><![CDATA[
  569. U: <presence from='alice@example.com/work'
  570. U: to='support@workgroup.example.com'>
  571. U: <show>chat</show>
  572. U: <agent-status xmlns='http://jabber.org/protocol/workgroup'>
  573. U: <max-chats>3</max-chats>
  574. U: </agent-status>
  575. U: </presence>
  576. ]]></example>
  577. </section4>
  578. </section3>
  579. <section3 topic='Workgroup Status Update Protocol' anchor='proto-workgroup-status'>
  580. <p>This section describes the packet exchange used to update agents on the status of the workgroup. This protocol MAY be supported by compliant implementations.</p>
  581. <p>After an agent announces their presence to the workgroup, they will begin receiving presence updates from the workgroup. All fields are optional:</p>
  582. <example caption='Notify-Agent Status Type'><![CDATA[
  583. S: <presence to='alice@example.com/work' from='support@workgroup.example.com'>
  584. S: <notify-agents xmlns='http://jabber.org/protocol/workgroup'>
  585. S: <available>count</available>
  586. S: <current-chats>count</current-chats>
  587. S: <max-chats>count</max-chats>
  588. S: </notify-agents>
  589. S: </presence>
  590. ]]></example>
  591. <p>The defined sub-elements of &lt;notify-agents&gt; are:</p>
  592. <ul>
  593. <li>&lt;available&gt; - The total number of agents available in the workgroup.</li>
  594. <li>&lt;current-chats&gt; - The current total number of chats being handled by agents in the workgroup.</li>
  595. <li>&lt;max-chats&gt; - The maximum number of simultaneous conversations that can be handled by agents in the workgroup.</li>
  596. </ul>
  597. <section4 topic='Error Conditions' anchor='proto-workgroup-status-errors'>
  598. <p>There are no defined error conditions for notify workgroup updates.</p>
  599. </section4>
  600. <section4 topic='Example' anchor='proto-workgroup-status-example'>
  601. <p>An agent (alice) receives an update from workgroup support@workgroup.example.com.</p>
  602. <example caption='Agent Recives Update'><![CDATA[
  603. S: <presence to='alice@example.com/work' from='support@wokgroup.example.com'>
  604. S: <notify-agents xmlns='http://jabber.org/protocol/workgroup'>
  605. S: <available>2</available>
  606. S: <current-chats>2</current-chats>
  607. S: <max-chats>7</max-chats>
  608. S: </notify-agents>
  609. S: </presence>
  610. ]]></example>
  611. </section4>
  612. </section3>
  613. <section3 topic='Queue Status Update Protocol' anchor='proto-queue-status'>
  614. <p>This section describes the packet exchange used to update agents on the status of the workgroup queue. This protocol MAY be supported by compliant implementations.</p>
  615. <p>After an agent announces their presence to the workgroup, they will begin receiving presence updates from the workgroup with an overview and details on the queue status.</p>
  616. <p>The &lt;notify-queue/&gt; element updates the agent with a summary of the status of the workgroup queue. All fields are optional:</p>
  617. <example caption='Notify-Queue Status Type'><![CDATA[
  618. S: <presence to='alice@example.com/work' from='support@workgroup.example.com'>
  619. S: <notify-queue xmlns='http://jabber.org/protocol/workgroup'>
  620. S: <count>count</count>
  621. S: <oldest>YYYY-MM-DDTHH:mm:ss</oldest>
  622. S: <time>average-time-to-chat</time>
  623. S: <status>open</status>
  624. S: </notify-queue>
  625. S: </presence>
  626. ]]></example>
  627. <p>The defined sub-elements of &lt;notify-queue&gt; are:</p>
  628. <ul>
  629. <li>&lt;count&gt; - The total number of users in the workgroup queue.</li>
  630. <li>&lt;oldest&gt; - The date and time when the oldest member of the queue joined (MUST conform to the DateTime profile defined in &xep0082;).</li>
  631. <li>&lt;time&gt; - The average time in seconds that a user is in the queue before they are routed to an agent for handling.</li>
  632. <li>&lt;status&gt; - The status of the queue. Queues may be active (requests are being routed and handled by agents) but not accepting new requests for handling. Typical reasons for this state include the queue is shutting down but finishing processing users in the queue, or because the queue has too many requests and should not accept more request until the existing requests are handled. The status field MUST contain one of the following values:
  633. <ul>
  634. <li>open - the queue is active and accepting new chat requests</li>
  635. <li>active - the queue is active but NOT accepting new chat requests</li>
  636. <li>closed - the queue is NOT active and NOT accepting new chat requests</li>
  637. </ul>
  638. </li>
  639. </ul>
  640. <p>The &lt;notify-queue-details/&gt; element updates the agent with details of the workgroup queue. All fields are optional:</p>
  641. <example caption='Notify-Queue-Details Status Type'><![CDATA[
  642. S: <presence to='alice@example.com/work' from='support@workgroup.example.com'>
  643. S: <notify-queue-details xmlns='http://jabber.org/protocol/workgroup'>
  644. S: <user jid='user@example.net/home'>
  645. S: <position>pos</position>
  646. S: <time>estimated-time</time>
  647. S: <join-time>YYYY-MM-DDTHH:mm:SS</join-time>
  648. S: </user>
  649. S: </notify-queue-details>
  650. S: </presence>
  651. ]]></example>
  652. <p>An update may contain one or more &lt;user&gt; entries (one per user in the queue). The defined sub-elements of &lt;user&gt; are:</p>
  653. <ul>
  654. <li>&lt;position&gt; - The user's zero-based position in the queue.</li>
  655. <li>&lt;time&gt; - Estimated time in seconds remaining before the user is routed to an agent.</li>
  656. <li>&lt;join-time&gt; - The datetime when the user joined the queue (MUST conform to the DateTime profile defined in <cite>XEP-0082</cite>).</li>
  657. </ul>
  658. <section4 topic='Error Conditions' anchor='proto-queue-status-errors'>
  659. <p>There are no defined error conditions for workgroup queue status updates.</p>
  660. </section4>
  661. <section4 topic='Example' anchor='proto-queue-status-example'>
  662. <p>An agent receives an update from workgroup support@workgroup.example.com.</p>
  663. <example caption='Agent Receives Updates'><![CDATA[
  664. S: <presence to='alice@example.com/work' from='support@workgroup.example.com'>
  665. S: <notify-queue xmlns='http://jabber.org/protocol/workgroup'>
  666. S: <count>1</count>
  667. S: <oldest>20050208T10:00:00</oldest>
  668. S: <time>30</time>
  669. S: <status>open</status>
  670. S: </notify-queue>
  671. S: </presence>
  672. S: <presence to='alice@example.com/work' from='support@workgroup.example.com'>
  673. S: <notify-queue-details xmlns='http://jabber.org/protocol/workgroup'>
  674. S: <user jid='user@example.net/home'>
  675. S: <position>1</position>
  676. S: <time>5</time>
  677. S: <join-time>20050208T10:00:00</join-time>
  678. S: </user>
  679. S: </notify-queue-details>
  680. S: </presence>
  681. ]]></example>
  682. </section4>
  683. </section3>
  684. <section3 topic='Agent Status Update Protocol' anchor='proto-agent-status'>
  685. <p>This section describes the packet exchange used to update agents on the status of other agents in the workgroup. This protocol MAY be supported by compliant implementations.</p>
  686. <example caption='Transactions'><![CDATA[
  687. Agent Service
  688. | Request Agent Status |
  689. |----------------------------->|
  690. | Agent List |
  691. |<-----------------------------|
  692. | |
  693. | Agent Presence Pushes |
  694. |<-----------------------------|
  695. ]]></example>
  696. <p>The workgroup service pushes presence updates to the agent as the presence of other agents changes. This will only occur after an agent has requested to receive other agents' information. The server will continue to send presence updates until the agent sends an unavailable presence to the server. This protocol is similar to the standard XMPP roster workflow.</p>
  697. <p>To receive presence updates for other agents in the workgroup, the agent sends an agent info request to the workgroup:</p>
  698. <example caption='Request Element'><![CDATA[
  699. U: <iq to='support@workgroup.example.com' from='alice@example.com/work'
  700. U: id='id1' type='get'>
  701. U: <agent-status-request xmlns='http://jabber.org/protocol/workgroup'/>
  702. U: </iq>
  703. ]]></example>
  704. <p>The workgroup will then reply with a list of all agents in the workgroup (excluding the agent making the request):</p>
  705. <example caption='Response Element'><![CDATA[
  706. S: <iq to='alice@example.com/work' from='support@workgroup.example.com'
  707. S: id='id1' type='result'>
  708. S: <agent-status-request xmlns='http://jabber.org/protocol/workgroup'>
  709. S: <agent jid='bob@example.com' />
  710. S: </agent-status-request>
  711. S: </iq>
  712. ]]></example>
  713. <p>The server will then push presence packets for other agents as their presence changes. All fields in the &lt;agent-status&gt; child stanza are optional, but an &lt;agent-status&gt; child stanza must be present:</p>
  714. <example caption='Agent Status Update'><![CDATA[
  715. S: <presence to='alice@example.com/work' from='bob@example.com/work'>
  716. S: <agent-status xmlns='http://jabber.org/protocol/workgroup'>
  717. S: <current-chats>2</current-chats>
  718. S: <max-chats>4</max-chats>
  719. S: </agent-status>
  720. S: </presence>
  721. ]]></example>
  722. <p>The defined sub-elements of &lt;agent-status&gt; are:</p>
  723. <ul>
  724. <li>&lt;current-chats&gt; - The number of conversations currently being handled by the agent.</li>
  725. <li>&lt;max-chats&gt; - The maximum number of simultaneous conversations the agent can handle.</li>
  726. </ul>
  727. <section4 topic='Error Conditions' anchor='proto-agent-status-errors'>
  728. <p>There are no defined error conditions for agent status updates.</p>
  729. </section4>
  730. </section3>
  731. <section3 topic='Agent Offer Protocol' anchor='proto-agent-offer'>
  732. <p>This section describes the packet exchange involved in a service offering a chat to an agent. This protocol MUST be supported by compliant implementations.</p>
  733. <example caption='Transactions'><![CDATA[
  734. Agent Service
  735. | Offer Request |
  736. |<-----------------------------|
  737. | Offer Response |
  738. |----------------------------->|
  739. | |
  740. ]]></example>
  741. <p>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.</p>
  742. <example caption='Offer Request'><![CDATA[
  743. S: <iq from='support@workgroup.example.com' to='alice@example.com/work' id='id1' type='set'>
  744. S: <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'>
  745. S: <timeout>seconds</timeout>
  746. S: </offer>
  747. S: </iq>
  748. ]]></example>
  749. <p>Application specific meta-data will normally be added as a sub-element of &lt;offer&gt; to help agents decide whether to accept or not (formats for which are out of scope for this document). An optional &lt;timeout&gt; sub-element may be included indicating the amount of time the offer stands before the service will revoke it.</p>
  750. <example caption='Offer Response'><![CDATA[
  751. A: <iq from='alice@example.com/work' to='support@workgroup.example.com' id='id1' type='result'/>
  752. ]]></example>
  753. <p>The agent may respond only with a successful result.</p>
  754. <section4 topic='Error Conditions' anchor='proto-agent-offer-errors'>
  755. <p>There are no defined error conditions for an offer response.</p>
  756. </section4>
  757. <section4 topic='Example' anchor='proto-agent-offer-example'>
  758. <p>An agent is offered a chat with a user. The offer will be revoked in 30 seconds.</p> <example caption='Agent is Offered a Chat'><![CDATA[
  759. S: <iq to='alice@example.com/work'
  760. S: from='support@workgroup.example.com'
  761. S: id='id1'
  762. S: type='set'>
  763. S: <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'>
  764. S: <timeout>30</timeout>
  765. S: </offer>
  766. S: </iq>
  767. A: <iq to='support@workgroup.example.com'
  768. A: from='alice@example.com/work'
  769. A: id='id1'
  770. A: type='result'/>
  771. ]]></example>
  772. <p>The following is a more typical offer containing meta-data about the user. The offer will be revoked in 30 seconds.</p>
  773. <example caption='Offer Including Meta-Data'><![CDATA[
  774. S: <iq to='alice@example.com/work'
  775. S: from='support@workgroup.example.com'
  776. S: id='id2'
  777. S: type='set'>
  778. S: <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'>
  779. S: <timeout>30</timeout>
  780. S: <crm xmlns='http://www.example.com/xmpp/workgroup'>
  781. S: <user-id>423498ae84f</user-id>
  782. S: <product>Widget 1.0</product>
  783. S: </crm>
  784. S: </offer>
  785. S: </iq>
  786. A: <iq to='support@workgroup.example.com'
  787. A: from='alice@example.com/work'
  788. A: id='id2'
  789. A: type='result'/>
  790. ]]></example>
  791. </section4>
  792. </section3>
  793. <section3 topic='Agent Offer Accept/Reject Protocol' anchor='proto-agent-acceptreject'>
  794. <p>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.</p>
  795. <example caption='Transactions'><![CDATA[
  796. Agent Service
  797. | Offer Accept/Reject Request |
  798. |----------------------------->|
  799. | Offer Accept/Reject Response |
  800. |<-----------------------------|
  801. | |
  802. ]]></example>
  803. <p>The agent accepts or rejects an offer to chat with a user.</p>
  804. <example caption='Offer Accept Request'><![CDATA[
  805. A: <iq to='support@workgroup.example.com' from='alice@example.com/work' id='id1' type='set'>
  806. A: <offer-accept jid='user@example.net/home' xmlns='http://jabber.org/protocol/workgroup' />
  807. A: </iq>
  808. ]]></example>
  809. <example caption='Offer Reject Request'><![CDATA[
  810. A: <iq to='support@workgroup.example.com' from='alice@example.com/work' id='id1' type='set'>
  811. A: <offer-reject jid='user@example.net/home' xmlns='http://jabber.org/protocol/workgroup'/>
  812. A: </iq>
  813. ]]></example>
  814. <example caption='Offer Response'><![CDATA[
  815. S: <iq to='alice@example.com/work' from='support@workgroup.example.com' id='id1' type='result'/>
  816. ]]></example>
  817. <p>The service may respond only with a successful result.</p>
  818. <section4 topic='Error Conditions' anchor='proto-agent-acceptreject-errors'>
  819. <p>There are no defined error conditions for an accept/reject offer response.</p>
  820. </section4>
  821. <section4 topic='Example' anchor='proto-agent-acceptreject-example'>
  822. <example caption='Agent Accepts Chat'><![CDATA[
  823. A: <iq from='alice@example.com/work'
  824. A: to='support@workgroup.example.com'
  825. A: id='id3'
  826. A: type='set'>
  827. A: <offer-accept jid='user@example.net/home' xmlns='http://jabber.org/protocol/workgroup'/>
  828. A: </iq>
  829. S: <iq from='support@workgroup.example.com'
  830. S: to='alice@example.com/work'
  831. S: id='id3'
  832. S: type='result'/>
  833. ]]></example>
  834. </section4>
  835. </section3>
  836. <section3 topic='Agent Offer Revoke Protocol' anchor='proto-agent-revoke'>
  837. <p>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.</p>
  838. <example caption='Transactions'><![CDATA[
  839. Agent Service
  840. | Offer Revoke Request |
  841. |<-----------------------------|
  842. | Offer Revoke Response |
  843. |----------------------------->|
  844. | |
  845. ]]></example>
  846. <p>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).</p>
  847. <example caption='Offer Revoke Request'><![CDATA[
  848. S: <iq from='support@workgroup.example.com' to='alice@example.com/work' id='id1' type='set'>
  849. S: <offer-revoke jid='user@example.net/home' xmlns='http://jabber.org/protocol/workgroup'>
  850. S: <reason>
  851. S: [natural-language text]
  852. S: </reason>
  853. S: </offer-revoke>
  854. S: </iq>
  855. ]]></example>
  856. <p>The reason element may optionally contain free form text explaining the reason the offer was revoked.</p>
  857. <example caption='Offer Response'><![CDATA[
  858. A: <iq from='alice@example.com/work' to='support@workgroup.example.com' id='id1' type='result'/>
  859. ]]></example>
  860. <p>The agent may respond only with a successful result.</p>
  861. <section4 topic='Error Conditions' anchor='proto-agent-revoke-errors'>
  862. <p>There are no defined error conditions for an offer response.</p>
  863. </section4>
  864. <section4 topic='Example' anchor='proto-agent-revoke-example'>
  865. <example caption='Offer Revoked Due to Timeout'><![CDATA[
  866. S: <iq to='alice@example.com/work'
  867. S: from='support@workgroup.example.com'
  868. S: id='id4'
  869. S: type='set'>
  870. S: <offer-revoke xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'>
  871. S: <reason>
  872. S: Offer timed out
  873. S: </reason>
  874. S: </offer-revoke>
  875. S: </iq>
  876. A: <iq to='support@workgroup.example.com'
  877. A: from='alice@example.com/work'
  878. A: id='id4'
  879. A: type='result'/>
  880. ]]></example>
  881. </section4>
  882. </section3>
  883. <section3 topic='Agent Invite Protocol' anchor='proto-agent-invite'>
  884. <p>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.</p>
  885. <example caption='Transactions'><![CDATA[
  886. Agent Service
  887. | Agent Invite |
  888. |<-----------------------------|
  889. | |
  890. ]]></example>
  891. <p>The server sends an invitation to the agent to begin their conversation with the user, structured according to the format defined in <cite>XEP-0045</cite>. The 'from' attribute of the &lt;invite/&gt; element MUST be set to the JID of the workgroup.</p>
  892. <p>In order to match invitations to offers, all invitations SHOULD include meta-data in the &lt;offer/&gt; element, with the JID of the user specified via the 'jid' attribute. The typical meta-data fragment would appear as:</p>
  893. <example caption='Invitation Meta-Data'><![CDATA[
  894. <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'>
  895. ]]></example>
  896. <section4 topic='Error Conditions' anchor='proto-agent-invite-errors'>
  897. <p>There are no defined error conditions for agent invitations.</p>
  898. </section4>
  899. <section4 topic='Example' anchor='proto-agent-invite-example'>
  900. <p>An invitation from the server on behalf of the support@example.net workgroup:</p>
  901. <example caption='An Invitation'><![CDATA[
  902. S: <message
  903. S: from='roomname@chatserver.example.com'
  904. S: to='alice@example.com/work'>
  905. S: <x xmlns='http://jabber.org/protocol/muc#user'>
  906. S: <invite from='support@workgroup.example.com'>
  907. S: <reason>
  908. S: Please join the chat room to start your chat with user@example.net.
  909. S: </reason>
  910. S: </invite>
  911. S: </x>
  912. S: <offer xmlns='http://jabber.org/protocol/workgroup' jid='user@example.net/home'/>
  913. S: </message>
  914. ]]></example>
  915. </section4>
  916. </section3>
  917. </section2>
  918. </section1>
  919. <section1 topic='Service Discovery' anchor='disco'>
  920. <p>Service Discovery support is optional for Workgroup compliant implementations. Workgroup services that do support Service Discovery MUST:</p>
  921. <ul>
  922. <li>Use the &lt;identity&gt; category='collaboration'.</li>
  923. <li>Use the &lt;identity&gt; type='workgroup'.</li>
  924. <li>Use the &lt;feature&gt; var='http://jabber.org/protocol/workgroup'.</li>
  925. </ul>
  926. <p>An example of discovery browsing is included. Notice how probing starts at the server (example.com) revealing the workgroup service by it's JID (workgroup.example.com) and a simple, human friendly name ("Example.com Live Assistant"). It is only during the discovery probing of the service that it is identified as a workgroup using the &lt;identity&gt; and &lt;feature&gt; tags. Finally individual workgroups (support and sales) can be discovered on the Workgroup service. When individual workgroups are probed, the &lt;identity&gt; and &lt;feature&gt; tags are again presented to identify them as workgroups along with (optional) associated meta-data.</p>
  927. <example caption='Workgroup Service Discovery'><![CDATA[
  928. U: <iq to='example.com' from='user@example.net/home' id='id1' type='get'>
  929. U: <query xmlns='http://jabber.org/protocol/disco#items'/>
  930. U: </iq>
  931. S: <iq from='example.com' to='user@example.net/home' id='id1' type='result'>
  932. S: <query xmlns='http://jabber.org/protocol/disco#items'>
  933. S: <item jid='workgroup.example.com' name='Example.com Live Assistant'/>
  934. S: </query>
  935. S: </iq>
  936. U: <iq to='workgroup.example.com' from='user@example.net/home' id='id2' type='get'>
  937. U: <query xmlns='http://jabber.org/protocol/disco#info'/>
  938. U: </iq>
  939. S: <iq from='workgroup.example.com' to='user@example.net/home' id='i2' type='result'>
  940. S: <query xmlns='http://jabber.org/protocol/disco#info'>
  941. S: <identity category='collaboration' name='Live Assistant' type='workgroup'/>
  942. S: <feature var='http://jabber.org/protocol/workgroup'/>
  943. S: <feature var='http://jabber.org/protocol/disco#info'/>
  944. S: </query>
  945. S: </iq>
  946. U: <iq to='workgroup.example.com' from='user@example.net/home' id='id3' type='get'>
  947. U: <query xmlns='http://jabber.org/protocol/disco#items'/>
  948. U: </iq>
  949. S: <iq from='workgroup.example.com' to='user@example.net/home' id='id3' type='result'>
  950. S: <query xmlns='http://jabber.org/protocol/disco#items'>
  951. S: <item jid='support@workgroup.example.com' name='Example.com Support Live Assistant'/>
  952. S: <item jid='sales@workgroup.example.com' name='Example.com Sales Live Assistant'/>
  953. S: </query>
  954. S: </iq>
  955. U: <iq to='support@workgroup.example.com' from='user@example.net/home' id='id4' type="get'>
  956. U: <query xmlns='http://jabber.org/protocol/disco#info'/>
  957. U: </iq>
  958. S: <iq from='support@workgroup.example.com' to='user@example.net/home' id='id4' type='result'>
  959. S: <query xmlns='http://jabber.org/protocol/disco#info'>
  960. S: <identity category='collaboration' name='demo' type='workgroup'/>
  961. S: <feature var='http://jabber.org/protocol/disco#info'/>
  962. S: <x xmlns='jabber:x:data' type='result'>
  963. S: <field var='FORM_TYPE' type='hidden'>
  964. S: <value>http://jabber.org/protocol/workgroup#workgroupinfo</value>
  965. S: </field>
  966. S: <field var='workgroup#description' label='Description'>
  967. S: <value>Example.com Support Workgroup</value>
  968. S: </field>
  969. S: <field var='workgroup#online' label='Status'>
  970. S: <value>ready</value>
  971. S: </field>
  972. S: </x>
  973. S: </query>
  974. S: </iq>
  975. ]]></example>
  976. </section1>
  977. <section1 topic='Implementation Notes' anchor='impl'>
  978. <ul>
  979. <li>A workgroup is a normal XMPP messaging node and MUST maintain its own presence. It is recommended that a workgroup 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 service's 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. 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.</li>
  980. <li>If workgroup goes offline, all queued users SHOULD be notified using the appropriate workgroup presence, status, and depart protocols.</li>
  981. <li>An implementation MAY support anonymous login by users, which makes it easier to deploy such a system on a website.</li>
  982. <li>Generally, client authors only need to implement the "user" portion of this document so that clients can contact workgroups. Implementing the "agent" portion of the document is generally left to specialized clients for agents.</li>
  983. <li>Coordination of groupchat and workgroup services is beyond the scope of this document. It is RECOMMENDED that implementations use or create standard mechanisms to allow workgroups and groupchat services to interact.</li>
  984. </ul>
  985. </section1>
  986. <section1 topic='Security Considerations' anchor='security'>
  987. <p>Implementations may wish to restrict who is allowed to join workgroups as users and agents. Details concerning the implementation of this feature is outside the scope of this document.</p>
  988. </section1>
  989. <section1 topic='IANA Considerations' anchor='iana'>
  990. <p>This document requires no interaction with &IANA;.</p>
  991. </section1>
  992. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  993. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  994. <p>The &REGISTRAR; shall include 'http://jabber.org/protocol/workgroup' in its registry of protocol namespaces.</p>
  995. </section2>
  996. <section2 topic='Service Discovery Category/Type' anchor='registrar-discotype'>
  997. <p>The XMPP Registrar shall add a Service Discovvery type of "workgroup" to the existing "collaboration" category. The registry submission is as follows:</p>
  998. <code><![CDATA[
  999. <category>
  1000. <name>collaboriation</name>
  1001. <type>
  1002. <name>workgroup</name>
  1003. <desc>A workgroup component.</desc>
  1004. <doc>XEP-0142</doc>
  1005. </type>
  1006. </category>
  1007. ]]></code>
  1008. </section2>
  1009. </section1>
  1010. <section1 topic='XML Schema' anchor='schema'>
  1011. <code><![CDATA[
  1012. <?xml version='1.0' encoding='UTF-8'?>
  1013. <xs:schema
  1014. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  1015. targetNamespace='http://jabber.org/protocol/workgroup'
  1016. xmlns='http://jabber.org/protocol/workgroup'
  1017. elementFormDefault='qualified'>
  1018. <xs:annotation>
  1019. <xs:documentation>
  1020. The allowable root elements for the namespace defined
  1021. herein are:
  1022. - agent-status
  1023. - agent-status-request
  1024. - depart-queue
  1025. - join-queue
  1026. - notify-agents
  1027. - notify-queue
  1028. - notify-queue-details
  1029. - offer
  1030. - offer-accept
  1031. - offer-reject
  1032. - offer-revoke
  1033. - queue-status
  1034. </xs:documentation>
  1035. </xs:annotation>
  1036. <xs:import
  1037. namespace='jabber:x:data'
  1038. schemaLocation='http://www.xmpp.org/schemas/x-data.xsd'/>
  1039. <xs:element name='agent-status'>
  1040. <xs:complexType>
  1041. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1042. <xs:element name='current-chats' type='xs:positiveInteger'/>
  1043. <xs:element name='max-chats' type='xs:positiveInteger'/>
  1044. </xs:choice>
  1045. </xs:complexType>
  1046. </xs:element>
  1047. <xs:element name='agent-status-request'>
  1048. <xs:complexType>
  1049. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  1050. <xs:element ref='agent'/>
  1051. </xs:sequence>
  1052. </xs:complexType>
  1053. </xs:element>
  1054. <xs:element name='depart-queue'>
  1055. <xs:complexType>
  1056. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1057. <xs:element name='jid' type='xs:string'/>
  1058. <xs:any namespace='##other' processContents='lax'/>
  1059. </xs:choice>
  1060. </xs:complexType>
  1061. </xs:element>
  1062. <xs:element name='join-queue'>
  1063. <xs:complexType>
  1064. <xs:choice xmlns:xdata='jabber:x:data' minOccurs='0' maxOccurs='unbounded'>
  1065. <xs:element name='queue-notifications' type='empty'/>
  1066. <xs:element ref='xdata:x'/>
  1067. <xs:any namespace='##other' processContents='lax'/>
  1068. </xs:choice>
  1069. </xs:complexType>
  1070. </xs:element>
  1071. <xs:element name='notify-agents'>
  1072. <xs:complexType>
  1073. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1074. <xs:element name='available' type='xs:positiveInteger'/>
  1075. <xs:element name='current-chats' type='xs:positiveInteger'/>
  1076. <xs:element name='max-chats' type='xs:positiveInteger'/>
  1077. </xs:choice>
  1078. </xs:complexType>
  1079. </xs:element>
  1080. <xs:element name='notify-queue'>
  1081. <xs:complexType>
  1082. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1083. <xs:element name='count' type='xs:positiveInteger'/>
  1084. <xs:element name='oldest' type='xs:dateTime'/>
  1085. <xs:element name='time' type='xs:positiveInteger'/>
  1086. <xs:element name='status'>
  1087. <xs:simpleType>
  1088. <xs:restriction base='xs:NCName'>
  1089. <xs:enumeration value='moderator'/>
  1090. <xs:enumeration value='none'/>
  1091. <xs:enumeration value='participant'/>
  1092. <xs:enumeration value='visitor'/>
  1093. </xs:restriction>
  1094. </xs:simpleType>
  1095. </xs:element>
  1096. </xs:choice>
  1097. </xs:complexType>
  1098. </xs:element>
  1099. <xs:element name='notify-queue-details'>
  1100. <xs:complexType>
  1101. <xs:sequence minOccurs='0' maxOccurs='unbounded'>
  1102. <xs:element ref='user'/>
  1103. </xs:sequence>
  1104. </xs:complexType>
  1105. </xs:element>
  1106. <xs:element name='offer'>
  1107. <xs:complexType>
  1108. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1109. <xs:element name='timeout' type='xs:positiveInteger'/>
  1110. <xs:any namespace='##other' processContents='lax'/>
  1111. </xs:choice>
  1112. </xs:complexType>
  1113. </xs:element>
  1114. <xs:element name='offer-accept'>
  1115. <xs:complexType>
  1116. <xs:simpleContent>
  1117. <xs:extension base='empty'>
  1118. <xs:attribute name='jid' use='required' type='xs:string'/>
  1119. </xs:extension>
  1120. </xs:simpleContent>
  1121. </xs:complexType>
  1122. </xs:element>
  1123. <xs:element name='offer-reject'>
  1124. <xs:complexType>
  1125. <xs:simpleContent>
  1126. <xs:extension base='empty'>
  1127. <xs:attribute name='jid' use='required' type='xs:string'/>
  1128. </xs:extension>
  1129. </xs:simpleContent>
  1130. </xs:complexType>
  1131. </xs:element>
  1132. <xs:element name='offer-revoke'>
  1133. <xs:complexType>
  1134. <xs:sequence minOccurs='0'>
  1135. <xs:element name='reason' type='xs:string'/>
  1136. </xs:sequence>
  1137. <xs:attribute name='jid' type='xs:string' use='required'/>
  1138. </xs:complexType>
  1139. </xs:element>
  1140. <xs:element name='queue-status'>
  1141. <xs:complexType>
  1142. <xs:choice minOccurs='0' maxOccurs='unbounded'>
  1143. <xs:element name='position' type='xs:positiveInteger'/>
  1144. <xs:element name='time' type='xs:positiveInteger'/>
  1145. <xs:any namespace='##other' processContents='lax'/>
  1146. </xs:choice>
  1147. </xs:complexType>
  1148. </xs:element>
  1149. <xs:element name='user'>
  1150. <xs:complexType>
  1151. <xs:sequence>
  1152. <xs:element name='position' type='xs:positiveInteger'/>
  1153. <xs:element name='time' type='xs:positiveInteger'/>
  1154. <xs:element name='join-time' type='xs:dateTime'/>
  1155. </xs:sequence>
  1156. <xs:attribute name='jid' type='xs:string' use='required'/>
  1157. </xs:complexType>
  1158. </xs:element>
  1159. <xs:element name='agent'>
  1160. <xs:complexType>
  1161. <xs:simpleContent>
  1162. <xs:extension base='empty'>
  1163. <xs:attribute name='jid' use='required' type='xs:string'/>
  1164. </xs:extension>
  1165. </xs:simpleContent>
  1166. </xs:complexType>
  1167. </xs:element>
  1168. <xs:simpleType name='empty'>
  1169. <xs:restriction base='xs:string'>
  1170. <xs:enumeration value=''/>
  1171. </xs:restriction>
  1172. </xs:simpleType>
  1173. </xs:schema>
  1174. ]]></code>
  1175. </section1>
  1176. <section1 topic='Acknowledgements' anchor='acknowledgements'>
  1177. <p>The author would like to thank Iain Shigeoka for his work on the first version of this document, and Derek DeMoro and Gaston Dombiak for their comments.</p>
  1178. </section1>
  1179. </xep>