Skip to content

Overview

Call Center solutions are very popular regarding real-time authentication scenarios. To simplify integration to das-Peak Streaming, we are providing integral solutions for different Call Center platforms that wrap das-Peak Streaming API calls in a simple to use interface.

Current available das-Peak Streaming integrations are shown in the following table:

Call Center Platform Agent IVR
Genesys Cloud
Twilio

Check details of each available integration in each platform integrations section.

Agent based solution

For every available integration, das-Peak Streaming agent based solution is based on some Javascript files that must be used by integrators to implement their own integration:

  • daspeak-streaming-web-agent-{platform}.bundle.js: It defines a <daspeak-streaming-web-agent-{platform}> Web Component that contains all integration logic and UI implementation.
  • config.js: Includes integration configuration to be filled by integrator.
  • utils.js: Includes some utilities used by the integration.

Configuration file

Configuration file config.js is used to configure integration with customized values. For each platform integration, configuration file may differ. Check different configuration file examples for each integration in its corresponding section.

Utilities file

Utilities file offers integrators a way of adding customized behavior to their integration. This is done via some Javascript functions:

  • storeCredential
  • deleteCredential
  • getCredential
  • onResponse
  • getTemporaryToken

Before analyzing these functions, take a look at a utils.js sample file:

const apiBaseUrl = '{{ HOST_URL }}' + 'database';

function storeCredential(id, credential) {
  // Replace following code with your own storeCredential implementation
  fetch(`${apiBaseUrl}/storeCredential`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: new URLSearchParams({ id, credential }),
  });
}

function deleteCredential(id) {
  // Replace following code with your own deleteCredential implementation
  fetch(`${apiBaseUrl}/deleteCredential`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: new URLSearchParams({ id }),
  });
}

async function getCredential(id) {
  // Replace following code with your own getCredential implementation
  const response = await fetch(`${apiBaseUrl}/getCredential?id=${encodeURIComponent(id)}`, {
    method: 'GET'
  });
  const data = await response.json();
  return data.credential;
}

function onResponse(result, collected_audio) {
  // Replace following code with your own onResponse implementation
  console.log(`onResponse result = ${JSON.stringify(result)}`);
  // Example code to download collected_audio for a register session
  if (collectedAudio !== undefined) {
    var file = new Blob([collectedAudio], {type: "application/octet-binary;charset=utf-8"});
    var a = document.createElement("a"), url = URL.createObjectURL(file);
    a.href = url;
    a.download = 'collected_audio';
    document.body.appendChild(a);
    a.click();
  }
}

async function getTemporaryToken(authenticationServerUrl) {
  // Replace following code with your own getTemporaryToken implementation
  const response = await fetch(authenticationServerUrl, {
    method: 'GET'
  });
  const data = await response.json();
  return data.access_token;
}

export default {
  storeCredential,
  deleteCredential,
  getCredential,
  onResponse,
  getTemporaryToken,
};

Store credential function

storeCredential function must be used to manage biometric credentials storage. It's executed when a registration process is successfully completed. In this example, credentials are stored by calling a REST API that is connected to a database service.

function storeCredential(id, credential) {
  // Replace following code with your own storeCredential implementation
  fetch(`${apiBaseUrl}/storeCredential`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: new URLSearchParams({ id, credential }),
  });
}

Parameters:

  • id (String) - ANI identifier of the caller.
  • credential (String) - Biometric credential generated by Veridas das-Peak Streaming biometric service.

Delete credential function

deleteCredential function must be used to manage credential removal. It's executed when "Delete User" button is pressed and after confirmation. In this example, credentials are deleted by calling a REST API that is connected to a database service.

function deleteCredential(id) {
  // Replace following code with your own deleteCredential implementation
  fetch(`${apiBaseUrl}/deleteCredential`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    body: new URLSearchParams({ id }),
  });
}

Parameters:

  • id (String) - ANI identifier of the caller.

Get credential function

getCredential function must be used to manage biometric credential retrieval. It's executed when application is firstly loaded. If a valid credential is returned by this funtion, user is recognized as already registered and "Authenticate User" template is shown, else "Register User" template is shown. In this example, credentials are retrieved by calling a REST API that is connected to a database service.

async function getCredential(id) {
  // Replace following code with your own getCredential implementation
  const response = await fetch(`${apiBaseUrl}/getCredential?id=${encodeURIComponent(id)}`, {
    method: 'GET'
  });
  const data = await response.json();
  return data.credential;
}

Note that getCredential function is an async function. await keyword suspends application execution until an asynchronous function return promise is fulfilled and unwraps the credential value from the Promise returned.

Parameters:

  • id (String) - ANI identifier of the caller.

Returns:

  • credential (String) - Previously stored biometric credential generated by Veridas das-Peak Streaming biometric service.

On Response function

onResponse function may be used by integrators to implement their own logic upon das-Peak Streaming events. It's executed each time an event is received from das-Peak Streaming. In this example, received event result is printed through web console.

function onResponse(result) {
  // Replace following code with your own onResponse implementation
  console.log(`onResponse result = ${JSON.stringify(result)}`);
  // Example code to download collected_audio for a register session as a file
  if (collectedAudio !== undefined) {
    var file = new Blob([collectedAudio], {type: "application/octet-binary;charset=utf-8"});
    var a = document.createElement("a"), url = URL.createObjectURL(file);
    a.href = url;
    a.download = 'collected_audio';
    document.body.appendChild(a);
    a.click();
  }
}

onResponse function is executed upon receiving following das-Peak Streaming events:

  • result-success
  • result-fail-score
  • result-fail-spoof
  • error-consumer-not-ready
  • error-parameters
  • error-audio
  • error-das-Peak

Parameters:

  • result (Object): JSON object containing response received from das-Peak Streaming.
  • audio (ArrayBuffer): ArrayBuffer object with collected audio for a register session. When received event is different to result-success its value is undefined.

Get temporary token function

das-Peak Streaming uses an OAuth2 access token mechanism to implement service authorization where a Client Credentials grant is used. Since das-Peak Streaming web agent is a web based solution, it can't send client_id and client_credentials directly, it needs an authentication backend which stores those values and makes requests to Veridas authorization service in order to get an access token. This authentication backend must be implemented by integrators.

Authorization flow

getTemporaryToken function must be used to get OAuth2 access tokens. It's executed each time a request is performed against das-Peak Streaming API. In this example, a GET request is performed against authentication backend to obtain a valid access token.

async function getTemporaryToken(authenticationServerUrl) {
  // Replace following code with your own getTemporaryToken implementation
  const response = await fetch(authenticationServerUrl, {
    method: 'GET'
  });
  const data = await response.json();
  return data.access_token;
}

Note that getTemporaryToken function is an async function. await keyword suspends application execution until an asynchronous function return promise is fulfilled and unwraps the access token value from the Promise returned.

Parameters:

  • authenticationServerUrl (String) - URL of authentication backend.

Returns:

  • access_token (String) - Access token to be used for das-Peak Streaming authorization.

A python example of authentication backend implementation is shown in next code snippet. CLIENT_ID, CLIENT_SECRET and AUTH_SERVER_URL values must be provided by Veridas.

import requests
import json

def get_credential_oauth():
    client_id = 'CLIENT_ID'
    client_secret = 'CLIENT_SECRET'
    auth_server_url = 'AUTH_SERVER_URL'

    files = {
        'grant_type': 'client_credentials',
        'client_id': client_id,
        'client_secret': client_secret
    }

    response = requests.request(
        "POST",
        auth_server_url,
        files=files
    )

    response_dict = json.loads(response.text)
    return response_dict

Usage

Web Component offers to the agent user registration/verification capabilities. The integration for each platform is slightly different, however, the usability is the same for each integration.

Upon successful integration, Web Component will appear within platform's agent panel for an existing call.

Agent Register

Register a user

Any agent can start a registration process for a calling user using voice from interaction call just by pressing "Register User" button. This will create a Register Session in das-Peak Streaming and the agent will receive feedback of the progress of the Session:

Agent Register Processing

Upon successful registration, agent will receive a notification and a green tick icon will be displayed.

Agent Register Success

If Credential Management is implemented, received biometric credential will be stored in a database for later verification.

Authenticate a user

When an agent receives a call from a user that was previously registered, this is, its credential was already stored in customer database, then "Authenticate User" button will be displayed:

Agent Verify

When agent aims to start a verification process, he will just press "Authenticate User" button. Previously registered credential will be obtained and used for verification process. This way, a Verify Session will be created in das-Peak Streaming and the agent will receive feedback of the progress of the Session:

Agent Verify Processing

Upon successful verification, agent will receive a notification and a green tick icon will be displayed. Then, agent can perform a new verification process using "Re-Authenticate User" button.

Agent Verify Success

Delete a user

During an interaction, if Credential Management is implemented, an agent can delete a user credential from database if already registered just by pressing trash icon button. A popup will be displayed for confirmation.

Agent Delete Popup

Agent Delete Success

Errors

Following errors may occur during Interaction Widget operation:

Error Display Cause Possible solution
Spoof error Agent Spoof Audio is tagged as pre-recorded voice. Try again with different voice.
Authentication error Agent Fail Audio can't be verified. Try again with different voice.
Configuration error Agent Error Configuration There is a wrong configuration. Check development console for errors. Probably something is wrong with config.js file.
Connection error Agent Error Connection There is an error while connecting with das-Peak Streaming Check configuration sioUrl parameter. If problem persists, contact with the administrator.

IVR based solution

das-Peak Streaming IVR based solutions are built using Contact Center platform's flow designer tools. These are drag-and-drop web based design tools that allow platform administrator to easilly create IVRs (flows).

These tools can make requests to external services in a synchronous manner. This way, das-Peak Streaming REST API can be called from Contact Center platform to perform registration/verification processes.

Check details of each platform IVR integration in each corresponding section.