Contents
Chat Delayed
Overview
This Callback scenario is a chat service that goes through the following stages:
Start Callback
- Callback service: Returns session id to the user.
- Callback service: Waits for an agent to be available.
- Callback service: When an agent is available, notifies mobile device that agent is available.
- Next: Mobile device is expected to send connect request to confirm user's availability.
Connect
- Callback service: Returns URL to initiate chat interaction, immediately to the mobile device.
- Callback service: Waits for chat interaction to arrive.
- Next: Mobile device is expected to initiate chat interaction.
Initiate Chat
- Inbound Chat service: Locates the GMS service associated with the arrived chat interaction.
- Inbound Chat service: Delegates the chat interaction to be processed by the Callback service.
- Callback service: Reserves target to route chat interaction.
- Callback service: Routes the chat interaction to the target.
- Callback service terminates.
Configuration Options
The table below lists the key options applicable to this scenario.
Use the GMS Service Management UI to set the configuration options. On the Services > Configured Services tab, add a Callback service with Chat-Delayed as the Common Default Configuration (see Adding a Service). When you add this service and default configuration, many options are automatically populated with the appropriate default values. Some options, however, will require you to enter your own values. See the Comments column in the following table for these details.
Category | Option | Value | Comment |
---|---|---|---|
General | _media_type | chat | These are the default values, which are automatically populated when using the pre-defined Chat-Delayed service. You must not change these values. |
_wait_for_agent | true | ||
_wait_for_user_confirm | true | ||
URS Queuing | _target | <string> | You must enter a string value for this option. This option is the routing target that specifies the agent/queue resource that should process this request. Format the string according to the URS target specification. For example:
See the Universal Routing Server (URS) documentation for additional information about URS targets. |
_urs_server_url | http://<urs primary hostname:port> | You must enter the URL for your primary Universal Routing Server (URS). | |
_urs_virtual_queue | <virtual queue to be used by strategy> | You must enter the virtual queue to which the service request will be added. | |
_urs_prioritization_strategy | WaitForTarget | The default value shown here matches the name of the URS strategy that you imported into IRD. If you changed the name of the strategy, update this value to reflect the correct name. | |
_urs_strategy_update_sub_routine | SetRouteDelay | The default value shown here matches the name of the URS subroutine that you imported into IRD. If you changed the name of the subroutine, update this value to reflect the correct name. |
Sample Request and Response Sequence
Create chat (delay) service
Request URL:http://localhost:8080/genesys/1/service/callback/chat-delay Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:660 Content-Type:multipart/form-data; boundary=----WebKitFormBoundary0WnE36LruxJ4S5nu Cookie:JSESSIONID=mjjvtphwb8lpce7io23ggxcu; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundary0WnE36LruxJ4S5nu Content-Disposition: form-data; name="_customer_number" 4082652649 ------WebKitFormBoundary0WnE36LruxJ4S5nu Content-Disposition: form-data; name="usr_customer_name" Bob Markel ------WebKitFormBoundary0WnE36LruxJ4S5nu Content-Disposition: form-data; name="usr_reason" billing question ------WebKitFormBoundary0WnE36LruxJ4S5nu Content-Disposition: form-data; name="_device_notification_id" b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 ------WebKitFormBoundary0WnE36LruxJ4S5nu Content-Disposition: form-data; name="_device_os" comet ------WebKitFormBoundary0WnE36LruxJ4S5nu-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:07:35 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=kwe77jz60uum1u16urvv8vubd;Path=/genesys Transfer-Encoding:chunked Response Body: { "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9", "_text": "We will notify you when agent is available" } Push Notification Data: { "id": "01afcd60258a11e300006072543ed1ff", "message": { "_action": "get-dialog-user-confirmation-provide_code-false", "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9" }, "tag": "service.agentavailable.369-166652d2-aed6-443c-9781-6bdff370f9a9" }
Connect (user confirmation)
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/connect Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:44 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryNY84ld7wm7oHB9fp Cookie:JSESSIONID=1b81btxjbrb1wybz5a93i24io; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundaryNY84ld7wm7oHB9fp-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:26 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:04:35 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=mjjvtphwb8lpce7io23ggxcu;Path=/genesys Response Body: { "_dialog_id": "1", "_action": "StartChat", "_label": "Start Chat", "_start_chat_url": "http://localhost:8080/genesys/1/service/369-8cea2901-1eba-4f5a-8c76-edf83dd26480/ixn/chat", "_comet_url": "http://localhost:8080/genesys/cometd", "_user_header": "b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673", "_id_to_jump_before": "exit://", "_chat_parameters": { "subject": "None" }, "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9" }
Check estimated wait time (EWT) and position in the URS queue (check-queue-position)
Mobile is expected to use this API to poll for current ewt and position.
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/check-queue-position Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:44 Content-Type:multipart/form-data; boundary=----WebKitFormBoundary2gBrAJX9qPSafKwk Cookie:JSESSIONID=61voqouznyas1vrp9fjljmbwr; BAYEUX_BROWSER=f3d8-3vwgdclvyroghjsaf87i1c60 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundary2gBrAJX9qPSafKwk-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:123 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Fri, 02 Aug 2013 23:07:59 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=1co1o30bhrm6719u8lfv9kvpei;Path=/genesys Response Body (when eta is NOT provided by URS): { "_position": 2, "_eta": "n/a", "_total_waiting": 2, "_agent_ready_threshold_passed": true, "_agent_ready_threshold_passed_reason": "eta n/a" } Response Body 2 (when eta is provided by URS): { "_position": 2, "_eta": 30, "_total_waiting": 2, "_agent_ready_threshold_passed": true, "_agent_ready_threshold_passed_reason": "eta <= 35 and position <=5 " }
Create Chat Interaction
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/ixn/chat Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:651 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryteXJ8ZpAGGDTAMFN Cookie:JSESSIONID=kwe77jz60uum1u16urvv8vubd; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="notify_by" comet ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="firstName" John ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="lastName" Harry ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="_verbose" false ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="subject" testing ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN Content-Disposition: form-data; name="email" j.h@gmail.com ------WebKitFormBoundaryteXJ8ZpAGGDTAMFN-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:77 Content-Type:application/json;charset=UTF-8 Content-Type:text/plain;charset=ISO-8859-1 Date:Tue, 30 Jul 2013 07:08:53 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Response Body: { "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9", "comet_channel": "/_genesys" }
Send notification from agent desktop to mobile (internal-notification, previously poke)
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/internal-notification Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:320 Content-Type:multipart/form-data; boundary=----WebKitFormBoundary8rbhQqxP5LoJ61i1 Cookie:JSESSIONID=kwe77jz60uum1u16urvv8vubd; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundary8rbhQqxP5LoJ61i1 Content-Disposition: form-data; name="_display_message" Message to be displayed to user ------WebKitFormBoundary8rbhQqxP5LoJ61i1 Content-Disposition: form-data; name="_application_message" MESSAGE_FOR_MOBILE_APP_INTERNAL_USE ------WebKitFormBoundary8rbhQqxP5LoJ61i1-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:17 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:10:11 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=z1lrha8utmxw1xslu08z473ty;Path=/genesys Response Body: { "message": "Notification Sent" }
Retrieve any notifications from agent, when notifications are not enabled (retrieve-notifications)
This is necessary only in case of a poll scenario.
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/retrieve-notifications Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:44 Content-Type:multipart/form-data; boundary=----WebKitFormBoundary3I4BzfVbhmlJvPRC Cookie:JSESSIONID=z1lrha8utmxw1xslu08z473ty; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundary3I4BzfVbhmlJvPRC-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:2 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:10:58 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=18gvvxkjquop1x8er65g7ferp;Path=/genesys Response Body (with push enabled): Note: Since cometd push was enabled the message was already sent to the device. If push was not configured then the response body would have contained the message (below) Push: { "_internal_message": "MESSAGE_FOR_MOBILE_APP_INTERNAL_USE", "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9", "_display_message": "Message to be displayed to user" } Response Body (with push not configured): [{ "_internal_message": "MESSAGE_FOR_MOBILE_APP_INTERNAL_USE", "_id": "369-166652d2-aed6-443c-9781-6bdff370f9a9", "_display_message": "Message to be displayed to user" }]
Send notification from mobile to agent
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/agent-notification Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:324 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryyN11ULST36Tmhzro Cookie:JSESSIONID=18gvvxkjquop1x8er65g7ferp; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundaryyN11ULST36Tmhzro Content-Disposition: form-data; name="_display_message" Message to be displayed to agent ------WebKitFormBoundaryyN11ULST36Tmhzro Content-Disposition: form-data; name="_application_message" MESSAGE_FOR_AGENT_DESKTOP_INTERNAL_USE ------WebKitFormBoundaryyN11ULST36Tmhzro-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:17 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:15:04 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=1cfd36s0cn6213lqge05h7y6l;Path=/genesys Response Body: { "message": "Notification Sent" }
Retrieve notifications from Mobile to Agent (retrieve-agent-notifications)
Agent desktop is expected to poll for messages since push notifications via cometd to agent desktop are not supported.
Request URL:http://localhost:8080/genesys/1/service/369-166652d2-aed6-443c-9781-6bdff370f9a9/retrieve-agent-notifications Request Method:POST Status Code:200 OK Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8 Connection:keep-alive Content-Length:44 Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryIimjtpB6hZzFZRQ3 Cookie:JSESSIONID=1cfd36s0cn6213lqge05h7y6l; BAYEUX_BROWSER=86721orubxagcqhw0hj14cpyaqk2 gms_user:b16416334828b1d26ef14f329628b55b5a8c631d8928a371a5584722dd7fb673 Host:localhost:8080 Origin:http://localhost:8080 Referer:http://localhost:8080/gmstester/chat.html User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36 Request Payload ------WebKitFormBoundaryIimjtpB6hZzFZRQ3-- Response Headersview source Cache-Control:no-cache Cache-Control:no-store Content-Length:242 Content-Type:application/json;charset=UTF-8 Content-Type:application/json;charset=UTF-8 Date:Tue, 30 Jul 2013 07:16:17 GMT Expires:Thu, 01 Jan 1970 00:00:00 GMT Pragma:no-cache Server:Jetty(7.6.0.v20120127) Set-Cookie:JSESSIONID=1x5o3d8bkgczy1pxjb3dac0mmp;Path=/genesys Response Body: [ { "message": "{\"_id\":\"369-166652d2-aed6-443c-9781-6bdff370f9a9\", \"_internal_message\":\"MESSAGE_FOR_AGENT_DESKTOP_INTERNAL_USE\", \"_display_message\":\"Message to be displayed to agent\"}", "tag": "agent.message.369-166652d2-aed6-443c-9781-6bdff370f9a9" } ]
Sequence Diagram
Click on the diagram to access full resolution.