Integrating Bandwidth with Cognigy via AIBridge

Follow

Pritom Roy

Updated

Bandwidth’s AIBridge allows you to easily test and deploy new Voice AI tools in the contact center without all the overhead of building custom integrations. Our pre-built integrations with top AI providers take the development time down from weeks to hours, unlocking a new level of flexibility to add and switch out vendors as desired and continuously refine your customer experience without the burden of technical debt. 

In this guide, we'll show you how to use AIBridge to accelerate your enterprise’s adoption of virtual agents and deliver better customer experiences at scale with Cognigy.

What do I need to get started?

  • A registered Bandwidth account contracted for AIBridge with phone numbers.
  • A registered Cognigy account (you can use a free trial account for testing purposes).
  • A Google Cloud Platform account for Text-to-Speech and Speech-to-Text services.

How does it work?

aibridge-integration-diagram.png

When a call is received to a Bandwidth number, we deliver it through AIBridge to your Cognigy instance and automatically handle the conversion of Text-to-Speech and Speech-to-Text in the call flow. You can use these services directly in your Google instance using the API keys obtained from your selected vendor (Google) or from Bandwidth’s own Google integration.

To connect your Bandwidth numbers to Cognigy, follow these steps:

  1. Create your Bandwidth endpoint in Cognigy
  2. Register your Cognigy endpoint in Bandwidth
  3. Register your Text-to-Speech and Speech-to-Text provider in Bandwidth
  4. Create your Bandwidth BOT
  5. Route Bandwidth numbers to your BOT
  6. Set up your Virtual Agent flow in Cognigy

Create your Bandwidth endpoint in Cognigy

First, you must create a Bandwidth endpoint in the Cognigy platform. Endpoints are used to connect external channels, such as Bandwidth to Cognigy. Bandwidth converts channel-specific inputs and outputs to the standardized input object accepted by Cognigy.

  1. Log into the Cognigy Portal.
  2. Using the side navigation bar, create an agent or select one you've already created.
  3. In the side navigation bar, select Deploy -> Endpoints and click New Endpoint. For more information on Cognigy Endpoints, see Endpoints.
  4. Complete the following fields:
    • Name: Provide a name for your endpoint.
    • Flow: Select an optional flow (you can also do this later).
    • Endpoint Type: Select Bandwidth
  5. Click Save.
  6. Save a copy of your endpoint URL – you'll need to provide it in the next section.

endpoints-in-bandwidth-sample-cognigy-ai.png

Register your Cognigy endpoint in Bandwidth

Once you've created your Bandwidth endpoint in Cognigy, you must register it in the Bandwidth App.

  1. Log into the Bandwidth App.
  2. In the left navigation bar, click Account and select Integrations.
  3. Click Add Integration.
  4. Confirm that the Integration Product field is set to AIBridge (it will be selected by default).
  5. Complete the following fields:
    • Name: Provide a name for this integration.
    • Integration Type: Select Cognigy.
    • Roles: Select Bot.
    • Description: Briefly describe this integration (optional).
    • Bot Url: Paste the Cognigy endpoint URL created here.
  6. Click Add to save this integration.

Register your Text-to-Speech and Speech-to-Text provider in Bandwidth

Since Cognigy only provides BOT functionality, it requires a mandatory Speech-to-Text and Text-to-Speech provider.

Through AIBridge, Bandwidth uses APIs to automatically convert Text-to-Speech and Speech-to-Text. This is a Bring-Your-Own (BYO) service, which means you must have your own account and billing relationship with your selected provider. Bandwidth’s preferred Speech-to-Text and Text-to-Speech provider is Google. If you'd like to use a different provider, please contact your Account Manager.

Google Cloud Platform

The following steps explain how to complete the basic setup. For more information, see Cloud Text-to-Speech API and Cloud Speech-to-Text.

  1. Log into the Google Cloud Platform.
  2. Select the relevant GCP Project.
  3. Create a new service account or use an existing one. For more information on service accounts, see Service accounts overview. We recommend creating a new service account to only deal with a certain set of permissions that have been granted.
  4. In the left-hand menu, select APIs & Services and click API Library.
  5. Search for "speech-to-text", then select Cloud Speech-to-Text API and click Enable
  6. Return to the API Library and search for “text-to-speech”, then select Cloud Text-to-Speech API and click Enable.

google-cloud-api-library.png

  1. Click Manage for Cloud Text-to-Speech API. Then, in the left-hand menu, select Credentials.
  2. Ensure you're enabling this service on the account you created or selected in Step 3.
  3. In the left-hand menu, select IAM & Admin and click IAM.
  4. Click Edit for the service account you created or selected in Step 3.
  5. Assign IAM roles Cloud Speech Client and Cloud Speech-to-Text Service Agent.
  6. Select IAM & Admin and click Service Accounts.
  7. Click on the existing service account and select the Keys tab. 
  8. Select Add Key and click Create New Key.
  9. Select JSON and click Create.
  10. Save a copy of your private key and client email – you'll need to provide it in the next section.

create-private-key.png

Bandwidth App

  1. Log into the Bandwidth App.
  2. In the left navigation bar, click Account and select Integrations.
  3. Click Add Integration.
  4. Confirm that the Integration Product field is set to AIBridge (it will be selected by default). 
  5. Complete the following fields:
    • Name: Provide a name for this integration.
    • Integration Type: Select Google.
    • Roles: Select Text to Speech and Speech to Text.
    • Description: Briefly describe this integration (optional).
    • Private Key: Enter your private key created here.
    • Client Email: Enter your client email created here.
    • Region: Enter the appropriate region (e.g., "global").
    • Location: Enter the appropriate location (e.g., "global").
    • Environment: Enter the appropriate environment (e.g., “production”).
    • Project Id: Enter your project ID.
  6. Click Add to save this integration.

Bandwidth is now ready to consume Google services directly from your account. Any billing records for Text-to-Speech and Speech-to-Text will be directly generated in your Google Cloud Platform account. 

Create your Bandwidth BOT

Once you've registered your endpoint and your Text-to-Speech and Speech-to-Text provider, you're ready to create your Bandwidth BOT.

Bandwidth App

  1. In the left navigation bar, click Applications and select Bots.
  2. Click Create Bot.
  3. Complete the following fields:
    • Name: Enter a name for your BOT.
    • Description: Briefly describe this BOT.
    • Bot Framework: Select the name of the Bot Framework created here.
    • Text-to-speech: Select the name of the Text-to-Speech provider created here.
    • Speech-to-text: Select the name of the Speech-to-Text provider created here.
    • Voice Name: Select the voice name for your Text-to-Speech service.
    • Language: Select the language for your Text-to-Speech service. 
  4. Click Save to create your BOT.

Route Bandwidth numbers to your BOT

First, you must order a phone number from Bandwidth or use an existing one. You can use Advanced Call Routing (ACR) to route Bandwidth numbers to your BOTs in various ways. You must also decide whether you want to apply ACR settings to the entire Location or a specific phone number.

The following steps explain how to set up this configuration via the Bandwidth App or the Visual Builder.

Bandwidth App – Locations

Locations help you organize your phone number inventory. When a number is added to a Location, it inherits the settings and properties of that Location. ACR settings apply to all numbers on a Location. 

  1. In the left navigation bar, click Account and select Locations.
  2. Click Create Location or select an existing Location.
  3. Select the Voice tab.
  4. Under Routing, click Create Primary Route.
  5. Under Action, select Route To AIBridge Bot.
  6. Under Bot, select the name of the BOT created here.
  7. Click Save.
  8. Click Create Location (if creating a new Location) or Save Changes (if updating an existing one).

Bandwidth App – TNs

If you don't want to apply the ACR settings to an entire Location, you can apply them to an individual telephone number (TN) instead. To do this, you need to add the route and endpoint on that number’s Phone Number Details page.

  1. In the top navigation bar, click Numbers and select My Numbers.
  2. Find the relevant TN and click it.
  3. Scroll down to the Routing section.
  4. Click Create Primary Route
  5. Under Action, select Route To AI-Bridge Bot.
  6. Under Bot, select the name of the BOT created here.
  7. Click Save.
  8. Under Routing, click Submit.

 

Visual Builder – Locations or TNs

The Visual Builder is our drag-and-drop, no-code graphical user interface (GUI) that allows you to create complex call flows for inbound calls. You can create call flows at the Location or TN level. 

  1. In the top navigation bar, click Visual Builder.
  2. Click Create New Flow.
  3. Select whether the flow should be applied at the Location or TN level.
  4. Under Call Control, add the Advanced Call Routing node. 
  5. Under Integrations, add the AIBridge node. 
  6. Under Bot, select the name of the BOT created here.
  7. Select Publish or Publish As.

 

Set up your Virtual Agent flow in Cognigy

The flow is a visual representation of a potential dialog in a user-friendly interface. It's composed of individual nodes with different functionalities, ranging from generating output to collecting backend information, and is automatically executed as soon as the call comes into the numbers you've routed to your Cognigy endpoint.

Cognigy

Create a new flow

Use the following steps to create a new flow. For more information on designing your first Cognigy flow, see Flows.

  1. Log into the Cognigy platform and select your agent.
  2. In the left-hand menu, navigate to Build -> Flows.
  3. Click New Flow.
  4. Enter a name and description.
  5. Click Create.

Link your flow to your Bandwidth endpoint

Once you've set up your flow, you can link it to your Bandwidth endpoint if you haven't already done so earlier.

  1. In the left-hand menu, navigate to Deploy -> Endpoints and click on your existing Cognigy endpoint created here.
  2. Under Flow, select the new flow created here or choose an existing one.
  3. Click Save. You've now successfully linked Bandwidth to Cognigy via AIBridge. Any incoming calls will be directly routed to your BOT.

endpoint-editor-bandwidth-connector.png

Transferring calls

You can use Transfer to send the current call to another Bandwidth phone number. This is useful for customer escalations or in scenarios where the virtual agent is unable to resolve the query.

To learn more about transferring calls in Cognigy, see Transfer. Once the call is transferred to a Bandwidth number, it'll look like an incoming call to Bandwidth.

You can use Advanced Call Routing to decide where to send the call (for example, to a contact center agent in Genesys using our BYOC for Genesys Cloud).

Support and further issues

If you’re still having trouble connecting Bandwidth to Cognigy, here are a few last tips:

  1. Check whether your calls are reaching Bandwidth by looking at your Call History.
  2. Check your BOT configuration and flow in the Cognigy portal.
  3. If you see a call record showing up in Bandwidth with an error message, please open a ticket with your Bandwidth Support Team.

Article is closed for comments.