drnugent / watson-voice-agent

Nexmo Watson Voice Agent Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nexmo and IBM Voice Agent with Watson

This repo will help you get started with connecting Nexmo to an IBM Voice Agent with Watson service orchestration engine. This will allow you to create complex flows to interact with your customers.

Setting up Node-RED

This sample project uses Node-RED to create the connection between Nexmo and IBM Voice Agent with Watson.

  1. Signup for IBM Cloud account (if you don't already have one)
  2. Create Node-RED Starter app in IBM Cloud
  3. This process can take a few minutes.
  4. Once complete, click View App URL
  5. Follow directions to setup Node-RED
  6. Copy the https://<app name>.mybluemix.net part of the application for use in the next step.

Create Nexmo Voice Application

You will need a Nexmo number and setup the voice application for this app. There are two ways to create an application with Nexmo - using the dashboard or the Nexmo CLI. This section will cover both methods.

Using the Dashboard

  1. Sign in or create a Nexmo account
  2. Buy a new virtual number
  3. Create a voice application
  4. Add the event url - https://<app name>.mybluemix.net/eventURL
  5. Add the answer url - https://<app name>.mybluemix.net/answerURL
  6. Click Create Application
  7. Click Numbers and link the recently created virtual number.
  8. Copy the virtual number for use in the next step.

Setting up the Voice Agent

Next you will need to create the Voice Agent in IBM Cloud. Copy the virtual number you created in in Nexmo for this step.

  1. Create an IBM Voice Agent with Watson
  2. Click Manage and then Create a voice agent
  3. Give your agent a name, and paste the Nexmo number in the Phone number field.
  4. Under Watson Assistant:
  5. Copy the workspace ID and store it for the Node-RED setup.
  6. Change the Service type to Service orchestration engine
  7. Add the url https://<app name>.mybluemix.net/soe
  8. Enter your username and password from Node-RED
  9. Click Create voice agent
  10. Navigate to Getting Started and copy your SIP endpoint and add your phone number to it like so: sip:15555555555@us-south.voiceagent.cloud.ibm.com

Create Node-RED Flow

Install the Nexmo Module

  1. Open the hamburger menu in the upper right of your Node-RED dashboard
  2. Click Manage palette
  3. Click Import and type nexmo into the box
  4. When the module node-red-contrib-nexmo pops up, click the Install button

Import Flow

There is a sample flow you can import and begin using right away.

  1. Open NodeRED-Nexmo-SOE.json and copy the entire contents.
  2. Open your Node-RED application.
  3. In the top right menu find Import > Clipboard
  4. Paste the json into the window, select New Flow and click Import.

Setup Watson Assistant Node

During the Voice Agent setup, it created a Watson Assistant service. Locate this in your IBM Cloud account.

  1. Copy the API Key and the URL
  2. In Node-RED, locate the Watson Assistant node, and paste in the API Key, paste the URL to Service Endpoint, and the Workspace ID you received during the last step.
  3. Click Done

Setup Nexmo Connect Node

  1. Locate the Connect node, and open it.
  2. Paste your SIP endpoint into the URI field.
  3. Add your virtual number to the From field.

Test it Out

Once all configuration is complete, click the Deploy button in node red to push the flow live.

Dial your virtual phone number. You will hear Please wait while we connect you. followed by the Watson Voice Assistant telling you about Voice Agent.

Extend

To take this further, you will want to build your own Voice Assistant skill set with intents and dialog. You can listen for these with a Node-RED switch and build flows and sub-flows to manage each specific intent.

About

Nexmo Watson Voice Agent Integration

License:MIT License