Skip to content

How to set up a deny list in Amazon Connect using Data Tables.

6 minute read
Content level: Intermediate
0

Allow agents in Amazon Connect to add numbers to a deny list in real time using only Amazon Connect resources. There is a current re:Post that walk through creating this functionality using DynamoDB, IAM, and multiple Lambda functions (https://repost.aws/knowledge-center/connect-deny-list-numbers). This guide shows how to achieve the same functionality using only native Amazon Connect features (Specifically Data Tables).

Prerequisites

This guide assumes you have:

  • An Amazon Connect instance.
  • Basic understanding of Amazon Connect contact flows and Data Tables.
  • Administrator access to your Amazon Connect instance.
  • The Security Policy must allow all Data table actions.

Solution Overview

Architecture

The solution uses Amazon Connect's native Data Tables to create and maintain a deny list of numbers. Numbers added to this list will be immediately disconnected when trying to initiate an inbound call to Amazon Connect. There are two sections to this solution:

  1. Check to see if an incoming number is on the deny list before connecting the call to your agents.
  2. When an agent receives a call from a number that needs to be added to the deny list, a quick connect is available to the agent to add the number to the list.

This approach eliminates the need for a DynamoDB table and Lambda functions, reducing complexity and operational overhead.

Implementation Steps

Step 1: Create the Data Table

  1. Log in to your Amazon Connect console.

  2. Navigate to Routing > Data tables.

  3. Click Add new data table.

  4. Configure the table:

    • Name: DenyListingTable
    • Description: Tracks incoming contact numbers that should be denied from connecting to the instance.
    • Select a Time zone (note: this is required when creating a new table). Data table creation
  5. Add the following attributes:

    • ContactNumber (Type: Text, Use as Primary)
    • denied (Type: Text) Create Primary Key
  6. Click Create.

  7. Click on the (empty text)(Default) under the denied attribute to add a default value.

    • Acknowledge the warning regarding primary attributes.
    • Set a default value of false to the denied field. Set a default value

Step 2: Create the Inbound Contact Flow

Create a new contact flow with the following logic:

Flow Structure:

  1. Set logging behavior: Enable flow logging for troubleshooting.

  2. Data Table: Capture the data table value for the incoming contact number.

    • Select action: Read from data table
    • Select read action: Evaluate Data Table values
    • Define data table: Set manually
      • Data table: DenyListingTable (should be visible in the dropdown)
      • Add a query:
        • Query name: onList (this can be anything as long as it is unique in the instance)
        • Primary attributes: Select ContactNumber as the attribute and use the value $.CustomerEndpoint.Address
        • Query attributes: denied (should be visible in the dropdown)
  3. Set contact attributes: Assign the captured value of denied in a User defined variable.

    • User defined — Key: deniedContact
    • Set manually — Value: $.DataTables.onList.denied
  4. Check contact attributes: Determine if the incoming contact number is set to be denied.

    • Attribute to check — User defined: deniedContact
    • Add Conditions to check for true and false (case sensitivity matters, so be sure to use the exact values used in the Data Table)
  5. Connect the "= true" branch to a Disconnect block to immediately drop the call. The caller will hear a generic network message related to not being able to connect the call.

  6. The "= false" branch and the "No Match" branch can be connected to the rest of the normal contact flow (i.e., Set working queue followed by a Transfer to queue).

Inbound call flow

Step 3: Create a Transfer to Queue Flow

Create a new contact flow with the following logic. This flow will be assigned to a Quick Connect for the agent to add a number to the deny list.

Flow Structure:

  1. Set logging behavior: Enable flow logging for troubleshooting.

  2. Play Prompt: Inform the agent that they are denying this number.

  3. Data Table: Update the data table with the new number set to denied = true.

    • Select action: Write to data table
    • Data table: DenyListingTable (should be visible in the dropdown)
      • Click Add a Primary value group: Use Input, Set manually
        • Group name: addNumber (this can be anything as long as it is unique in the instance)
        • Primary attributes: Select ContactNumber as the attribute and use the value $.CustomerEndpoint.Address
        • Click Add Attributes to write: denied (should be visible in the dropdown)
          • Attribute name: denied
          • Set attribute value: true
  4. On the Success branch, add a Play prompt to inform the agent the number was successfully added to the list.

  5. On the Error branch, add a Play prompt to inform the agent that there was an error when trying to add the number to the deny list.

  6. Disconnect.

Transfer to queue flow

Step 4: Create the Quick Connect and Add It to a Queue

  1. Navigate to Routing > Quick connects.
  2. Add a quick connect:
    • Type: Queue
    • Queue: Select any queue
    • Flows: Use the Queue transfer flow created in Step 3
  3. Click Save.
  4. Navigate to the Queue where the quick connect will be used (Routing > Queues).
  5. Edit the queue and add the new quick connect.

Test the Solution

Perform the initial call

  1. Set the Inbound flow to be used by a phone number in the instance.
  2. Call the number.
  3. As this is the first time calling, the call should get routed to the queue.

Add the number to the deny list

  1. Answer the call with an agent.
  2. Initiate the quick connect to add the number to the list.
  3. Disconnect and end the call.

Perform the second call

  1. Call the inbound number again using the same phone.
  2. The call should now be routed directly to the Disconnect block and the caller should hear a generic network message indicating the call cannot be connected.

Advantages of the Native Approach

  • No external dependencies: Everything runs within Amazon Connect.
  • Simplified architecture: No Lambda functions or DynamoDB tables to manage.
  • Reduced costs: No additional AWS service charges.
  • Easier maintenance: All configuration in one place.
  • Faster implementation: No code deployment required.
  • Built-in reliability: Leverages Amazon Connect's infrastructure.

Conclusion

By leveraging Amazon Connect's native data tables, you can implement a deny list without external dependencies. This approach simplifies the architecture, reduces operational complexity, and delivers the same customer experience improvements as custom solutions while being easier to maintain and more cost-effective.

Resources

AWS
SUPPORT ENGINEER
published a month ago143 views