Skip to content

Commit

Permalink
Merge branch 'develop' v0.8.12
Browse files Browse the repository at this point in the history
  • Loading branch information
rstrahan committed May 21, 2024
2 parents 8431490 + 44d2f8d commit f4aa71d
Show file tree
Hide file tree
Showing 30 changed files with 884 additions and 727 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.8.12] - 2024-05-20
### Fixed
- Expanded redaction support to include all languages (and dialects) on the Amazon Transcribe supported languages page.
- Call Transcriber Lambda
- Refactor call end handling, to explicitly process ENDED messages from VoiceConnector, rather than imputing call end from stream data ending - adds robustness when stream can end (temporarily) for other reasons (such as call hold, etc.)
- Identified a situation where if a call chained across multiple lambda invocations (lasted longer than 12 minutes), the new timer we introduced that checks if the call ends would leak into the next lambda invocation. This would have no effect for a single long running call other than duplicate checks to DynamoDB—however—if the call ends and a NEW call uses that warm Lambda, the new call would inherit the timers and within 5 seconds mark the call as ended. To fix this, we made modifications by adding proper clean-up of timers when the call ends, and also double checking when the next call begins that the new Lambda did not inherit any calls.
- Added the callId to the log output, so that it is easier to trace calls.
- Added the request id of the next Lambda invocation in the output of the log, so that it makes it easier to trace sequential lambda invocations (chaining).

- Websocket server and Stream Audio client
- Fix state management in Websocket server - add connection specific state variables to a global dictionary to maintain state for active connections
- Fix reconnection logic in Stream Audio websocket client - i.e. retrofit the fix from LMA.
- Clean up and streamline log formats in Websocket Server and Stream Audio client
- Reduce the amount of logs due to health checks. Health check is done every 10 seconds, logging status for each health check which creates huge amounts of log records in cloudwatch. To fix this - Log first health check message from each new source and then log every 2 minutes (interval controlled by a new environment variable which is not exposed in cloudformation, but can be directly updated in the ECS configuration by developers).
- Fix authentication code in Websocket client utility (utilites/webosocket-client)

## [0.8.11] - 2024-02-21
### Fixed
- Added custom resource in the lca-websocket-stack that sets the ECS cluster's desired service count to zero, then deletes the service, before deleting the cluster. This will prevent errors in deleting the stack when disabling websockets or deleting LCA.
Expand Down Expand Up @@ -356,7 +372,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Initial release

[Unreleased]: https://github.com/aws-samples/amazon-transcribe-live-call-analytics/compare/v0.8.11...develop
[Unreleased]: https://github.com/aws-samples/amazon-transcribe-live-meeting-assistant/compare/main...develop
[0.8.12]: https://github.com/aws-samples/amazon-transcribe-live-call-analytics/compare/v0.8.11...v0.8.12
[0.8.11]: https://github.com/aws-samples/amazon-transcribe-live-call-analytics/compare/v0.8.10...v0.8.11
[0.8.10]: https://github.com/aws-samples/amazon-transcribe-live-call-analytics/compare/v0.8.9...v0.8.10
[0.8.9]: https://github.com/aws-samples/amazon-transcribe-live-call-analytics/compare/v0.8.8...v0.8.9
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ To get LCA up and running in your own AWS account, follow these steps (if you do
**Amazon Transcribe Configuration**
22. `Enable Partial Transcripts` - Enable partial transcripts to receive low latency evolving transcriptions for each conversation turn.
23. `Transcribe API mode` - Set the default API mode for Transcribe. Set to 'analytics' to use the Amazon Transcribe Real-time Call Analytics service, used to support call categories and alerts, call summarization, and PCA integration.
24. `Enable Content Redaction for Transcripts` - Enable content redaction from Amazon Transcribe transcription output. **NOTE:** Content redaction is only available when using the English language (en-US). This parameter is ignored when not using the English language
24. `Enable Content Redaction for Transcripts` - Enable content redaction from Amazon Transcribe transcription output. **NOTE:** Content redaction is only available when using English (en-US, en-GB, en-AU) or Spanish (es-US). This parameter is ignored when not using other languages.
25. `Language for Transcription` - Language code to be used for Amazon Transcribe
26. `Content Redaction Type for Transcription` - Type of content redaction from Amazon Transcribe transcription output
27. `Transcription PII Redaction Entity Types` - Select the PII entity types you want to identify or redact. Remove the values that you don't want to redact from the default. _DO NOT ADD CUSTOM VALUES HERE_.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.11
0.8.12
2 changes: 1 addition & 1 deletion lca-ai-stack/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.11
0.8.12
2 changes: 1 addition & 1 deletion lca-ai-stack/deployment/lca-ai-stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ Parameters:
BootstrapVersion:
Type: String
Default: 0.8.1111
Default: 0.8.12
Description: >
Artifacts version (semver). Used to point to a specific release in the S3
bootstrap bucket
Expand Down
8 changes: 4 additions & 4 deletions lca-ai-stack/samconfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ use_container = true
# shared account
[shared.global.parameters]
s3_bucket = "lca-artifacts-253873381732-us-east-1"
s3_prefix = "artifacts/lca/0.8.1110"
s3_prefix = "artifacts/lca/0.8.12"

[shared.deploy.parameters]
stack_name = "LiveCallAnalytics"
s3_bucket = "lca-artifacts-253873381732-us-east-1"
s3_prefix = "artifacts/lca/0.8.1110"
s3_prefix = "artifacts/lca/0.8.12"
region = "us-east-1"
fail_on_empty_changeset = false
confirm_changeset = true
capabilities = "CAPABILITY_IAM CAPABILITY_AUTO_EXPAND"
parameter_overrides = [
"BootstrapBucketBaseName=lca-artifacts-253873381732",
"BootstrapS3Prefix=artifacts/lca",
"BootstrapVersion=0.8.1110",
"BootstrapVersion=0.8.12",
"S3BucketName=shared-ai-for-chime-vc-audio",
"IsContentRedactionEnabled=true",
"IsSentimentAnalysisEnabled=true",
Expand All @@ -32,4 +32,4 @@ parameter_overrides = [

[shared.package.parameters]
s3_bucket = "lca-artifacts-253873381732-us-east-1"
s3_prefix = "artifacts/lca/0.8.1110"
s3_prefix = "artifacts/lca/0.8.12"
6 changes: 3 additions & 3 deletions lca-ai-stack/source/ui/package-lock.json

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

4 changes: 2 additions & 2 deletions lca-ai-stack/source/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lca-ui",
"version": "0.8.1111",
"version": "0.8.12",
"private": true,
"dependencies": {
"@aws-amplify/ui-components": "^1.9.6",
Expand Down Expand Up @@ -77,4 +77,4 @@
"<roodDir>/node_modules/(?!@awsui)"
]
}
}
}
49 changes: 41 additions & 8 deletions lca-ai-stack/source/ui/src/components/stream-audio/StreamAudio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ const StreamAudio = () => {
const [micInputOption, setMicInputOption] = useState({ label: 'AGENT', value: 'agent' });

const getSocketUrl = useCallback(() => {
console.log('Trying to resolve websocket url...');
console.log(`DEBUG - [${new Date().toISOString()}]: Trying to resolve websocket url...`);
return new Promise((resolve) => {
if (settings.WSEndpoint) {
console.log(`Resolved Websocket URL to ${settings.WSEndpoint}`);
console.log(`
DEBUG - [${new Date().toISOString()}]: Resolved Websocket URL to ${settings.WSEndpoint}
`);
resolve(settings.WSEndpoint);
}
});
Expand All @@ -50,14 +52,21 @@ const StreamAudio = () => {
authorization: `Bearer ${JWT_TOKEN}`,
},
onOpen: (event) => {
console.log(event);
console.log(`
DEBUG - [${new Date().toISOString()}]: Websocket onOpen Event: ${JSON.stringify(event)}
`);
},
onClose: (event) => {
console.log(event);
console.log(`
DEBUG - [${new Date().toISOString()}]: Websocket onClose Event: ${JSON.stringify(event)}
`);
},
onError: (event) => {
console.log(event);
console.log(`
DEBUG - [${new Date().toISOString()}]: Websocket onError Event: ${JSON.stringify(event)}
`);
},
shouldReconnect: () => true,
});

const handleCallIdChange = (e) => {
Expand Down Expand Up @@ -110,6 +119,8 @@ const StreamAudio = () => {
};

const stopRecording = async () => {
console.log(`DEBUG - [${new Date().toISOString()}]: Stopping recording...`);

if (audioProcessor.current) {
audioProcessor.current.port.postMessage({
message: 'UPDATE_RECORDING_STATE',
Expand All @@ -130,11 +141,17 @@ const StreamAudio = () => {
console.log('AudioContext closed.');
});
} else {
console.log('no media recorder available to stop');
console.log(`
DEBUG - [${new Date().toISOString()}]: Error trying to stop recording. AudioWorklet Processor node is not active.
`);
setRecording(false);
}
if (streamingStarted && !recording) {
callMetaData.callEvent = 'END';
// eslint-disable-next-line prettier/prettier
console.log(`
DEBUG - [${new Date().toISOString()}]: Send Call END msg: ${JSON.stringify(callMetaData)}
`);
sendMessage(JSON.stringify(callMetaData));
setStreamingStarted(false);
setCallMetaData({
Expand All @@ -145,6 +162,10 @@ const StreamAudio = () => {
};

const startRecording = async () => {
console.log(`
DEBUG - [${new Date().toISOString()}]: Start Recording and Streaming Audio to Websocket server.
`);

try {
audioContext.current = new window.AudioContext();
displayStream.current = await window.navigator.mediaDevices.getDisplayMedia({
Expand All @@ -162,6 +183,10 @@ const StreamAudio = () => {
callMetaData.samplingRate = SOURCE_SAMPLING_RATE;

callMetaData.callEvent = 'START';
// eslint-disable-next-line prettier/prettier
console.log(`
DEBUG - [${new Date().toISOString()}]: Send Call START msg: ${JSON.stringify(callMetaData)}
`);
sendMessage(JSON.stringify(callMetaData));
setStreamingStarted(true);

Expand All @@ -177,15 +202,23 @@ const StreamAudio = () => {
monoMicSource.connect(channelMerger.current, 0, 0);
monoDisplaySource.connect(channelMerger.current, 0, 1);

console.log(`
DEBUG - [${new Date().toISOString()}]: Registering and adding AudioWorklet processor to capture audio
`);

try {
await audioContext.current.audioWorklet.addModule('./worklets/recording-processor.js');
} catch (error) {
console.log(`Add module error ${error}`);
console.log(`
DEBUG - [${new Date().toISOString()}]: Error registering AudioWorklet processor: ${error}
`);
}

audioProcessor.current = new AudioWorkletNode(audioContext.current, 'recording-processor');
audioProcessor.current.port.onmessageerror = (error) => {
console.log(`Error receving message from worklet ${error}`);
console.log(`
DEBUG - [${new Date().toISOString()}]: Error receving message from worklet ${error}
`);
};
audioProcessor.current.port.onmessage = (event) => {
// this is pcm audio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Parameters:
Default: 'false'
Description: >-
Enable content redaction from Amazon Transcribe transcription output. This is only used when
the 'en-US' language is selected in the TranscribeLanguageCode parameter.
the 'en-US', 'en-AU', 'en-GB' or 'es-US' languages are selected in the TranscribeLanguageCode parameter.
AllowedValues:
- 'true'
- 'false'
Expand Down Expand Up @@ -954,7 +954,11 @@ Metadata:
Conditions:
ShouldEnableContentRedaction: !And
- !Equals [!Ref IsContentRedactionEnabled, 'true']
- !Equals [!Ref TranscribeLanguageCode, 'en-US']
- !Or
- !Equals [!Ref TranscribeLanguageCode, 'en-US']
- !Equals [!Ref TranscribeLanguageCode, 'en-AU']
- !Equals [!Ref TranscribeLanguageCode, 'en-GB']
- !Equals [!Ref TranscribeLanguageCode, 'es-US']
ShouldEnableLambdaHook: !Not [!Equals [!Ref SiprecLambdaHookFunctionArn, '']]
ShouldUseCreatedVoiceConnector: !Equals [!Ref CustomVoiceConnectorId, '']

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Parameters:
Default: 'false'
Description: >-
Enable content redaction from Amazon Transcribe transcription output. This is only used when
the 'en-US' language is selected in the TranscribeLanguageCode parameter.
the 'en-US', 'en-AU', 'en-GB' or 'es-US' languages are selected in the TranscribeLanguageCode parameter.
AllowedValues:
- 'true'
- 'false'
Expand Down Expand Up @@ -437,7 +437,11 @@ Metadata:
Conditions:
ShouldEnableContentRedaction: !And
- !Equals [!Ref IsContentRedactionEnabled, 'true']
- !Equals [!Ref TranscribeLanguageCode, 'en-US']
- !Or
- !Equals [!Ref TranscribeLanguageCode, 'en-US']
- !Equals [!Ref TranscribeLanguageCode, 'en-AU']
- !Equals [!Ref TranscribeLanguageCode, 'en-GB']
- !Equals [!Ref TranscribeLanguageCode, 'es-US']
ShouldEnableLambdaHook: !Not [!Equals [!Ref SiprecLambdaHookFunctionArn, '']]

Outputs:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f4aa71d

Please sign in to comment.