Skip to content

Commit ad33381

Browse files
authored
Merge pull request #683 from tannera926/master
adding echoCancellation and documentation updates
2 parents 1a64c8d + 5bd7968 commit ad33381

24 files changed

+6416
-1716
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ yarn-error.log*
2424
.vscode
2525

2626
.nyc_output
27+
/.tmp

Documentation.md

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In version 1.x, we also support `make` for legacy builds. This option was remove
1818
1. December 2022 - 2.4.2
1919
* This patch fixes an issue in Streams’ Voice ID APIs that may have led to incorrect values being set against the generatedSpeakerID field in the VoiceIdResult segment of Connect Contact Trace Records (CTRs). This occurred in some scenarios where you call either enrollSpeakerInVoiceId(), evaluateSpeakerWithVoiceId(), or updateVoiceIdSpeakerId() in your custom CCP integration code. If you are using Voice ID and consuming Voice ID CTRs, or updating speaker ID in your agent workflow, please upgrade to this version.
2020
1. December 2022 - 2.4.1
21-
* This version brings in updates that will provide enhanced monitoring experience to agents and supervisors, allowing to silently monitor multiparty calls, and if needed to barge in the call and take over control, mute agents, or drop them from the call. New APIs introduced with this feature are `isSilentMonitor`, `isBarge`, `isSilentMonitorEnabled`, `isBargeEnabled`, `isUnderSupervision`, `updateMonitorParticipantState`, `getMonitorCapabilities`, `getMonitorStatus`, `isForcedMute`.
21+
* This version brings in updates that will provide enhanced monitoring experience to agents and supervisors, allowing to silently monitor multiparty calls, and if needed to barge in the call and take over control, mute agents, or drop them from the call. New APIs introduced with this feature are `isSilentMonitor`, `isBarge`, `isSilentMonitorEnabled`, `isBargeEnabled`, `isUnderSupervision`, `updateMonitorParticipantState`, `getMonitorCapabilities`, `getMonitorStatus`, `isForcedMute`. Before enabling Enhanced monitoring capabilities, ensure that you are using the latest version of the Contact Control Panel (CCP) or Agent workspace.
2222
1. August 2022 - 2.3.0
2323
* [Update on 12/13/2022] Please see 2.4.2 for final resolution of the Voice ID CTR fix.
2424
1. Jan 2022 - 2.0.0
@@ -70,7 +70,7 @@ To allowlist your pages:
7070
1. Login to your AWS Account, then navigate to the Amazon Connect console.
7171
2. Choose the instance alias of the instance to allowlist
7272
pages for to load the settings Overview page for your instance.
73-
3. Choose "Application integration" link on the left.
73+
3. In the navigation pane, choose "Approved origins".
7474
4. Choose "+ Add Origin", then enter a domain URL, e.g.
7575
"https<nolink>://example.com", or "https<nolink>://example.com:9595" if your
7676
website is hosted on a non-standard port.
@@ -202,7 +202,8 @@ everything set up correctly and that you are able to listen for events.
202202
softphone: { // optional, defaults below apply if not provided
203203
allowFramedSoftphone: true, // optional, defaults to false
204204
disableRingtone: false, // optional, defaults to false
205-
ringtoneUrl: "./ringtone.mp3" // optional, defaults to CCP’s default ringtone if a falsy value is set
205+
ringtoneUrl: "./ringtone.mp3",// optional, defaults to CCP’s default ringtone if a falsy value is set
206+
disableEchoCancellation: false// optional, defaults to false
206207
},
207208
pageOptions: { //optional
208209
enableAudioDeviceSettings: false, //optional, defaults to 'false'
@@ -242,7 +243,7 @@ and made available to your JS client code.
242243
has completed. If the login page opened in a new tab, this parameter will also auto-close that
243244
tab. This can also be set in `loginOptions` if those options are used.
244245
* `loginUrl`: Optional. Allows custom URL to be used to initiate the ccp, as in
245-
the case of SAML authentication.
246+
the case of SAML authentication. [See more information](#saml-authentication)
246247
* `softphone`: This object is optional and allows you to specify some settings
247248
surrounding the softphone feature of Connect.
248249
* `allowFramedSoftphone`: Normally, the softphone microphone and speaker
@@ -258,7 +259,9 @@ and made available to your JS client code.
258259
* `pageOptions`: This object is optional and allows you to configure which configuration sections are displayed in the settings tab.
259260
* `enableAudioDeviceSettings`: If `true`, the settings tab will display a section for configuring audio input and output devices for the agent's local
260261
machine. If `false`, or if `pageOptions` is not provided, the agent will not be able to change audio device settings from the settings tab. will not be
261-
displayed.
262+
displayed.
263+
* Important Note: If you are using Firefox as your browser, the output audio device list will be empty and CCP will use the computer's default output audio settings.
264+
* To enable output devices for Audio Device Settings, please enable `media.setsinkid.enabled` in Firefox by navigating to `about:config` in Firefox. Then, search for `media.setsinkid.enabled` and toggle it to true.
262265
* `enablePhoneTypeSettings`: If `true`, or if `pageOptions` is not provided, the settings tab will display a section for configuring the agent's phone type
263266
and deskphone number. If `false`, the agent will not be able to change the phone type or deskphone number from the settings tab.
264267
* `shouldAddNamespaceToLogs`: prepends `[CCP]` to all logs logged by the CCP. Important note: there are a few logs made by the CCP before the namespace is prepended.
@@ -478,6 +481,15 @@ Returns a promise that is resolved with the list of media devices from iframe.
478481
Timeout for the request can be passed as an optional argument. The default timeout is 1000ms.
479482
The API should be called after the iframe CCP initialization is complete.
480483

484+
## SAML Authentication
485+
Streams support Security Assertion Markup Language (SAML) 2.0 to enable single sign-on (SSO) which will allow users to sign in through a SAML 2.0 compatible identity provider (IdP) and gain access to the instance without having to provide separate credentials.
486+
### Using SAML with Streams
487+
Going through the basic use case: Customers should be logging in through their IdP by opening a popout window/tab to start the SSO flow. Inside the [`initCCP`](#initialization) function, there are certain optional parameters to take note of which will be useful in setting up SAML. The first will be `loginUrl`, which allows users to link their IdP with Streams. Other optional parameters include `loginPopup`(by default is `true`) and `loginOptions`(only used when `loginPopup` is `true`) which handles the configuration of the popup window for login. When configured correctly, Streams should open up a new window/tab with the login URL provided when authentication is needed, and in the background, a hidden CCP iFrame (built in with streams) will refresh every five seconds until the customer's authentication credentials have been verified. For CCP to load successfully, the SAML federation must be completed successfully along with CCP's initialization execution flow.
488+
### SSO with a hidden iFrame
489+
As mentioned above, Streams is currently built with full support for those who perform the SSO flow in a pop out window/tab. For users who would like to perform SSO in an hidden iframe within the same window, please be aware that the IdP may contain a same-origin-policy which can prevent the interactions between the user's domain and IdP. Users will then have to perform the SSO flow by going through the method mentioned above, or delegating the iframe to SSO.
490+
491+
**Note**: For users who want to remove the SSO hidden iframe, please wait until CCP's initialization and SAML flow execution are executed successfully. From the function `connect.core.onInitialized(callback)`, mentioned above, you can add a callback function after CCP initialization execution is complete, Other functions that may be helpful to help monitor the authentication flow are `connect.core.onAuthFail(callback)`(allows users to subscribe a callback function when authentication fails), and `connect.core.onAuthorizeRetriesExhausted(callback)`(subscribes a callback function when multiple agent authorization api failures have happened)
492+
481493
## Event Subscription
482494
Event subscriptions link your app into the heartbeat of Amazon Connect by allowing your
483495
code to be called when new agent information is available.
@@ -613,6 +625,7 @@ This object contains the following fields:
613625
* `startTimestamp`: A `Date` object that indicates when the state was set.
614626
* `type`: The agent's current availability state type, as per the `AgentStateType` enumeration.
615627

628+
This object may contain a state that was predefined by the system. Please see [`agent.getAvailabilityState()`](#agentgetavailabilitystate) to retrieve the agent's user-defined state.
616629
### `agent.getStateDuration()` / `agent.getStatusDuration()`
617630
```js
618631
var millis = agent.getStateDuration();
@@ -663,6 +676,17 @@ the following fields:
663676
* `type`: The agent state type represented as a `AgentStateType` enum value.
664677
* `name`: The name of the agent state to be displayed in the UI.
665678

679+
### `agent.getAvailabilityState()`
680+
```js
681+
var agentState = agent.getAvailabilityState();
682+
```
683+
Unlike [`agent.getState()`](#agentgetstate--agentgetstatus) which could return a system defined state,
684+
this function will only return the agent's current [user-changeable / definable state](https://docs.aws.amazon.com/connect/latest/adminguide/agent-custom.html).
685+
The object will contain the following fields:
686+
687+
* `state` The name of the agent state.
688+
* `timestamp`: A `Date` object that indicates when the agent was set to that state.
689+
666690
### `agent.getRoutingProfile()`
667691
```js
668692
var routingProfile = agent.getRoutingProfile();
@@ -818,13 +842,21 @@ such as adding to a log file or posting elsewhere.
818842
```js
819843
agent.mute();
820844
```
821-
Sets the agent local media to mute mode.
845+
Sets the agent local media to mute mode. If `Enhanced monitoring & Mutiparty` is enabled, use
846+
`voiceConnection.muteParticipant()` when there are more than 2 agent connections (see example
847+
[here](cheat-sheet.md#mute-agent)), since `voiceConnection.muteParticipant()`
848+
will mute the connection on the server side, and the server side mute value is the only one
849+
accounted for when there are more than 2 connections.
822850
823851
### `agent.unmute()`
824852
```js
825853
agent.unmute();
826854
```
827-
Sets the agent localmedia to unmute mode.
855+
Sets the agent localmedia to unmute mode. If `Enhanced monitoring & Mutiparty` is enabled, use
856+
`voiceConnection.unmuteParticipant()` when there are more than 2 agent connections (see example
857+
[here](cheat-sheet.md#mute-agent)), since `voiceConnection.unmuteParticipant()` will unmute the
858+
connection on the server side, and the server side mute value is the only one accounted for when
859+
there are more than 2 connections.
828860
829861
830862
### `agent.setSpeakerDevice()`
@@ -1784,6 +1816,7 @@ To get latest streams file and allowlist required urls follow [these instruction
17841816
<div id="ccp-container"></div>
17851817
<div id="customerprofiles-container"></div>
17861818
<div id="wisdom-container"></div>
1819+
<div id="cases-container"></div>
17871820
<div id="customviews-container"></div>
17881821
</main>
17891822
<script type="text/javascript">
@@ -1807,7 +1840,12 @@ To get latest streams file and allowlist required urls follow [these instruction
18071840
connectUrl + "/wisdom-v2/",
18081841
{ style: "width:400px; height:600px;" }
18091842
);
1810-
1843+
connect.agentApp.initApp(
1844+
"cases",
1845+
"cases-container",
1846+
connectUrl + "/cases/agent-app/",
1847+
{ style: "width:400px; height:600px;" }
1848+
);
18111849
connect.agentApp.initApp(
18121850
"customviews",
18131851
"customviews-container",
@@ -1841,11 +1879,11 @@ To get latest streams file and allowlist required urls follow [these instruction
18411879
```
18421880
18431881
Integrates with Amazon Connect by loading the pre-built app located at `appUrl` into an iframe and appending it into the DOM element with id of `containerId`. Underneath the hood, `initApp` creates a `WindowIOStream` for the iframes to communicate with the main CCP iframe, which is in charge of authenticating the agent's session, managing the agent state, and contact state.
1844-
* `name`: A string which should be one of `ccp`, `customerprofiles`, or `wisdom`.
1882+
* `name`: A string which should be one of `ccp`, `customerprofiles`, `wisdom`, `cases`, or `customviews`.
18451883
* `containerId`: The string id of the DOM element that will contain the app iframe.
18461884
* `appUrl`: The string URL of the app. This is the page you would normally navigate to in order to use the app in a standalone page, it is different for each instance.
18471885
* `config`: This object is optional and allows you to specify some settings surrounding the CCP.
1848-
* `ccpParams`: Optional params that mirror the configuration options for `initCCP`.
1886+
* `ccpParams`: Optional params that mirror the configuration options for `initCCP`. Only valid when `name` is set to `ccp`. `allowFramedSoftphone` defaults to `true`.
18491887
* `style`: An optional string to supply inline styling for the iframe.
18501888
18511889
## Voice ID APIs
@@ -1859,6 +1897,9 @@ Streams Voice ID APIs can be tested after all these prerequisites are met:
18591897
18601898
The Voice ID APIs are exposed as Voice Connection methods and only work with two-party calls, not with conference calls at this moment. You can get the voice connection object by calling `contact.getAgentConnection()` when there's a voice connection.
18611899
1900+
Notes:
1901+
- For outbound calls and queued callbacks, these Streams Voice ID APIs can be called after contact is connected. For inbound calls, they can be called when contact is connecting.
1902+
18621903
18631904
### `voiceConnection.getVoiceIdSpeakerStatus()`
18641905
Describes the enrollment status of a customer. If the customer exists in the Voice ID, it resolves with a response object that contains one of the valid statuses, ENROLLED or OPTED_OUT. If the customer does not exist in the Voice ID, it still resolves but with an error object because backend API call fails. The case needs to be taken care of in a way like the code sample below.
@@ -2007,7 +2048,7 @@ voiceConnection.updateVoiceIdSpeaker()
20072048
```
20082049
20092050
## Enhanced Monitoring APIs
2010-
Enhanced monitoring providing real-time silent monitoring and barge capability to help managers and supervisors to listen in the agents' conversations and barge into the call if needed to take over the control and provide better customer experience. Supervisors in barge mode will be able to force mute agents and prevent them from unmuting themselves, will be able to hold, drop any connection, or directly speak with the customer. If the supervisor has muted an agent and then drops from the call, the agent will be able to unmute themselves once supervisor has dropped. Monitoring APIs are expected to be used against agent's(or supervisor's) connection. To start enhanced monitoring supervisor/manager will need to click an eye icon on the Real Time Metrics page.
2051+
Enhanced monitoring providing real-time silent monitoring and barge capability to help managers and supervisors to listen in the agents' conversations and barge into the call if needed to take over the control and provide better customer experience. Supervisors in barge mode will be able to force mute agents and prevent them from unmuting themselves, will be able to hold, drop any connection, or directly speak with the customer. If the supervisor has muted an agent and then drops from the call, the agent will be able to unmute themselves once supervisor has dropped. Monitoring APIs are expected to be used against agent's(or supervisor's) connection. To start enhanced monitoring supervisor/manager will need to click an eye icon on the Real Time Metrics page. Before enabling Enhanced monitoring capabilities, ensure that you are using the latest version of the Contact Control Panel (CCP) or Agent workspace.
20112052
20122053
Streams Enhanced Monitoring APIs can be tested after all these prerequisites are met:
20132054
1. Enable Multi-Party Calls and Enhanced Monitoring in Telephony section of the Amazon Connect Console.

0 commit comments

Comments
 (0)