Skip to content
Use Voice Gateway and Watson on IBM Cloud Private to create a next generation call center
Branch: master
Clone or download
imgbot and Steve Martinelli [ImgBot] Optimize images (#12)
*Total -- 1,604.24kb -> 924.89kb (42.35%)

/images/credentials.png -- 189.58kb -> 101.77kb (46.32%)
/images/sip.png -- 123.50kb -> 67.07kb (45.69%)
/images/trunk.png -- 89.64kb -> 49.41kb (44.88%)
/images/name.png -- 109.11kb -> 61.02kb (44.08%)
/images/number.png -- 76.15kb -> 42.77kb (43.84%)
/images/catalog.png -- 84.23kb -> 47.68kb (43.39%)
/images/overview.png -- 475.64kb -> 275.61kb (42.05%)
/images/icp.png -- 311.44kb -> 181.61kb (41.69%)
/images/sip_number.png -- 65.22kb -> 41.91kb (35.74%)
/images/architecture.png -- 79.73kb -> 56.03kb (29.72%)
Latest commit c400bee Apr 22, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
data add sample workspace Aug 2, 2018
images Create Oct 5, 2018
LICENSE Initial commit Jul 26, 2018 Create Oct 5, 2018 Update links in README (#10) Jan 11, 2019

Automating Call Centers with Voice Gateway on IBM Cloud Private

This code pattern is a Voice Gateway application that enables companies to automate their call centers using Watson Assistant, Text to Speech, and Speech to Text, without having to orchestrate between all the different services yourself; the Voice Gateway will do that for you.

When the reader has completed this Code Pattern, they will understand how to:

  • Provision Watson Assistant, Speech to Text, and Text to Speech services on IBM Cloud
  • Import a sample Call Center dialog to Watson Assistant
  • Deploy a Voice Gateway service on IBM Cloud Private
  • Connect Voice Gateway to Twilio via the SIP communication protocol


  1. User phones a call center phone number, associated with a Twilio account.
  2. The Twilio number connects to a configured Voice Gateway service via the SIP communication protocol. Voice Gateway is running on IBM Cloud Private.
  3. Voice Gateway calls Watson Speech to Text to transcribe user input.
  4. Based on user input, certain flows in Watson Assistant will be triggered.
  5. Any results from Watson Assistant will be transmitted back to the Voice Gateway service via Watson Text to Speech.
  6. Voice Gateway will sends the audio back via the Elastic SIP Trunk.
  7. The resulting audio is played back to the user.

Included components

  • IBM Cloud Private: An on-prem version of IBM Cloud to store your sensitive data and applications.
  • IBM Voice Gateway: A service that enables you to build apps that leverage Assistant, Text to Speech, and Speech to Text, without having to tie them all in manually.
  • Watson Assistant: Create a chatbot with a program that conducts a conversation via auditory or textual methods.
  • Watson Text to Speech: Converts written text into natural sounding audio in a variety of languages and voices.
  • Watson Speech to Text: A service that converts human voice into written text.
  • Twilio: Integrate voice, messaging, and VoIP into your web and mobile apps.

Featured Technologies

  • Artificial Intelligence: Artificial intelligence can be applied to disparate solution spaces to deliver disruptive technologies.
  • Python: Python is a programming language that lets you work more quickly and integrate your systems more effectively.

Watch the Video



  1. Create Watson services on IBM Cloud
  2. Import the conversation into Watson Assistant
  3. Deploy the Voice Gateway on IBM Cloud Private
  4. Configure Voice Gateway and Twilio

1. Create Watson services on IBM Cloud

Start by heading over to your IBM Cloud catalog and creating the three services listed below:

We'll need the credentials for each of these. To retrieve them, navigate to each created service and select the Credentials tab.

2. Import the conversation into Watson Assistant

Now, setup your chatbot - you can either create your own chatbot, use the sample workspace provided in this code pattern, located in data/workspace.json. Use the Watson Assistant tooling to import the dialog to a new workspace. To do this, launch the Watson Assistant tool and use the import icon button on the right. Find the data/workspace.json file from the cloned repo and import that to the Watson Assistant tool.

Each workspace in Watson Assistant has a specific ID. To find the Workspace ID for a given workspace, click the context menu of the workspace and select View details. The workspace ID can be copied and saved as we'll need it in the next step.

3. Deploy the Voice Gateway on IBM Cloud Private

The interface of IBM Cloud Private is, of course, very similar to that of IBM Cloud (public); so you should find it easy to navigate this interface if you're familiar with IBM Cloud.

Head over to the Catalog, and either search for, or scroll down to, the ibm-voice-gateway-dev tile and select it.

Once the next screen loads choose to Configure your Voice Gateway service.

You can then enter a Release name (the name of your service), a Target namespace (where to store this service), and then read the license agreements. If you agree, check the checkbox.

Finally, you can ignore all of the fields in the following form except for the Watson API Credential fields - go ahead and fill them all out (Assistant, Speech to Text, Text to Speech). Once you fill out these fields, you can click on the Install button.

Once up and running, you should be able to view the running Voice Gateway service. NOTE: Be sure to note the host IP address, we'll be needing that in the next section.

4. Configure Voice Gateway and Twilio

For this next section we'll create a new Twilio account. The Twilio account will provide us with a free phone number for a few days and the ability to configure an SIP trunk to connect with our Voice Gateway. Here's the free phone number that we'll use to configure with an SIP trunk.

To create a new SIP trunk connection go to the context menu and select Elastic SIP Trunking. Create a new one with a unique name.

We now need to let Twilio know about our Voice Gateway service. Set the Origination URI for our new SIP Trunk. The value should look like the line below.


Where icp_ip_address is the ICP IP address and voice_gateway_port the Voice Gateway port. By default the port is 5060.

The last step is to associate our free number with the SIP Trunk. Click on the Numbers sub menu and add the phone number from the beginning of this step.

You're now ready to test things out!

Sample output

Once the Twilio configuration has been completed try calling the phone number. You'll be greeted with the start of your Watson Assistant dialog. Try a few of the questions below to hear back the answers.

  • What are the hours of operation?
  • What's your location?
  • Can I speak to an advisor?
  • I'd like to make an appointment


Learn more

  • Artificial Intelligence Code Patterns: Enjoyed this Code Pattern? Check out our other AI Code Patterns.
  • AI and Data Code Pattern Playlist: Bookmark our playlist with all of our Code Pattern videos
  • With Watson: Want to take your Watson app to the next level? Looking to utilize Watson Brand assets? Join the With Watson program to leverage exclusive brand, marketing, and tech resources to amplify and accelerate your Watson embedded commercial solution.


This code pattern is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.

Apache Software License (ASL) FAQ

You can’t perform that action at this time.