Serverless architecture for optimizing Amazon Connect call-recording archival costs

海外精选
海外精选的内容汇集了全球优质的亚马逊云科技相关技术内容。同时,内容中提到的“AWS” 是 “Amazon Web Services” 的缩写,在此网站不作为商标展示。
0
0
{"value":"In this post, we provide a serverless solution to cost-optimize the storage of contact-center call recordings. The solution automates the scheduling, storage-tiering, and resampling of call-recording files, resulting in immediate cost savings. The solution is an asynchronous architecture built using [AWS Step Functions](https://aws.amazon.com/step-functions/), [Amazon Simple Queue Service (Amazon SQS)](https://aws.amazon.com/sqs/), and [AWS Lambda](http://aws.amazon.com/lambda).\n\n[Amazon Connect](https://aws.amazon.com/connect/) provides an omnichannel cloud contact center with the ability to maintain call recordings for compliance and gaining actionable insights using [Contact Lens for Amazon Connect](https://aws.amazon.com/connect/contact-lens/) and [AWS Contact Center Intelligence Partners](https://aws.amazon.com/machine-learning/ml-use-cases/contact-center-intelligence/partners/). The storage required for call recordings can quickly increase as customers meet compliance retention requirements, often spanning six or more years. This can lead to hundreds of terabytes in long-term storage.\n\n\n#### **Solution overview**\n\n\nWhen an agent completes a customer call, Amazon Connect sends the call recording to an [Amazon Simple Storage Solution (Amazon S3)](https://aws.amazon.com/s3/) bucket with: a date and contact ID prefix, the file stored in the .WAV format and encoded using bitrate 256 kb/s, pcm_s16le, 8000 Hz, two channels, and 256 kb/s. The call-recording files are approximately 2 Mb/minute optimized for high-quality processing, such as machine learning analysis (see Figure 1).\n\n![image.png](https://dev-media.amazoncloud.cn/d6ed84fb06a449c8a37ed661cd389308_image.png)\n\nFigure 1. Asynchronous architecture for batch resampling for call-recording files on Amazon S3\n\nWhen a call recording is sent to Amazon S3, downstream post-processing is often performed to generate analytics reports for agents and quality auditors. The downstream processing can include services that provide transcriptions, quality-of-service metrics, and sentiment analysis to create reports and trigger actionable events.\n\nWhile this processing is often completed within minutes, the downstream applications could require processing retries. As audio resampling reduces the quality of the audio files, it is essential to delay resampling until after processing is completed. As processed call recordings are infrequently accessed days after a call is completed, with only a small percentage accessed by agents and call quality auditors, call recordings can benefit from resampling and transitioning to long-term Amazon S3 storage tiers.\n\nIn Figure 2, multiple AWS services work together to provide an end-to-end cost-optimization solution for your contact center call recordings.\n\n![image.png](https://dev-media.amazoncloud.cn/0e175019491e4ad7b8538001a2118313_image.png)\n\nFigure 2. AWS Step Function orchestrates the batch resampling of call recordings\n\nAn [Amazon EventBridge](https://aws.amazon.com/eventbridge/?nc2=h_ql_prod_ap_eb) schedule rule triggers the step function to perform the batch resampling process for all call recordings from the previous 7 days.\n\nIn the first step function task, the Lambda function task iterates the S3 bucket using the [ListObjectsV2](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) API, obtaining the call recordings (1000 objects per iteration) with the date prefix from 7 days ago.\n\nThe next task invokes a Lambda function inserting the call recording objects into the Amazon SQS queue. The audio-conversion Lambda function receives the Amazon SQS queue events via the [event source mappinghttps://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html]() Lambda integration. Each concurrent Lambda invocation downloads a stored call recording from Amazon S3, resampling the .WAV with [ffmpeg](https://www.ffmpeg.org/) and tagging the S3 object with a “converted=True” tag.\n\nFinally, the conversion function uploads the resampled file to Amazon S3, overwriting the original call recording with the resampled recording using a cost-optimized storage class, such as [S3 Glacier Instant Retrieval](https://aws.amazon.com/s3/storage-classes/). S3 Glacier Instant Retrieval provides the lowest cost for long-lived data that is rarely accessed and requires milliseconds retrieval, such as for contact-center call-recording playback. By default, Amazon Connect stores call recordings with [S3 Versioning](https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html) enabled, maintaining the original file as a version. You can use lifecycle policies to [delete object versions](https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html) from a version-enabled bucket to permanently remove the original version, as this will minimize the storage of the original call recording.\n\nThis solution captures failures within the step function workflow with logging and a dead-letter queue, such as when an error occurs with resampling a recording file. A Step Function task monitors the Amazon SQS queue using the [AWS Step Function integration with AWS SDK](https://docs.aws.amazon.com/step-functions/latest/dg/supported-services-awssdk.html) with SQS and ending the workflow when the queue is emptied. Table 1 demonstrates the default and resampled formats.\n\n![image.png](https://dev-media.amazoncloud.cn/af0a00d5890e46f687579bcfd7eea8df_image.png)\n\nFigure 3. Detailed AWS Step Functions state machine diagram\n\n\n#### **Resampling**\n\n\n**Table 1. Default and resampled call recording audio formats**\n\n![table.png](https://dev-media.amazoncloud.cn/d0c25beb79ae4c2597a60eed2449302b_table.png)\n\n\n#### **Cost assessment**\n\n\nFor pricing information for the primary services used in the solution, visit:\n\n- [Amazon S3 pricing](https://aws.amazon.com/s3/pricing/)\n- [AWS Step Functions Pricing](https://aws.amazon.com/step-functions/pricing/)\n- [AWS Lambda Pricing](https://aws.amazon.com/lambda/pricing/)\n- [Amazon SQS Pricing](https://aws.amazon.com/sqs/pricing/)\n- [Amazon CloudWatch pricing](https://aws.amazon.com/cloudwatch/pricing/)\n\nThe costs incurred by the solution are based on usage and are AWS Free Tier eligible. After the AWS Free Tier allowance is consumed, usage costs are approximately $0.11 per 1000 minutes of call recordings. S3 Standard starts at $0.023 per GB/month; and S3 Glacier Instant Retrieval is $0.004 per GB/month, with $0.003 per GB of data retrieval. During a 6-year compliance retention term, the schedule-based resampling and storage tiering results in significant cost savings.\n\nIn the 6-year example detailed in Table 2, the S3 Standard storage costs would be approximately $356,664 for 3 million call-recording minutes/month. The audio resampling and S3 Glacier Instant Retrieval tiering reduces the 6-year cost to approximately $41,838.\n\n**Table 2. Multi-year costs savings scenario (3 million minutes/month) in USD**\n\n![table1.png](https://dev-media.amazoncloud.cn/1875809799c74c6fa14ba02c802e9b51_table1.png)\n\nTo explore PCA costs for yourself, use [AWS Cost Explorer](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/) or choose [Bill Detailshttps://console.aws.amazon.com/billing/home#/bills]() on the [AWS Billing Dashboard](https://console.aws.amazon.com/billing/) to see your month-to-date spend by service.\n\n\n#### **Deploying the solution**\n\n\nThe code and documentation for this solution are available by cloning the [git repository](https://github.com/aws-samples/amazon-connect-call-recording-cost-optimizer) and can be deployed with [AWS Cloud Development Kit (AWS CDK)](https://docs.aws.amazon.com/cdk/v2/guide/home.html).\n\n```Bash```\n```# clone repository```\n```git clone https://github.com/aws-samples/amazon-connect-call-recording-cost-optimizer.git```\n```# navigate the project directory```\n```cd amazon-connect-call-recording-cost-optimizer```\n\nModify the ```cdk.context.json``` with your environment’s configuration setting, such as the ```bucket_name```. Next, install the AWS CDK dependencies and deploy the solution:\n\n```:# ensure you are in the root directory of the repository```\n\n```./cdk-deploy.sh```\n\nOnce deployed, you can test the resampling solution by waiting for the EventBridge schedule rule to execute based on the ```num_days_age``` setting that is applied. You can also manually run the AWS Step Function with a specified date, for example ```{\"specific_date\":\"01/01/2022\"}```.\n\nThe AWS CDK deployment creates the following resources:\n\n- AWS Step Function\n- AWS Lambda function\n- Amazon SQS queues\n- Amazon EventBridge rule\n\nThe solution handles the automation of transitioning a storage tier, such as S3 Glacier Instant Retrieval. In addition, [Amazon S3 Lifecycles](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html) can be set manually to transition the call recordings after resampling to alternative [Amazon S3 Storage Classes](https://aws.amazon.com/s3/storage-classes).\n\n\n#### **Cleanup**\n\n\nWhen you are finished experimenting with this solution, cleanup your resources by running the command:\n\n```cdk destroy```\n\nThis command deletes the AWS CDK-deployed resources. However, the S3 bucket containing your call recordings and CloudWatch log groups are retained.\n\n\n#### **Conclusion**\n\n\nThis call recording resampling solution offers an automated, cost-optimized, and scalable architecture to reduce long-term compliance call recording archival costs.\n\n![image.png](https://dev-media.amazoncloud.cn/f8e1897174df4283800f569633f06581_image.png)\n\n\n#### **Brian Maguire**\n\n\nBrian Maguire is a Solution Architect at Amazon Web Services, where he is focused on helping customers build their ideas in the cloud. He is a technologist, writer, teacher, and student who loves learning. Brian is the co-author of the book Scalable Data Streaming with Amazon Kinesis (https://www.amazon.com/Scalable-Data-Streaming-Amazon-Kinesis/dp/1800565402).\n\n![image.png](https://dev-media.amazoncloud.cn/43fb8da5151740baa2b732f5ef75b120_image.png)\n\n\n#### **Clarence Choi**\n\n\nClarence Choi is a Solution Architect Specialist for Amazon Connect. He has been in the Contact Center technologies industry for 20+ years and previously worked in Oracle, Cisco, and Avaya helping customer improve their customer experience.\n\n![image.png](https://dev-media.amazoncloud.cn/794fc54cdea145e8a4a17192aceefa0b_image.png)\n\n\n#### **Herbert Guerrero**\n\n\nHerbert Guerrero is a Proserv Consultant at Amazon Web Services, where he is focused on streamlining Contact Centers using Amazon Connect along with other ancillary services. He loves working with customers to establish attainable strategies and build scalable Contact Center solutions.\n\n![image.png](https://dev-media.amazoncloud.cn/3b938018578645fdab8cd01698f5ee98_image.png)\n\n\n#### **Agnel Joseph**\n\n\nAgnel Joseph is a Proserv Consultant at Amazon Web Services, where he is focused on helping customers to deploy their contact center with Amazon Connect, along with other supporting services. He is a technologist and student who loves learning and creating new products.","render":"<p>In this post, we provide a serverless solution to cost-optimize the storage of contact-center call recordings. The solution automates the scheduling, storage-tiering, and resampling of call-recording files, resulting in immediate cost savings. The solution is an asynchronous architecture built using <a href=\"https://aws.amazon.com/step-functions/\" target=\"_blank\">AWS Step Functions</a>, <a href=\"https://aws.amazon.com/sqs/\" target=\"_blank\">Amazon Simple Queue Service (Amazon SQS)</a>, and <a href=\"http://aws.amazon.com/lambda\" target=\"_blank\">AWS Lambda</a>.</p>\n<p><a href=\"https://aws.amazon.com/connect/\" target=\"_blank\">Amazon Connect</a> provides an omnichannel cloud contact center with the ability to maintain call recordings for compliance and gaining actionable insights using <a href=\"https://aws.amazon.com/connect/contact-lens/\" target=\"_blank\">Contact Lens for Amazon Connect</a> and <a href=\"https://aws.amazon.com/machine-learning/ml-use-cases/contact-center-intelligence/partners/\" target=\"_blank\">AWS Contact Center Intelligence Partners</a>. The storage required for call recordings can quickly increase as customers meet compliance retention requirements, often spanning six or more years. This can lead to hundreds of terabytes in long-term storage.</p>\n<h4><a id=\"Solution_overview_5\"></a><strong>Solution overview</strong></h4>\n<p>When an agent completes a customer call, Amazon Connect sends the call recording to an <a href=\"https://aws.amazon.com/s3/\" target=\"_blank\">Amazon Simple Storage Solution (Amazon S3)</a> bucket with: a date and contact ID prefix, the file stored in the .WAV format and encoded using bitrate 256 kb/s, pcm_s16le, 8000 Hz, two channels, and 256 kb/s. The call-recording files are approximately 2 Mb/minute optimized for high-quality processing, such as machine learning analysis (see Figure 1).</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/d6ed84fb06a449c8a37ed661cd389308_image.png\" alt=\"image.png\" /></p>\n<p>Figure 1. Asynchronous architecture for batch resampling for call-recording files on Amazon S3</p>\n<p>When a call recording is sent to Amazon S3, downstream post-processing is often performed to generate analytics reports for agents and quality auditors. The downstream processing can include services that provide transcriptions, quality-of-service metrics, and sentiment analysis to create reports and trigger actionable events.</p>\n<p>While this processing is often completed within minutes, the downstream applications could require processing retries. As audio resampling reduces the quality of the audio files, it is essential to delay resampling until after processing is completed. As processed call recordings are infrequently accessed days after a call is completed, with only a small percentage accessed by agents and call quality auditors, call recordings can benefit from resampling and transitioning to long-term Amazon S3 storage tiers.</p>\n<p>In Figure 2, multiple AWS services work together to provide an end-to-end cost-optimization solution for your contact center call recordings.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/0e175019491e4ad7b8538001a2118313_image.png\" alt=\"image.png\" /></p>\n<p>Figure 2. AWS Step Function orchestrates the batch resampling of call recordings</p>\n<p>An <a href=\"https://aws.amazon.com/eventbridge/?nc2=h_ql_prod_ap_eb\" target=\"_blank\">Amazon EventBridge</a> schedule rule triggers the step function to perform the batch resampling process for all call recordings from the previous 7 days.</p>\n<p>In the first step function task, the Lambda function task iterates the S3 bucket using the <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html\" target=\"_blank\">ListObjectsV2</a> API, obtaining the call recordings (1000 objects per iteration) with the date prefix from 7 days ago.</p>\n<p>The next task invokes a Lambda function inserting the call recording objects into the Amazon SQS queue. The audio-conversion Lambda function receives the Amazon SQS queue events via the <a href=\"\" target=\"_blank\">event source mappinghttps://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html</a> Lambda integration. Each concurrent Lambda invocation downloads a stored call recording from Amazon S3, resampling the .WAV with <a href=\"https://www.ffmpeg.org/\" target=\"_blank\">ffmpeg</a> and tagging the S3 object with a “converted=True” tag.</p>\n<p>Finally, the conversion function uploads the resampled file to Amazon S3, overwriting the original call recording with the resampled recording using a cost-optimized storage class, such as <a href=\"https://aws.amazon.com/s3/storage-classes/\" target=\"_blank\">S3 Glacier Instant Retrieval</a>. S3 Glacier Instant Retrieval provides the lowest cost for long-lived data that is rarely accessed and requires milliseconds retrieval, such as for contact-center call-recording playback. By default, Amazon Connect stores call recordings with <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/versioning-workflows.html\" target=\"_blank\">S3 Versioning</a> enabled, maintaining the original file as a version. You can use lifecycle policies to <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html\" target=\"_blank\">delete object versions</a> from a version-enabled bucket to permanently remove the original version, as this will minimize the storage of the original call recording.</p>\n<p>This solution captures failures within the step function workflow with logging and a dead-letter queue, such as when an error occurs with resampling a recording file. A Step Function task monitors the Amazon SQS queue using the <a href=\"https://docs.aws.amazon.com/step-functions/latest/dg/supported-services-awssdk.html\" target=\"_blank\">AWS Step Function integration with AWS SDK</a> with SQS and ending the workflow when the queue is emptied. Table 1 demonstrates the default and resampled formats.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/af0a00d5890e46f687579bcfd7eea8df_image.png\" alt=\"image.png\" /></p>\n<p>Figure 3. Detailed AWS Step Functions state machine diagram</p>\n<h4><a id=\"Resampling_39\"></a><strong>Resampling</strong></h4>\n<p><strong>Table 1. Default and resampled call recording audio formats</strong></p>\n<p><img src=\"https://dev-media.amazoncloud.cn/d0c25beb79ae4c2597a60eed2449302b_table.png\" alt=\"table.png\" /></p>\n<h4><a id=\"Cost_assessment_47\"></a><strong>Cost assessment</strong></h4>\n<p>For pricing information for the primary services used in the solution, visit:</p>\n<ul>\n<li><a href=\"https://aws.amazon.com/s3/pricing/\" target=\"_blank\">Amazon S3 pricing</a></li>\n<li><a href=\"https://aws.amazon.com/step-functions/pricing/\" target=\"_blank\">AWS Step Functions Pricing</a></li>\n<li><a href=\"https://aws.amazon.com/lambda/pricing/\" target=\"_blank\">AWS Lambda Pricing</a></li>\n<li><a href=\"https://aws.amazon.com/sqs/pricing/\" target=\"_blank\">Amazon SQS Pricing</a></li>\n<li><a href=\"https://aws.amazon.com/cloudwatch/pricing/\" target=\"_blank\">Amazon CloudWatch pricing</a></li>\n</ul>\n<p>The costs incurred by the solution are based on usage and are AWS Free Tier eligible. After the AWS Free Tier allowance is consumed, usage costs are approximately $0.11 per 1000 minutes of call recordings. S3 Standard starts at $0.023 per GB/month; and S3 Glacier Instant Retrieval is $0.004 per GB/month, with $0.003 per GB of data retrieval. During a 6-year compliance retention term, the schedule-based resampling and storage tiering results in significant cost savings.</p>\n<p>In the 6-year example detailed in Table 2, the S3 Standard storage costs would be approximately $356,664 for 3 million call-recording minutes/month. The audio resampling and S3 Glacier Instant Retrieval tiering reduces the 6-year cost to approximately $41,838.</p>\n<p><strong>Table 2. Multi-year costs savings scenario (3 million minutes/month) in USD</strong></p>\n<p><img src=\"https://dev-media.amazoncloud.cn/1875809799c74c6fa14ba02c802e9b51_table1.png\" alt=\"table1.png\" /></p>\n<p>To explore PCA costs for yourself, use <a href=\"https://aws.amazon.com/aws-cost-management/aws-cost-explorer/\" target=\"_blank\">AWS Cost Explorer</a> or choose <a href=\"\" target=\"_blank\">Bill Detailshttps://console.aws.amazon.com/billing/home#/bills</a> on the <a href=\"https://console.aws.amazon.com/billing/\" target=\"_blank\">AWS Billing Dashboard</a> to see your month-to-date spend by service.</p>\n<h4><a id=\"Deploying_the_solution_69\"></a><strong>Deploying the solution</strong></h4>\n<p>The code and documentation for this solution are available by cloning the <a href=\"https://github.com/aws-samples/amazon-connect-call-recording-cost-optimizer\" target=\"_blank\">git repository</a> and can be deployed with <a href=\"https://docs.aws.amazon.com/cdk/v2/guide/home.html\" target=\"_blank\">AWS Cloud Development Kit (AWS CDK)</a>.</p>\n<p><code>Bash</code><br />\n<code># clone repository</code><br />\n<code>git clone https://github.com/aws-samples/amazon-connect-call-recording-cost-optimizer.git</code><br />\n<code># navigate the project directory</code><br />\n<code>cd amazon-connect-call-recording-cost-optimizer</code></p>\n<p>Modify the <code>cdk.context.json</code> with your environment’s configuration setting, such as the <code>bucket_name</code>. Next, install the AWS CDK dependencies and deploy the solution:</p>\n<p><code>:# ensure you are in the root directory of the repository</code></p>\n<p><code>./cdk-deploy.sh</code></p>\n<p>Once deployed, you can test the resampling solution by waiting for the EventBridge schedule rule to execute based on the <code>num_days_age</code> setting that is applied. You can also manually run the AWS Step Function with a specified date, for example <code>{&quot;specific_date&quot;:&quot;01/01/2022&quot;}</code>.</p>\n<p>The AWS CDK deployment creates the following resources:</p>\n<ul>\n<li>AWS Step Function</li>\n<li>AWS Lambda function</li>\n<li>Amazon SQS queues</li>\n<li>Amazon EventBridge rule</li>\n</ul>\n<p>The solution handles the automation of transitioning a storage tier, such as S3 Glacier Instant Retrieval. In addition, <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html\" target=\"_blank\">Amazon S3 Lifecycles</a> can be set manually to transition the call recordings after resampling to alternative <a href=\"https://aws.amazon.com/s3/storage-classes\" target=\"_blank\">Amazon S3 Storage Classes</a>.</p>\n<h4><a id=\"Cleanup_98\"></a><strong>Cleanup</strong></h4>\n<p>When you are finished experimenting with this solution, cleanup your resources by running the command:</p>\n<p><code>cdk destroy</code></p>\n<p>This command deletes the AWS CDK-deployed resources. However, the S3 bucket containing your call recordings and CloudWatch log groups are retained.</p>\n<h4><a id=\"Conclusion_108\"></a><strong>Conclusion</strong></h4>\n<p>This call recording resampling solution offers an automated, cost-optimized, and scalable architecture to reduce long-term compliance call recording archival costs.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/f8e1897174df4283800f569633f06581_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Brian_Maguire_116\"></a><strong>Brian Maguire</strong></h4>\n<p>Brian Maguire is a Solution Architect at Amazon Web Services, where he is focused on helping customers build their ideas in the cloud. He is a technologist, writer, teacher, and student who loves learning. Brian is the co-author of the book Scalable Data Streaming with Amazon Kinesis (https://www.amazon.com/Scalable-Data-Streaming-Amazon-Kinesis/dp/1800565402).</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/43fb8da5151740baa2b732f5ef75b120_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Clarence_Choi_124\"></a><strong>Clarence Choi</strong></h4>\n<p>Clarence Choi is a Solution Architect Specialist for Amazon Connect. He has been in the Contact Center technologies industry for 20+ years and previously worked in Oracle, Cisco, and Avaya helping customer improve their customer experience.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/794fc54cdea145e8a4a17192aceefa0b_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Herbert_Guerrero_132\"></a><strong>Herbert Guerrero</strong></h4>\n<p>Herbert Guerrero is a Proserv Consultant at Amazon Web Services, where he is focused on streamlining Contact Centers using Amazon Connect along with other ancillary services. He loves working with customers to establish attainable strategies and build scalable Contact Center solutions.</p>\n<p><img src=\"https://dev-media.amazoncloud.cn/3b938018578645fdab8cd01698f5ee98_image.png\" alt=\"image.png\" /></p>\n<h4><a id=\"Agnel_Joseph_140\"></a><strong>Agnel Joseph</strong></h4>\n<p>Agnel Joseph is a Proserv Consultant at Amazon Web Services, where he is focused on helping customers to deploy their contact center with Amazon Connect, along with other supporting services. He is a technologist and student who loves learning and creating new products.</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭
contact-us