Automated Phone Number Vetting

The following steps detail the process of configuring and using Automated Phone Number Vetting+.

Pre-requisites

  1. First Orion Branded Communications agreement
  2. Access to First Orion Customer Portal
  3. Vetted and Approved Business
  4. Sentry agreement
  5. Understanding of current calling platform and how to setup inbound rules for phone calls.

What

First Orion must ensure that a business has the right to use phone numbers submitted for SENTRY-enablement. First Orion will call each number submitted for a Sentry program. Those phone numbers will need to answer and respond back to First Orion with business information. The purpose of this document is to show how to automate the process.

Where and how to use

This should take place in the inbound call routing of the calling platform, usually this is the Interactive Voice Response (IVR). When First Orion calls phone numbers, the calling platform will need to recognise the phone number and respond to it with a voice message including necessary business details.

{{{Add details here}}}

Understanding the Call Flow.

  1. First Orion will place a phone call to the Sentry enrolled phone number.
  2. The phone number will receive the phone call.
  3. The phone call platform should route the call to an automated message.
  4. The automated message should provide the necessary business details.
  5. The phone system should hang up phone call.
Replace, just here as reminder.

Update this diagram

Example integration

This example uses Amazon Connect as the Client Phone Platform and shows how an inbound flow in could work for automated number vetting.

Setup Inbound Contact Flow

All successful flow blocks should route to playing the business details message. Alls failures should route to being transferred or ending the flow.

  1. In Amazon Connect, navigate to the Flow Menu
  2. Click Create Flow to create a new Contact flow.
  3. Add a Set callback number block
    1. Edit this block: Under Use attribute, set Namespace to "System" and Key to "Customer address or number". This will pass the calling phone number to the Lambda.
  4. Add a AWS Lambda Function block
    1. Edit this block: Set this function to your phone number checking Lambda. (See example below)
  5. Add 2 Play prompt blocks
    1. Edit first block: Setup audio to play the necessary business details.
    2. Edit second block: Setup the audio for transferring to an agent.
  6. Add preferred transfer block
    1. Transfer to flow
    2. Transfer to queue
    3. Transfer to phone number
Example Inbound Contact flow

Example Inbound Contact flow


Setup Lamba Function

This is the Python code used in the Lambda. It needs to check the calling number against the First Orion phone number list. If the number is in the list, it will return success. If the number is not in the list, it will return an error.

  • If the phone number is found the Connect Flow should go through the success path. (Automated message)
  • If the phone number is not found the Connect flow should go through the error path. (Transfer to agent)
import json

def lambda_handler(event, context):
    #print(event) # Uncomment for logging
    number_to_check = event["Details"]["ContactData"]["CustomerEndpoint"]["Address"]
    # print("Number calling in, "+number_to_check) # Uncomment for logging

    first_orion_numbers = ["+15013584061"]

    if number_to_check in first_orion_numbers:
        return {
            'statusCode': 200,
            'body': json.dumps('This is First Orion!')
        }
    return {
        'statusCode': 500,
        'body': {
            'error': 'INTERNAL_ERROR',
            'message': 'This is not First Orion'
        }
    }

Lambda function block in Amazon Connect Flow

Set Lambda Function in Lambda Function Block

Set Lambda Function in Lambda Function Block

Test functionality

  1. Make an inbound phone call
  2. Listen to the message played back.
    1. If the function is working correctly the business details should be playing from the phone system.
    2. If the function is not working, it should transfer the phone call to an agent.