🎤 Creating your first Voice Task

In this tutorial we will get you up and running with Studio by creating a simple Voice Task.

TIP

Before you can create a task, please make sure you meet the following requirements:

  1. You have a Studio account with admin or read-write access.
  2. You have at least one phone number mapped to your account. If you don't have any phone numbers, please contact your service provider.

When you first login you will be presented with the main Portal screen where you can access all applications in your account.

  1. Click the Studio icon.
  1. The Voice Taks page contains all Voice Tasks in your account. If this is a new account you will have no tasks at this point, so let's create one.

Creating your first Voice Task

  1. Navigate to Task in the top menu and select the Voice Tasks + icon.
  2. Studio will ask how you would like to create the Task. Select the Blank Canvas option and click Next.
  3. Provide a Task name.
  4. Create some tags. Tags allow you to search and filter your tasks and are good way of keeping organized. e.g. for a test task use the tag 'test'.
  5. Select the Language. Depending on your geographic region and service provider agreement, multiple languages may be shown under Language.
  6. Choose the TTS (Text To Speech) Voice.
  7. Select whether your task should use Answer Machine Detection (AMD). This is an advanced feature relevant for outbound calls. Leave the toggle set to disabled.
  8. Choose whether you would like to enable Operator Transfer. This is only relevant for outbound calls so leave the toggle set to disabled.
  9. Select whether you would like to use Node logging. This is another advanced features so leave it set to disabled.
  10. Select Save.

Creating a Callflow

We've created a new task but at the moment it doesn't do very much. To give our task some functionality we will create a simple call flow. A call flow is everything a caller hears when they phone into your service.

  1. The canvas view is the graphical view where you will spend most of your time in Studio building call flows. Your call flow currently has a Start and a Hang up node. Each node in Studio serves a specific function. You create a call flow by linking different node types.

We want to play a welcome message as part of our call flow. This is accomplished by using the Play Prompt node.

  1. Let's add a new Play Prompt node by navigating to the side menu and under the Prompt section, select the Play Prompt node and drag it between the Start and Hangup nodes. You will see an overlay to indicate the possible drop locations for the Play Prompt node.
  2. Once you have dropped the Play Prompt node you will need to define it. Under the Node tab, Provide a node name.
  3. Select the Prompts tab and under the Prompt menu, select ==NEW PROMPT==.
  4. Name your prompt welcome_prompt.
  5. Keep the default values for Language and Voice.
  6. Under the TTS block, enter the welcome message that you want to play. For example - Welcome to Inference.

TIP

TTS Speed
To control the speed at which words are spoken in TTS you can add a comma , at any point in the string you are reading to add a 0.33 second delay. You can also add a period . at any point in the string to add a 0.66 second delay.

  1. Select Add and then Save. You will see that the new Welcome_prompt node has been added to your call flow.

Assigning a Phone Number

You are almost ready to test your first Studio Voice Task. Before we test the tast, we need to assign a phone number to it.

  1. To map a phone number head back to the Voice Tasks page from the top menu.
  2. Select the Actions button and select Map Phone Number.
  3. You will see a list of phone numbers available in a pop-up window. Select one or more service numbers and click the Map selected Phone Number(s) button.
  4. Your task is now ready and you can test it by calling the phone number you just mapped. You should hear the welcome prompt and then the call will hang up.

Congratulations!

You have successfully created your first working voice task. 💯

💬 An Intro to Messaging in Studio

This tutorial will build on the Getting Started with Voice Tasks tutorial and will demonstrate how to create a Messaging Task that a user can text a message to and receive a message back via the Integration node. Please make sure you have completed Getting Started with Voice Tasks before beginning this tutorial.

In this tutorial we are going to connect to the Quote Of the Day API which will allow us to send and SMS and receive a SMS back with a quote of the day! To achieve this we will be introducing the Integration Node. The Integration node allows communication with any external web service API and is one of the most powerful features in Inference Studio.

Creating your first Messaging Task

Let's create your first Messaging Task by navigating to the Task in the top menu and selecting the Messaging Tasks + icon.

  1. Studio will ask how you would like to create the Task. Select the Blank Canvas option and click Next.
  2. In Task Name let's call it Quote of the day.
  3. Let's also include the tag 'test'.
  4. Leave the Conversation Session Timeout to the default 60 seconds.
  5. Select Save to finish creating the task.

Creating the Callflow

  1. From the Call flow canvas, in the side menu under Background Processing select & drag the Integration node onto the canvas between the Start node and Reply SMS node. An overlay will indicate where you can drop the node.
  2. Name the Integration node quote_of_the_day.
  3. Select the Settings tab. This is where we will provide information for our Quote Of the Day API.

Using the Integration Node

  1. Enter the full URL of the Restful API that you are accessing by selecting the Edit button.

  2. You will be taken to the Expression Builder.

  3. Select the Text button and enter the URL 'http://quotes.rest/qod.json'

  4. Select Apply

  5. You will see that the URL has been added.

  6. We don't need any Authentications for our Quote Of the Day API. So just leave the Auth Method, SSL Certificate and SSL Key fields blank.

  7. Select the GET Http Method.

  8. We also don't require to pass in any headers for this API so leave this section blank.

  9. From the Parameters section select the Preview Test XML button. If your preview is successful, the API you are calling will return a collection of data.

  10. To select a specific Parameter simply click the parameter inside the preview XML document. Studio will automatically extract the XPath for that parameter. Select the quote XPath.

  11. The Xpath can then be assigned to a == NEW VARIABLE == from the Assigned to Variable dropdown menu. Let's assign the quote XPath to a new variable called quote.

  12. Select the Add Return Value button to complete the variable assignment.

  13. Repeat the Steps 10 to 12, this time for the <author>XPath. And assign it to a new variable called author. You should now have a variable called quote which contains the quote data and a variable called author which contains the author data.

  14. Leave the Fetch Timout and Music on hold sections as blank.

  15. Select Save to finish building your integration node. You will be taken back to the Call Flow Canvas where we can see our get_quote Integration has been added.

Using the Reply SMS node

  1. On the Reply SMS node select the options icon and click Edit.
  2. Leave the name set to Reply SMS and select the Settings tab.
  3. From the Settings tab we can now provide the content for the SMS. Here we will want to provide the Quote Of the Day text and Author that we are obtaining through our newly made integration node. As you will recall, we assigned this information to two variables (quote & author). To insert a variable inside the content box type the double curly brace icon {{ and select the quote variable from the dropdown menu that appears.
  4. Now lets type in a hyphen (-) followed by the double curly brace {{ and select the author variable. Your SMS content should look as below. Select Save.

Assigning a Phone Number

  1. From the Messaging Tasks page, select the Actions menu for the task we just created and select Map Phone Number.
  2. From the Map Phone Number page, select the number(s) you would like to assign and select the Map Selected Phone Number(s) button.

Congratulations!

Now all we need to do is send a message to service number you assigned to our SMS Task and you should receive an SMS back with the quote of the day and the author. 👍

📱 Building your first Auto Attendant

This tutorial will build on the previous sections and demonstrate how to accept DTMF or speech input from a caller and direct them to different destinations based on their input using the Menu Node. Please make sure you have completed the Creating your first Voice Task tutorial before continuing.

Editing the call flow

  1. Login to Inference Studio and navigate to the Voice Tasks page.
  2. Click on the voice task that we created in the first tutorial, select Actions and Edit Task.
  3. From the side menu under the User Input section, select the Menu node.
  4. Drag the Menu node onto the callflow canvas below the Play Prompt node. An overlay will display the available drop points.

Using the Menu Node

For this tutorial we will be asking the caller to press "1" if they would like to speak with the sales team, press "2" if they would like to speak with the support team and press "3" if they want the address and contact details of the store.

  1. Inside the Menu Node settings, under the Node tab, enter "1" under the DTMF column and "Sales" under the Grammar field.
  2. In the Node column, leave the == NEW NODE == selection and enter a name for the new node. We will call our node sales_node.
  3. Click on the + icon to add a new row to the Subnodes entry.
  4. Enter "2" under the DTMF column and "Support" under the Grammar field.
  5. In the Node column, leave the == NEW NODE == selection and enter a name for the new node. We will call our node support_node.
  6. Click the + icon once more time to add a third row to the menu node.
  7. Enter "3" under the DTMF column and "Address" under the Grammar field.
  8. In the Node column, leave the == NEW NODE == selection and enter a name for the new node. We will call our node address_node.

TIP

What this is all basically means is that if the caller enters "1" or says the word "Sales" they will be directed to the node by the name "sales_node". If they enter "2" or say the word "Support", they will be directed to "support_node" and if the enter "3" or say the word "Address" they will be directed to "address_node".

  1. Next, click on the Prompt tab. This tab allows you to configure the initial prompt that you want to play. In the Select Prompt drop down list, select == NEW PROMPT==.
  2. You will be presented with the "Add Task Prompt" interface. Enter a name for the prompt. We will call our prompt - get_user_input. Leave the default values for Language and Voice columns. In the TTS column we will enter the following text for our prompt - Please press 1 or say "sales" for sales inquiries or press 2 or say "support" for support. If you want the address and contact details please press 3 or say "Address". Click on the "Add" button to add the prompt. You will be returned to the "Edit Node" interface. Click on the "Add Prompt" button to add this prompt as the main prompt for the menu node.
  3. Click on the Fallback Prompt tab. The Fallback Prompt is played in the event a caller does not provide input or is not understood. With a Fallback Prompt we can provide context sensitive help to the caller. In this tutorial we will use the same prompt as the Main Prompt so we can give the caller multiple attempts to enter a relevant selection. In the "Select Prompt" dropdown list, select the prompt that we defined earlier, get_user_input and select Add.
  4. The "No Input Prompt" and "No Match Prompt" tabs provide additional functions to define prompts that will be played if Studio exclusively detects no input from the user or if there is no match detected. We will ignore these tabs for now as the Fallback Prompt is more than enough for this case.
  5. Select the Event Handlers tab. Event Handlers are used when there is still no match or no input detected after multiple attempts from the caller. In the No Match Event Handler drop down menu, select "==NEW EVENT HANDLER==" and give it a unique name. We will call ours - no_match. Leave the No Match Count to the default value of 2. This value tells Studio after how many attempts should it trigger the event handler. Repeat the same steps for the No Input Event Handler and define a new event handler. We will call ours - no_input. Leave the default value of 2 for the No Input Count field.
  6. The Settings tab offers some advanced configuration so just ignore it for this tutorial.
  7. Click Save.

You will now see three additional nodes on your call flow canvas - sales_node, support_node, address_node. By default, the Menu Node creates basic Play Prompt nodes for each of the three options we defined. Seeing as we want to use these nodes to actually transfer callers rather than play a prompt we will need to change their node type. 16. On the sales_node, from the action dropdown select Edit.

  1. Click the Node Type drop down and select the Transfer node icon. This will change the node type from the default Play Prompt to a Transfer node.
  1. Next we need to enter the phone number for the sales department so Studio can transfer the call to them. Click the "Edit" button next to the Phone Number field.
  1. You will be presented with the "Expression Builder". Expression builder is Studio's interface to perform complex operations on variables. We won't get into the details of "Expression Builder" at this stage. In order to enter a standard number, click on the "Text" button and enter the phone number that you want to transfer the call and then click on the "Create Sub Expression" button. Click the "OK" button and you will be taken back to the "Edit Node" interface. Click on the "Save" button to save the node.
  1. Repeat the above step for the support_node. You will preferably choose a different transfer number. This will transfer the caller to a support number when they press 2 or say "Support".
  2. Finally, We need to edit the address_node to play an appropriate prompt when the caller presses 3 or says "Address". In this case the default Play Prompt node is perfect so we just need to define the actual prompt itself. Click on the node actions icon and select Edit.
  1. Click the Prompts tab and select "==NEW PROMPT==" from the drop down list for the Prompt field.
  1. You will be presented with the Add Task Prompt interface. Give the prompt an appropriate name. We will call our prompt - address_details. Add the message that you want to play in the TTS column. We will add the following text as an example - "Our address is 3500 Deer Creek Road. Palo Alto, CA 94304". Click Add then finally, Save.

Congratulations!

You have successfully built your first working Auto Attendant! 💯

📢 Creating and Running your first Campaign

This tutorial will build on knowledge from the Building your first Auto Attendant tutorial. If you have not yet completed that tutorial we suggest you do before continuing.

Let's Begin

Thanks to your excellent Auto Attendant, the Sales Team have been receiving a lot of customer calls about the new product launch.

The Sales Team now have a list of phone numbers for all the customers they have spoken to and want a way to contact them all, to offer a 10% discount as appreciation for their interest and loyalty.

This is an excellent use-case for a List-Based Campaign. A List-Based campaign is used to execute outbound calls based on a supplied list of recipients. This campaign type is configured to execute automatically, based on a specified schedule.

We are almost ready to make our first campaign, but first, we will need to add a new Voice Task to use in our campaign. In this instance we are just going to make a very simple task which will play a prompt to the customer thanking them for their recent interest and offering them a discount coupon code.

Creating a New Voice Task

We will be creating a new Voice Task in the exact same way as the Creating your first Voice Task tutorial.

  1. Name the task Discount Task.
  2. For the call flow we simply want to add new Play Prompt node with the TTS "You recently called the sales team at Tyrell Corporation regarding our new product line. As an appreciation for your interest we would like to offer you a 10% discount. To redeem your discount please phone our Sales Steam and quote the coupon code, BR1982."

Mapping a Phone Number

  1. From the Voice Tasks, select the Actions menu for the Discount Task and choose Map Phone Number. Assign a phone number to your task.

Creating the Campaign

  1. Navigate to Campaign in the top menu.
  2. Select the List-Based Campaigns + icon.
  3. Provide a Campaign Name. We have called ours 'Outbound Sales Call'.
  4. Select the task you would like the campaign to use from the dropdown menu. We have selected the new 'Welcome Message' task we just created.
  5. You can skip the Parameters section as we won't be passing in any parameters to our task.
  6. Leave the Campaign Caller ID and Dial Timeout (seconds) as the default.
  7. For Maximum of Threads, select 1. from the dropdown. This is the maximum number of calls that can be made concurrently. You will need to select at least 1 thread to perform an outbound call.
  8. Leave Repeat Call Frequency (Days) and Number of Redials set to the default. For the sake of this tutorial we only want to run the outbound call once.
  9. Leave the Campaign Schedule empty for now as well.
  10. Select Add.
  11. You will then be taken to the List Campaigns page where you will see the new campaign has been added.

Adding Phone Numbers

Now that we have our campaign set up we need to upload the list of customer phone numbers from the Sales Team.

  1. From the List Campaigns page, find the Outbound Sales Call campaign we just created.
  2. From the Actions dropdown menu, select Upload Data. This is where you can add your list of numbers for the campaign to dial.
  3. Select Download template to add data. This will download a .csv file to your system.
  1. Open the .csv file in any text editor and under the 'phone_number' line of text add your list of phone numbers directly underneath. One phone number per line. For this tutorial we will just add our own phone number and then Save the file.
  1. From the Upload Data Section, select the Choose File button and select the .csv file we just updated.
  2. Select Upload.
  3. A dialogue will appear to let you know the file was uploaded successfully.

Running the Campaign

  1. Navigate back to the List Campaigns page.
  2. Select the Actions menu for your campaign and choose Start Campaign.
  3. Your campaign will now run and dial the phone number(s) you provided in the .csv file.

If everything went as planned (and you uploaded your own telephone number to the .csv file), you should receive a call from the campaign and hear the prompt we assigned to our task.

Congratulations!

You have successfully completed your first outbound call campaign, with list-based data. 💯

📮 Using the Studio API with Postman

Using the Web Configurator

  1. Navigate to Settings in the top menu and select the Web Configurator heading.
  1. Under the Configurable? table heading, select Yes, on the task you wish to make accessible with Studio APIs.
  1. Take note of the Script Id value as we will use it later in the tutorial, then click the Select button.
  2. On the Prompts card, select View Details.
  1. Under the Configurable? table heading, select Yes, on the prompt you wish to change with Studio APIs.

API Documentation & Postman

  1. Navigate to Settings in the top menu and select the API Documentation heading.
  1. On the Step 1 card, select Auth. You will be taken to the Auth page where all authenication information is available. This is the information we will use in Postman.
  1. Download the Postman App https://www.getpostman.com/
  1. Using the Postman interface, navigate to the GET dropdown list and change it to POST.
  2. Fill in the URL field at the top with the API URL that is provided on the Studio Auth page.
  3. Navigate to the Authorization tab and select Digest Auth from the Type dropdown list.
  4. Fill in the Username field using the Username details from the Studio Auth page.
  5. Fill in the Realm field using the phrase "Please enter your email and secret_key."
  6. Fill in the Password field using the provided Password in the Studio API Documentation.
  7. The Nonce field can accept any value. Go ahead and add anything you feel like.
  8. Fill in the Algorithm field using the value MD5.
  9. Fill in the qop field using the value auth.
  10. For the Nonce Count field, add the value 1.
  11. For the Client Nonce you can enter any value e.g. 12345, as it is out of the scope of this tutorial.
  1. Select the Body tab at the bottom.
  2. Under the key heading, add apikey and under the value heading add the apikey value from the Studio API Documentation.
  3. Click the blue Send button, next to the URL field in Postman.
  1. In the response box, a token will be listed. Please make a record of this token as it will be used for the rest of this tutorial. Please note that this token only lasts for 20 minutes. After that time you will need to create a new one by selecting Send again.
  1. Navigate to back to the Main API Documentation page, by selecting Api Home in Studio.
  2. On the Step 2 card select prompt. This page provides all the API details required for Prompts. This is the information we will use in Postman to update our studio Prompt.
  1. Using the Postman interface, in the tab bar, select the + icon to create a new tab.
  2. Navigate to the GET dropdown list and change it to POST.
  3. Fill in the URL field with the API URL provided in the Studio API Documentation.
  4. Navigate to the Body tab.
  1. Under the Key heading, click in the text field and type token. In the Value field heading add the token we generated in step 18.
  2. Add another key, this time called script_id. In the value field add the value of the Script Id that we noted down earlier in the tutorial.
  1. Click the blue Send button, next to the URL field in Postman.
  1. In the response box, details of configurable prompts will be listed. Please make a record of the prompt_id and tts_voice_id values as we will need these in the following steps.
  1. In the Studio API Documentation, navigate to the tab list beneath the API HOME / Prompt heading, and select Update TTS. This page lists the details required to change the value of a Studio Prompt. We will use this in Postman.
  1. Using the Postman interface, in the tab bar, select the + icon to create a new tab.
  2. Navigate to the GET dropdown list and change it to POST.
  3. Fill in the URL field with the API URL provided in the Studio API Documentation.
  4. Navigate to the Body tab.
  5. In the Key field add token and in the Value field add the token value we generated in previous steps.
  6. Add another key, again called script_id. Under the value heading in the same row, add the value of the Script Id that we noted down in step 28.
  7. Create another row with key 'prompt_id' and the value of 'prompt_id' gathered in previous steps.
  8. Create another row with the key of tts_voice_id and the value of tts_voice_id gathered in previous steps.
  9. Create one more row with the prompt_tts. Under the value heading in the same row add what you would like the prompt to now say. For example "This is changed via Studio API".
  1. The only thing left to do now is press the blue Send button again! This will POST the updated prompt_tts information to the specified prompt inside Studio.
  1. If you like you can now navigate back to Studio, locate the prompt you specified earlier and see that the TTS value has been updated.

Congratulations! 🎉

You have successfully changed the value of a Studio Prompt using Postman via the Inference Studio API.

💳 Building a PCI-Compliant Payment Application

What is PCI?

The Payment Card Industry Data Security Standard (PCI DSS) is a set of requirements designed to ensure that ALL companies that process, store or transmit credit card information maintain a secure environment.

For this tutorial we will make a basic task that asks a caller for their credit card details, stores these details in specialized forms and then processes the payment via the Payment Process node. If you are not yet familiar with Studio please make sure you have completed Creating your first Voice Task before continuing with this tutorial.

  1. Create a new Voice Task. We will call ours Payment_demo.

  2. For the first node in the callflow, drag in a Play Prompt node from the node pallette.

  3. Provide a Node Name.

  4. Select the Prompts tab and provide the TTS "Welcome to the PCI compliant payment system".

  5. Select Add and Save.

Securely Capturing Credit Card information

  1. Add a Form Node below the previous Play Prompt node.
  2. Under the node tab add a Node Name. We will call it capture_credit_card.
  3. Under the Form Type dropdown, select Payment - Credit Card Number. This is a specific form type used for storing credit card numbers.
  4. Select the Prompt tab and provide the desired prompt. We will add the TTS "Please enter your credit card details".
  1. Add a Fallback Prompt and Event Handlers. Select Save to finish the Capture_Credit_Card form node.
  2. Add another Form Node, this one will be used to store the credit card expiry.
  3. Repeat steps 4 to 9. For the Form Type, select Payment - Credit Card Expiry. This is a specific form type used for storing credit card expiry details.
  4. From the Prompt tab create a new prompt, making sure to give specific instructions to the caller to input their expiry as a 4 digit number.
  1. Provide a Fallback Prompt and Event Handlers.
  2. Add a final Form Node. We will call this one Capture_Card_CVC.
  3. Repeat steps 4 to 9 again. For the Form Type, select Payment - Credit Card CVC. This is a specific form type used for storing credit card CVC details.
  4. From the Prompt tab create a new prompt. We will provide the TTS "Please enter your cards CVC number".
  1. Provide a Fallback Prompt and Event Handlers.
  2. Finally, add we are going to add a Payment Process Node.

Payment Process Node

Before you can use the Payment Process node you will need to have a merchant account. At present time Studio supports the merchant accounts: Fat Zebra, Merchant Warrior and eWay.

  1. First you will need to set up a Payment Gateway Profile in Studio.
  2. From Global in the top menu select Payment Gateway Profiles + button.
  3. Select your merchant and fill in the necessary fields. Select Add.
  1. Now that you have set up your Payment Gateway Profile we can add the Payment Process Node to the call flow beneath the previous Form Nodes.
  2. From the Node tab provide a node name. We will call ours Payment_Process.
  3. Select the Payment Detail tab.
  4. Select your Payment Gateway you just created.
  5. Select the Process Payment Type. This may have one or more options depending on your specific merchant.
  6. Select the optional Customer Name variable.
  7. Select the Amount variable. This is a required field.
  1. Select the Response tab. This is not required but allows some greater functionality if you would like to send back additional information to the caller once a payment has been processed.
  2. For fields in the Response tab, you can select pre-existing variables or create new variable to store the various responses.
  1. Select the Settings tab. Here you can provide some additional control to the node by modifying the Fetch Timeout and including some on-hold Music. We will leave the default settings.
  1. Your completed call flow should now look like the screenshot below.

Congratulations!

You have successfully completed a PCI Compliant Payment Task!

🤖 Building a natural language Auto Attendant (with Cloud Speech-to-Text and Tone Analyzer)

Studio 6.0
You will need to be running Studio 6.0 or higher in order to complete this tutorial.

Now that you've had some experience building tasks with Studio, let's see the power of the Studio Task Library by using a prebuilt task and modifying it to our needs.

For this tutorial we are going to start with the Natural Langage Call Steer task (from the Task Library) and add some further functionality by adding on the Tone Analyzer node. The end result will be an Autoattendant that can direct caller's based on their natural language reponses as well as transfer angry callers directly to the customer retention department.

Let's dive in!

Creating a New Task (from the Task Library)

  1. Create a new voice task but instead of selecting a Blank Canvas, this time we will select Task Library. Click Next.
  1. From the Task Library find and select the Natural Language Call task. You can also use the search box in the top right hand side to help find it by typing in "natural". Click Next.
  1. Now provide the Task Details as you have with previous tasks. We will call ours Smart Attendant and leave all other fields as default. Click Save.

TIP

From here Studio will build the entire callflow for you and present you with the canvas view once completed. This is the power of the Task Library.

  1. From the canvas view you can see the completed callflow. Take a few moments to click through the nodes to see how the task works if you like. If you click the Comment node at the top of the canvas it will provide a text description on what this task currently does.

TIP

TL;DR the task is designed to direct and transfer a caller to one of three main areas based on their natural langage reponses and a keyword match (Sales, Technical_Support or Billing). If no match is found to any of these departments it will transfer them to an Everything Else phone number instead.

Providing transfer phone numbers

Currently, each of the four Transfer nodes at the bottom of the canvas (Transfer 1, Transfer 2, Transfer 3, Transfer 4) transfers to a phone number variable. Because the Task Library doesn't know which numbers we want to transfer to though, at the moment the variables are empty. Let's update those variables now.

  1. From Task in the top menu, select Task Level > Variables
  1. You will see the variables in our new task have already been made for us.
  1. Select the Actions button and Edit for each of our departments. Be sure to provide a real transfer phone number though! Click Save.


Once completed you will now have a functioning natural language call steering task. How easy was that! 👍

But wait, there's more!

So far our autoattendant is pretty darn smart, redirecting callers with natural language but what about our angry callers? Let's go one step further and add in a Tone Analyzer node to provide some additional functionality to our task.

We want to actually detect our caller's emotion with their responses and if the system detects anger, we will bypass the typical callflow and transfer them directly to the customer retention department.

Adding extra functionality with the Tone Analyzer node

TIP

Please note that the Tone Analyzer node detects tone by analyzing transcribed text, not audio.

  1. Let's head back to our canvas. From the node palette, under the Web Service category, drag & drop the Tone Analyzer node onto the canvas just under the Store Utterance node.


  1. Provide a Node Name. We will call ours detect_anger


  1. From the Text Detail tab we need to select the variable that we want to analyze for any anger. Select the CaptureIntent variable that is created in the Cloud Text-to-Speech node above. This is the caller's whole audio response, transcribed into text format which the Tone Analyzer can then analyze.
4. From the Results tab, we then need to save the analysis in an array variable. This will then let us run some logic based on the information in the array. Which in this case will be to transfer the caller if they were angry. But for now let's just select a new array and call it emotion_array. Click Save.
  1. Your canvas should now look like this.

Deciding what to do with angry callers

Now that we have the functionality set up to detect the emotions of our callers, let's add a bit of logic inside a Decision node to transfer those callers directly to our customer retention department (and skip all the other options in the callflow).

  1. To do this, from the node palette, drag & drop a Decision node directly under our Tone Analyzer node.
  1. Provide a Node Name. We will call ours redirect_angry.
  1. From the Decision tab in the Conditions section, select the Edit button. This is where we will use the Expression Builder to provide some actual decision logic.
  1. Inside the expression builder we first need to search our emotion_array for the presence of anger. You can do this for a range of different emotions but in this case anger is most useful to our business.
  2. Select the Others button.
  3. From the Select Function dropdown, select Get Element From Array.
  4. From the Array Variable List, select our emotion_array.
  5. Under the Select Index or Key Type dropdown, select Text Input and fill in the value 'anger'. This is bascially saying search the emotion_array for any reference to anger.
  6. Click Create Sub Expression. It should look like this.
  1. Finally, we want to also add a bit of logic to not just detect any anger at all, but only those that the Tony Analyzer is quite confident are indeed, actually angry. To do this, we can say let's only include caller's that you're at least 50% confident are angry.
  2. Select the Logical Operators button.
  3. From Select Function, click Compare.
  4. From Select Value type, choose the Sub Expression we just made. Simply called Expression 1.
  5. Under operator, select the greater-than symbol.
  6. Under Select Value Type, choose number and provide the value 0.5 (50%). It should look like this.
  1. Click Apply.
  2. Back in the Decision node, in the Node section, select New Node and call it customer_retention. So now we have it set up that if the Tone Analyzer detects anger with a confidence score greater than 50%.
  3. In the Otherwise Goto Node section, select the Determine Intent node. This is the regular Keyword Match node so if anger is not detected, the caller will go down the typical callflow and transferred to the appropriate department.
  4. Click Save.

Finishing Up

Now that we have a way to detect anger and then redirect a caller out of the normal callflow, let's simply fill in our Prompt Node then do the actual transfer.

  1. Click on the elipses icon on the right hand side of the customer-rention node. Select edit.
  1. From the Prompts tab click Prompt > New Prompt and provide a prompt name and the TTS text. We called ours 'sorry_angry' and have added "We are sorry for the inconvenience. Transferring you directly to a representative now." Click Save.
  1. Click Save.
  1. From the node palette, under Transfer, drag & drop the Bridge Transfer node onto the canvas beneath the customer_retention prompt we just made.
  1. Then in the Phone Number section, select the Edit button > String Operations > Text Input and the phone number you would like to use. Note: You could also use a variable instead of a string and edit the phone number variable in the same way we did for the other transfer nodes. Click Apply.
  1. Under the Event Handler tab, select an event handler. And finally, click Save.
  1. The final callflow should look like this.
  1. Now you can test your new autoattendant by clicking the test dialer icon in the top right hand side. You can practice by asking for specific departments are even try getting angry or swearing to get the customer_rention transfer to trigger. Happy cussing!