Skip to content

Commit 7e54769

Browse files
authored
Merge pull request #618 from seiyako/master
Streams 2.4.2
2 parents d6dee79 + f571253 commit 7e54769

File tree

9 files changed

+152
-14
lines changed

9 files changed

+152
-14
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
# CHANGELOG.md
22

3+
4+
## 2.4.2
5+
- Fix 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).
6+
7+
## 2.4.1
8+
- 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`.
9+
310
## 2.4.0
411
- Introduce Amazon Connect Step-by-step guides embedding support via `connect.agentApp.initApp`.
512

613
## 2.3.0
7-
- Fix 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).
814
- Make StreamsJS compatible with strict mode
915
- Fix an issue that connect.ValueError and connect.StateError don't print error message properly
1016

Documentation.md

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ In version 1.x, we also support `make` for legacy builds. This option was remove
1515
1. December 2022 - In addition to the CCP, customers can now embed the Step-by-step guides application using the connect.agentApp. See the [updated documentation](https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md#initialization-for-ccp-customer-profiles-and-wisdom) for details on usage.
1616
* ### About Amazon Connect Step-by-step guides
1717
+ With Amazon Connect you can now create guides that walk agents through tailored views that focus on what must be seen or done by the agent at a given moment during an interaction. You can design workflows for various types of customer interactions and present agents with different step-by-step guides based on context, such as call queue, customer information, and interactive voice response (IVR). This feature is available in the Connect agent workspace as well as an embeddable application that can be embedded into another website via the Streams API. For more information, visit the AWS website: https://aws.amazon.com/connect/agent-workspace/
18+
1. December 2022 - 2.4.2
19+
* 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.
1820
1. December 2022 - 2.4.1
1921
* 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`.
2022
1. August 2022 - 2.3.0
21-
* 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, please upgrade to this version.
23+
* [Update on 12/13/2022] Please see 2.4.2 for final resolution of the Voice ID CTR fix.
2224
1. Jan 2022 - 2.0.0
2325
* Multiple calls to `initCCP` will no longer append multiple embedded CCPs to the window, and only the first call to `initCCP` will succeed. Please note that the use-case of initializing multiple CCPs has never been supported by Streams, and this change has been added to prevent unpredictable behavior arising from such cases.
2426
* `agent.onContactPending` has been removed. Please use `contact.onPending` instead. `connect.onError` now triggers. Previously, this api did not work at all. Please be aware that, if you have application logic within this function, its behavior has changed. See its entry in documentation.md for more details.
@@ -1429,7 +1431,12 @@ conn.muteParticipant({
14291431
failure: function(err) { /* ... */ }
14301432
});
14311433
```
1432-
Mute the connection server side.
1434+
Mute the connection server side.
1435+
#### Multiparty call
1436+
Any agent participant can mute another agent participant.
1437+
1438+
#### Supervisor barges into the call
1439+
Agents can mute themselves, but cannot mute other agents or supervisor.
14331440

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

@@ -1440,7 +1447,12 @@ conn.unmuteParticipant({
14401447
failure: function(err) { /* ... */ }
14411448
});
14421449
```
1443-
Unmute the connection server side.
1450+
Unmute the connection server side.
1451+
#### Multiparty call
1452+
Any agent can only unmute themselves.
1453+
1454+
#### Supervisor barges into the call
1455+
Agents can only unmute themselves up until the point they have been muted by the supervisor (isForcedMute API can help checking that). Once they have been muted by the supervisor, agent cannot unmute themselves until supervisor unmutes agent (at which point agent will regain ability to mute and unmute themselves). If supervisor has muted but not unmuted agent then drops from call, agent will be able to unmute themselves once supervisor has dropped.
14441456

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

@@ -1989,3 +2001,113 @@ voiceConnection.deleteVoiceIdSpeaker()
19892001
console.error(err);
19902002
});
19912003
```
2004+
2005+
## Enhanced Monitoring APIs
2006+
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.
2007+
2008+
Streams Enhanced Monitoring APIs can be tested after all these prerequisites are met:
2009+
1. Enable Multi-Party Calls and Enhanced Monitoring in Telephony section of the Amazon Connect Console.
2010+
1. Enable Real-time contact monitoring and Real-time contact barge-in in Security Profiles
2011+
2012+
### `voiceConnection.isSilentMonitor()`
2013+
```js
2014+
if (conn.isSilentMonitor()) { /* ... */ }
2015+
```
2016+
Returns true if monitorStatus is `MonitoringMode.SILENT_MONITOR`. This means the supervisor connection is in silent monitoring state. Regular agent will not see supervisor's connection in the snapshot while it is in silent monitor state.
2017+
2018+
### `voiceConnection.isBarge()`
2019+
```js
2020+
if (conn.isBarge()) { /* ... */ }
2021+
```
2022+
Returns true if monitorStatus is `MonitoringMode.BARGE`. This means the connection is in barge-in state. Regular agent will see the supervisor's connection in the list of connections in the snapshot.
2023+
2024+
### `voiceConnection.isSilentMonitorEnabled()`
2025+
```js
2026+
if (conn.isSilentMonitorEnabled()) { /* ... */ }
2027+
```
2028+
Returns true if agent's monitoringCapabilities contain `MonitoringMode.SILENT_MONITOR` type.
2029+
2030+
### `voiceConnection.isBargeEnabled()`
2031+
```js
2032+
if (conn.isBargeEnabled()) { /* ... */ }
2033+
```
2034+
Returns true if agent's monitoringCapabilities contain `MonitoringMode.BARGE` state type.
2035+
2036+
### `voiceConnection.getMonitorCapabilities()`
2037+
```js
2038+
var allowedMonitorStates = conn.getMonitorCapabilities();
2039+
```
2040+
Returns the array of enabled monitor states of this connection. The array will consist of `MonitoringMode` enum values.
2041+
2042+
### `voiceConnection.getMonitorStatus()`
2043+
```js
2044+
var monitorState = conn.getMonitorStatus();
2045+
```
2046+
Returns the current monitoring state of this connection. The value can be on of `MonitoringMode` enum values if the agent is supervisor, or the monitorStatus will not be present for the agent.
2047+
2048+
### `voiceConnection.isForcedMute()`
2049+
```js
2050+
if (conn.isForcedMute()) { /* ... */ }
2051+
```
2052+
Determine whether the connection was forced muted by the manager.
2053+
2054+
### `contact.updateMonitorParticipantState()`
2055+
```js
2056+
contact.updateMonitorParticipantState(targetState, {
2057+
success: function() { /* ... */ },
2058+
failure: function(err) { /* ... */ }
2059+
});
2060+
```
2061+
Updates the monitor participant state to switch between different monitoring modes. The targetState value is a `MonitoringMode` enum member.
2062+
2063+
### `contact.isUnderSupervision()`
2064+
```js
2065+
if (contact.isUnderSupervision()) { /* ... */ }
2066+
```
2067+
Determines if the contact is under manager's supervision
2068+
2069+
#### Usage examples
2070+
2071+
Check that barge is enabled before switching to the barge mode - first we need to make sure that barge is enabled for the supervisor connection, and after that initiate monitor status change on the contact.
2072+
```js
2073+
if(voiceConnection.isBargeEnabled()) {
2074+
contact.updateMonitorParticipantState(connect.MonitoringMode.BARGE, {
2075+
success: function() {
2076+
console.log("Successfully changed the monitoring status to barge, now you can control the conversation")
2077+
},
2078+
failure: function(err) {
2079+
console.log("Somenting went wrong, here is the error ", err)
2080+
}
2081+
});
2082+
}
2083+
```
2084+
2085+
Check that silent monitor is enabled before switching to the silent monitor mode - first we need to make sure that silent monitor is enabled for the supervisor connection, and after that initiate monitor status change on the contact.
2086+
```js
2087+
if(voiceConnection.isSilentMonitorEnabled()) {
2088+
contact.updateMonitorParticipantState(connect.MonitoringMode.SILENT_MONITOR, {
2089+
success: function() {
2090+
console.log("Successfully changed the monitoring status to silent monitor")
2091+
},
2092+
failure: function(err) {
2093+
console.log("Somenting went wrong, here is the error ", err)
2094+
}
2095+
});
2096+
}
2097+
```
2098+
2099+
After supervisor mutes the agent - force mute field is automatically updated on the agent side. You may want to display a banner or somehow indicate to the agent that he cannot unmute himself back anymore.
2100+
2101+
```js
2102+
if(voiceConnection.isForcedMute()) {
2103+
/* Some logic here to indicate forced mute to the agent */
2104+
}
2105+
```
2106+
2107+
After supervisor barges the call - agent doesn't have control anymore. Agent can only mute or unmute himself until he was forced muted, or leave the call. It will be good to indicate that to ahent as well by hiding or disabling buttons.
2108+
2109+
```js
2110+
if(voiceConnection.isUnderSupervision()) {
2111+
/* Some logic here to indicate disabled call controls to the agent */
2112+
}
2113+
```

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ In version 1.x, we also support `make` for legacy builds. This option was remove
2121
1. December 2022 - In addition to the CCP, customers can now embed the Step-by-step guides application using the connect.agentApp. See the [updated documentation](https://github.com/amazon-connect/amazon-connect-streams/blob/master/Documentation.md#initialization-for-ccp-customer-profiles-and-wisdom) for details on usage.
2222
* ### About Amazon Connect Step-by-step guides
2323
+ With Amazon Connect you can now create guides that walk agents through tailored views that focus on what must be seen or done by the agent at a given moment during an interaction. You can design workflows for various types of customer interactions and present agents with different step-by-step guides based on context, such as call queue, customer information, and interactive voice response (IVR). This feature is available in the Connect agent workspace as well as an embeddable application that can be embedded into another website via the Streams API. For more information, visit the AWS website: https://aws.amazon.com/connect/agent-workspace/
24+
1. December 2022 - 2.4.2
25+
* 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.
26+
1. December 2022 - 2.4.1
27+
* 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`.
2428
1. August 2022 - 2.3.0
25-
* 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, please upgrade to this version.
29+
* [Update on 12/13/2022] Please see 2.4.2 for final resolution of the Voice ID CTR fix.
2630
1. Jan 2022 - 2.0.0
2731
* Multiple calls to `initCCP` will no longer append multiple embedded CCPs to the window, and only the first call to `initCCP` will succeed. Please note that the use-case of initializing multiple CCPs with `initCCP` has never been supported by Streams, and this change has been added to prevent unpredictable behavior arising from such cases.
2832
* `agent.onContactPending` has been removed. Please use `contact.onPending` instead. `connect.onError` now triggers. Previously, this api did not work at all. Please be aware that, if you have application logic within this function, its behavior has changed. See its entry in documentation.md for more details.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amazon-connect-streams",
3-
"version": "2.4.1",
3+
"version": "2.4.2",
44
"description": "Amazon Connect Streams Library",
55
"engines": {
66
"node": ">=12.0.0"

release/connect-streams-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release/connect-streams.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3795,7 +3795,8 @@ module.exports = cloneDeep;
37953795
client.call(connect.AgentAppClientMethods.UPDATE_SESSION, params, {
37963796
success: function (data) {
37973797
connect.getLog().info("updateSpeakerIdInVoiceId succeeded").withObject(data).sendInternalLogToServer();
3798-
self._updateSpeakerIdInLcms(speakerId, data.generatedSpeakerId)
3798+
var generatedSpeakerId = data && data.Session && data.Session.GeneratedSpeakerId;
3799+
self._updateSpeakerIdInLcms(speakerId, generatedSpeakerId)
37993800
.then(function() {
38003801
resolve(data);
38013802
})
@@ -27482,7 +27483,7 @@ AWS.apiLoader.services['connect']['2017-02-15'] = require('../apis/connect-2017-
2748227483

2748327484
connect.core = {};
2748427485
connect.core.initialized = false;
27485-
connect.version = "2.4.1";
27486+
connect.version = "2.4.2";
2748627487
connect.DEFAULT_BATCH_SIZE = 500;
2748727488

2748827489
var CCP_SYN_TIMEOUT = 1000; // 1 sec

src/api.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,8 @@
18461846
client.call(connect.AgentAppClientMethods.UPDATE_SESSION, params, {
18471847
success: function (data) {
18481848
connect.getLog().info("updateSpeakerIdInVoiceId succeeded").withObject(data).sendInternalLogToServer();
1849-
self._updateSpeakerIdInLcms(speakerId, data.generatedSpeakerId)
1849+
var generatedSpeakerId = data && data.Session && data.Session.GeneratedSpeakerId;
1850+
self._updateSpeakerIdInLcms(speakerId, generatedSpeakerId)
18501851
.then(function() {
18511852
resolve(data);
18521853
})

test/unit/voiceid.spec.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,11 @@ describe('VoiceId', () => {
11611161

11621162
describe('updateSpeakerIdInVoiceId', () => {
11631163
it('should get resolved with data', async () => {
1164-
const response = 'fakeData';
1164+
const response = {
1165+
Session: {
1166+
GeneratedSpeakerId: 'dummy-generated-speaker-id'
1167+
}
1168+
};
11651169
sinon.stub(connect.core, 'getClient').callsFake(() => ({
11661170
call: (endpoint, params, callbacks) => {
11671171
callbacks.success(response);
@@ -1175,7 +1179,7 @@ describe('VoiceId', () => {
11751179
expect(obj).to.equal(response);
11761180
sinon.assert.calledOnce(voiceId.checkConferenceCall);
11771181
sinon.assert.calledOnce(voiceId.getDomainId);
1178-
sinon.assert.calledOnce(voiceId._updateSpeakerIdInLcms);
1182+
sinon.assert.calledWith(voiceId._updateSpeakerIdInLcms, speakerId, 'dummy-generated-speaker-id');
11791183
connect.core.getClient.restore();
11801184
});
11811185

0 commit comments

Comments
 (0)