How to store customer input with the Speech to text module and route the call based on the input (V2)

In this article we want to show you a use case with two modules which often go hand in hand: the Text to Speech (TTS) module and the Speech to Text module (STT). We will use different modules for TTS and STT although it is also possible to place the TTS into the STT module. For more information, please have a look at this article which explains the STT module in more detail.

Imagine the following scenario: before routing the call to one of your agents, you would like to ask the customer for their call reason. You want to give them the option to either give their answer via voice input or pressing a number on their phone. Depending on their answer, you want to route them to different agents. For that setup you need the following modules and Triggers: 

  1. a Text to Speech module which reads text to the customer (could be replaced by an Audio Player module)
  2. a Speech to Text module which captures the input of the customer
  3. a set of x Triggers (where x depends of the number of agent selections you would like to create)

In our example we want to ask the customer if they want to talk to Sales or Support and lead them to the respective agent. Let's go through that in detail:

1. Text to Speech:

To add a Text to Speech module, head to IVR call-flows > call flows and click on "Add". Choose "Text to Speech" from the drop down menu. Enter the language and gender (or Voice if that's available for your plan) you would like to use in your TTS module and the text you want to read out to the customer.


Note that you have design options like including pauses into you text. For more information, have a look at this article, explaining TTS more detailed.

In the after-flow, insert the Speech to Text module that processes the answer of the customer. Here it's called "call reason customer answer". To create it, either click on the small blue "+" below the field "after-flow". Or add the module from within the call flow view (like you did with TTS before). 

2. Speech to Text

Once you created the STT module, go to the settings tab. It might look familiar to you as its structure is pretty similar to that of an Input Reader.



 Choose your language again and toggle the switch "Numeric" as the customer input is numeric in case they decide to enter their number by pressing the answer on their phone.

Choose "1" for both, min and max length because you expect a single digit answer from the customer.

If you want to know more about the other settings of the STT, please have a look at this article.






In the field "Read timeout" enter the time you want to give the customer for their answer (in seconds). Also, enter the max number the customer can retry to enter their input. Note that you can enter specific audios for no or a wrong input from the customer under the tab "Audios".

Now, enter the variable name you want to store the customer answer on. We called it "callReason". You will need this variable in the Triggers you use in the queue selection to assign the calls to the different agents.

Lastly, lead the call to an after-flow module of your choice. In the screenshot, you see that the call is led directly to the call queue. However, you could also enter another TTS module saying something like "Thanks for your answer. You will be connected to one of our agents shortly".

Now there's only a few steps missing: Using the customer answer to connect the call to either a Sales representative, or someone from Support by building Triggers, adding Tags to the agents and adding them to the queue selections:

3. The Triggers

First, add two Triggers. One, if the customer pressed 1 or said "Sales" and one, if the customer pressed 2 or said "Support". Therefore go to the section Triggers and click on "Add". They look like this:



As shown in the screenshot, we consider both, the Voice input and that of the customer pressing the number on their phone. Therefore, we choose the type "match any condition".

Consider that you will probably have to add more possible answers of the customer if they give their answer via voice input, e.g they might say they want to speak to a "Technical representative" or they might say "two" instead of pressing it on their phone.

If you allow for more complex answers you might consider integrating a Speech recognition tool like Google Dialogflow for instance which you can train to recognize your Business Cases.



4.  Adding tags and groups

Now, you need to define the tags or groups you want to use for the queue selections. For a detailed instruction on how to assign tags and groups to agents, please have a look at this article which explains everything in detail.

Once everything is setup, we can use the Triggers and tags/queues in our queue selections:

5. The queue selections

To configure the queue selections, go to Routing & queueing > Queues and click on the queue you want to use. We'll take the default queue. In the section "Agent selection rule" click on "Add" to enter one selection for sales and one for support:


As the screenshot shows, we used tags for both, support and sales and we entered the Triggers we built above.

Now, whenever a customer presses 1 or says "Sales" in the STT module, they are routed to one of the agents with the tag "Sales" assigned. If they say or press "Support", an agent with the tag "Support" is selected by the babelforce platform to take the call. 









Great, you finished the setup. Have fun playing around with your newly created call flow.

Have more questions? Submit a request