Rate this page:

How to transfer a call from a Dialogflow bot to an operator

Learn how to easily transfer a call from a Dialogflow bot to an operator.

Use our Dialogflow connector to connect a call running via Voximplant with a Dialogflow bot and control the bot’s behavior. Audio streaming from Voximplant to and from Dialogflow happens in real-time, query results arrive at VoxEngine as soon as they are returned by the agent.

Setting up Dialogflow

Go to https://dialogflow.com/ and create a new agent. Let’s name it "ToOperator", for example, and click Create.

After that, you'll need to set up your entities. Our bot will react to the word "operator" and its synonyms: agent, live person, real person. In the Intents tab, we'll enter the parameter name that will be used in our code, and choose the entity created earlier. Then we’ll add some training phrases so Dialogflow can just find and highlight the needed words and assign correspondences in the returned JSON! The more phrases we add, the better.

Voximplant uses the JSON file to perform authorization before sending audio data to the agent. Create and download the service account JSON file associated with the agent from GCP console (please read the Setting up authentication article for details). "Dialogflow API Client" role should be chosen while creating the service account.

Setting up Voximplant

In the Voximplant control panel, go to your application and switch to the Dialogflow connector tab. Here, upload the JSON file downloaded from GCP console and click the Add button.

Now you have to create a user (an operator) who we make calls. And the user should be online when we call. If we are calling from the web, we can create a second user (a callee). The users can log in here at https://phone.voximplant.com/.

And last but not least thing you have to do here is create a rule, a scenario, buy a number, and bind them all together. The js code sample of how to transfer a call to an operator is as follows:

Usage sample

Usage sample