From Bright Pattern Documentation
Jump to: navigation, search
This page contains changes which are not marked for translation.
• 5.19


How to Implement Number Blocking for Voice Calls

Once in a while, your contact center's agents get calls from those annoying spamming trolls or maybe from a lonely individual who just wants to talk. Regardless of whom it may be, it is disruptive and takes up an agent’s valuable time. So, how do you handle these pesky disruptions? Number blocking.

Bright Pattern Contact Center software provides a highly customizable environment that allows one to implement a number of capabilities and functions; however, it can be tricky to know where to start. In this guide, we will be showing you one of several ways to implement number blocking for voice calls.

How it works

Very simply, when an agent receives a phone call that they want to block, they can end the call, select the Block Number disposition and click the complete button.

Once the disposition is submitted, it will trigger a workflow that creates an instance inside a blocked list. The list will then be accessed by an inbound voice scenario that determines whether a call will get connected to an agent or dropped—"blocking" that number.


An agent selecting the "Block Number" disposition after ending the call.


Requirements

Before you dive into the setup, there are two things you will need for this to work: an API secret to call your APIs and a .CSV file that will be used to format your list.

API Secret

The API secret property can be accessed from a user that has the appropriate API privileges in the Contact Center Administrator application, section Users & Teams > Users. All you need to do is click Generate and an API secret will be provided for you.


Generating an API secret from a user


CSV File

As for the .CSV file, make sure that you have two fields filled out: one for phone numbers and one for a blocked status, which can be either true or false.


CSV fields


Setup

This setup is implemented easily on a higher level, working in only four areas: lists, dispositions, workflows, and scenarios.


Creating a List

The list is where the blocked numbers will be stored. In the Lists section of the Contact Center Administrator application, create a list by uploading the .CSV file you made earlier.

As you go through the list import wizard, the key things you need to configure are:

  1. Check the 'First line contains field names checkbox in the Format Type tab.
  2. Set both the "Phone Number" and "Blocked" fields to be required and searchable in the Fields tab.
  3. Set the "Phone Number" field to be the unique identifier in the Key tab.


Configuring Services & Campaigns - Dispositions

Once the list is created, attach it to the inbound voice service of your choosing. This service should be assigned to the team handling inbound calls.

Within the chosen service, go to the Properties tab, and check the Use dispositions checkbox.

Next, in the Dispositions tab, add a new inbound disposition to the desired category and name it "Block Number". This is what enables agents to block numbers.


Building a Workflow

Having a disposition is great as it gives agents something to interact with, but unless a workflow is attached, no action takes place.

Start by creating a new workflow in the Workflows section in the Contact Center Administrator application. Clicking the + button will open the Workflow Builder application.

In the workflow builder, you will add blocks to get an access token to call the other APIs, and check to see if this phone number already exists in the blocked list. If the phone number entry exists, you will update that entry’s blocked status to true, else you will add the new number as a new list entry.

Your workflow should be structured as follows:

  1. A Fetch URL block that gets an access token
  2. A Fetch URL block that queries a record
    • For this block's 'No data conditional' exit add a Fetch URL block that updates a record; the 'Blocked' field is set from false to true.
  3. A Fetch URL block that adds a record
  4. An Exit block


Note: For specific Fetch URL block configurations, see section Fetch URL Block Examples.

2022.02.07 4.png


With the workflow completed, save it and then, in the workflow entries' properties, add the "Block Number" disposition as a trigger. Now, when an agent submits the "Block Number" disposition, it will automatically run this workflow.


Setting the "Block Number" disposition as a trigger in the workflow

Building a Scenario

So far, you have implemented the capabilities to put undesirable phone numbers into a blocked list, but this list doesn't actually block any numbers. That’s because you need to create a scenario to handle the inbound calls you want to block.

As you did when creating your workflow, go to section Scenarios > Voice in the Contact Center Administrator application and create a new scenario. In the Scenario Builder application, you will add blocks to get an access token and then check if a phone number exists in the blocked list. If an entry does exist, you will then check if the blocked status is true or false. If true, the scenario will end, otherwise it will continue on.

Your scenario should be structured as follows:

  1. A Fetch URL block that gets an access token
  2. A Fetch URL block that queries a record
  3. An If block with a true branch, with the condition:
Scenario variable (string)
jsdata.__data__.entry.blocked
is =
true
(Note: “jsdata” is the scenario variable containing the results of the previous Fetch URL block.)
  • The true branch will contain:
    • A Play Prompt block notifying the caller that the number they have reached no longer exists.
    • An Exit block.

Note: For specific Fetch URL block configurations, see section Fetch URL Block Examples.


2022.02.07 6.png


After saving, this blocking scenario can be called in your main scenario that handles inbound calls, as shown in the example below. Specifically, you will use the Start Another Scenario block to trigger the blocked-number scenario. If the incoming caller's number is not blocked, the call will return to the main scenario and connect to an agent.


2022.02.07 7.png


Unblocking

Just like blocking, there are many ways to implement unblocking. In this instance, you will find that it is showcased through SMS, where an agent or supervisor can message a dedicated number with the word "UNBLOCK".

A scenario will listen for the word and check if the phone number requesting for the unblock matches a qualified agent or supervisor’s phone number. If the number is valid, it will send a message asking for the number that is to be unblock. Once it receives the number, it will retrieve the entry with that number attached and update its blocked status to false.


Unblocking workflow via SMS


For this, you will create a new chat scenario that will look like this:

  • An If block that checks the variable item.message to see if it matches the string "UNBLOCK".


2022.02.07 9.png


  • A Request input block asking for the phone number that is to be unblocked
  • A Fetch URL block that gets an access token
  • A Fetch URL block that queries a record
  • A Fetch URL block that updates a record
  • A Send Message+ block that confirms that the number has been unblocked


2022.02.07 10.png


When you are finished, assign this scenario to the service handling inbound chat with the dedicated number set as the Outbound chat account in the service's Property tab.


Customization

This tutorial presents a bare-bones implementation of number blocking for voice calls that you can be customized to suit your contact center’s needs. Some customization examples include adding timeouts, make blocking for specific agents, implement blocking for SMS, and so forth.


Fetch URL Block Examples

The Fetch URL blocks used in both the workflow and the scenario use methods from the Bright Pattern List Management API. The following examples show how the method requests are made per block.


2022.02.07 10.png


Get Access Token

Note that all List Management API methods must include a valid access token in order to work successfully.

  • Title text: <any_text>
  • Request type: POST
  • URL to fetch: https://<tenant_URL>/configapi/v2/oauth/token
  • Content Type: application/x-www-form-urlencoded
  • Form parameters:
    • client_id: <username>
    • client_secret: <client_secret>
    • grant_type: <client_credentials>
    • scope: <contact_center_URL>
  • Scenario variable: <any_text>


2022.02.07 11.png


Add Record

  • Title text: <any_text>
  • Request type: POST
  • URL to fetch: https://<tenant_URL>/configapi/v2/callinglist/add/:list_name
  • Extra Headers:
    • Authorization: Bearer $(<scenario_variable>.access_token)
  • Content Type: application/json
  • Body: {"<list_phone_field_name>": "$(item.customerPhone)", "Blocked": "true"}


2022.02.07 12.png


Query A Record

  • Title text: <any_text>
  • Request type: POST
  • URL to fetch: https://<tenant_URL>/configapi/v2/callinglist/get/:list_name/:campaignname
  • Extra Headers:
    • Authorization: Bearer $(<scenario_variable>.access_token)
  • Content Type: application/json
  • Body: {"<list_phone_field_name>": "$(item.customerPhone)"}
  • Check Use GenNext block to loop through data


2022.02.07 13.png


Update Record

  • Title text: <any_text>
  • Request type: POST
  • URL to fetch: https://<tenant_URL>/configapi/v2/callinglist/get/:list_name/:campaignname
  • Extra Headers:
    • Authorization: Bearer $(<scenario_variable>.access_token)
  • Content Type: application/json
  • Body: {"<list_phone_field_name>": "$(item.message)", "Blocked": "false"}
  • Check Use GenNext block to loop through data


2022.02.07 14.png


Related articles

< Previous