Skip to content

Commit

Permalink
Add Contact.clear(), Agent.getAvailabilityState(), and updated docs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ctwomblyamzn authored Aug 3, 2020
1 parent f9242a0 commit e596197
Show file tree
Hide file tree
Showing 11 changed files with 500 additions and 288 deletions.
26 changes: 23 additions & 3 deletions Documentation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Amazon Connect Streams Documentation
(c) 2018-2020 Amazon.com, Inc. All rights reserved.

# Important Announcements
1. July 2020 -- We recently changed the new, omnichannel, CCP's behavior when it encounters three voice-only agent states: `FailedConnectAgent`, `FailedConnectCustomer`, and `AfterCallWork`.
* `FailedConnectAgent` -- Previously, we required the agent to click the "Clear Contact" button to clear this state. When the agent clicked the "Clear Contact" button, the previous behavior took the agent back to the `Available` state without fail. Now the `FailedConnectAgent` state will be "auto-cleared", much like `FailedConnectCustomer` always has been.
* `FailedConnectAgent` and `FailedConnectCustomer` -- We are now using the `contact.clear()` API to auto-clear these states. As a result, the agent will be returned to their previous visible agent state (e.g. `Available`). Previously, the agent had always been set to `Available` as a result of this "auto-clearing" behavior. Note that even custom CCPs will behave differently with this update for `FailedConnectAgent` and `FailedConnectCustomer`.
* `AfterCallWork` -- As part of the new `contact.clear()` behavior, clicking "Clear Contact" while in `AfterCallWork` will return the agent to their previous visible agent state (e.g. `Available`, etc.). Note that custom CCPs that implement their own After Call Work behavior will not be affected by this change.
* We are putting `contact.complete()` on a deprecation path. Therefore, you should start using `contact.clear()` in its place. If you want to emulate CCP's After Call Work behavior in your customer CCP, then make sure you use `contact.clear()` when clearing voice contacts.

## Overview
The Amazon Connect Streams API (Streams) gives you the power to integrate your
existing web applications with Amazon Connect. Streams lets you
Expand Down Expand Up @@ -834,15 +841,28 @@ be disconnected from the call. Otherwise, the agent and customer are disconnecte

Optional success and failure callbacks can be provided to determine if the operation was successful.

### `contact.complete()`
### `contact.clear()`
```js
contact.clear({
success: function() { /* ... */ },
failure: function(err) { /* ... */ }
});
```
This is a more generic form of `contact.complete()`. Use this for voice and chat contacts to clear the contact
when the contact is no longer actively being worked on (i.e. it's one of ERROR, ACW, MISSED, REJECTED).
It works for both monitoring and non-monitoring connections.

Optional success and failure callbacks can be provided to determine if the operation was successful.

### `contact.complete()` (TO BE DEPRECATED)
```js
contact.complete({
success: function() { /* ... */ },
failure: function(err) { /* ... */ }
});
```
This is an API that completes this contact entirely. That means that this should only be
used for non-monitoring agent connections.
This API will soon be deprecated and should be replaced with `contact.clear()`. It completes the contact entirely.
That means it should only be used for non-monitoring agent connections.

Optional success and failure callbacks can be provided to determine if the operation was successful.

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ into your application or host it in an Amazon S3 bucket behind Amazon Cloudfront
$ make
```

# Important Announcements
1. July 2020 -- We recently changed the new, omnichannel, CCP's behavior when it encounters three voice-only agent states: `FailedConnectAgent`, `FailedConnectCustomer`, and `AfterCallWork`.
* `FailedConnectAgent` -- Previously, we required the agent to click the "Clear Contact" button to clear this state. When the agent clicked the "Clear Contact" button, the previous behavior took the agent back to the `Available` state without fail. Now the `FailedConnectAgent` state will be "auto-cleared", much like `FailedConnectCustomer` always has been.
* `FailedConnectAgent` and `FailedConnectCustomer` -- We are now using the `contact.clear()` API to auto-clear these states. As a result, the agent will be returned to their previous visible agent state (e.g. `Available`). Previously, the agent had always been set to `Available` as a result of this "auto-clearing" behavior. Note that even custom CCPs will behave differently with this update for `FailedConnectAgent` and `FailedConnectCustomer`.
* `AfterCallWork` -- As part of the new `contact.clear()` behavior, clicking "Clear Contact" while in `AfterCallWork` will return the agent to their previous visible agent state (e.g. `Available`, etc.). Note that custom CCPs that implement their own After Call Work behavior will not be affected by this change.
* We are putting `contact.complete()` on a deprecation path. Therefore, you should start using `contact.clear()` in its place. If you want to emulate CCP's After Call Work behavior in your customer CCP, then make sure you use `contact.clear()` when clearing voice contacts.

## Getting Started

### Upgrading to the OmniChannel CCP (AKA CCPv2)?
Expand Down
98 changes: 60 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amazon-connect-streams",
"version": "1.4.9",
"version": "1.5.0",
"description": "Amazon Connect Streams Library",
"engines": {
"node": ">=12.0.0"
Expand Down Expand Up @@ -54,8 +54,5 @@
"pump": "^3.0.0",
"sinon": "^9.0.0",
"typescript": "3.0.1"
},
"npm-pretty-much": {
"runRelease": "always"
}
}
2 changes: 1 addition & 1 deletion release/connect-streams-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit e596197

Please sign in to comment.