Learn how to connect a Dialogflow agent to inbound calls. If you need to connect inbound calls to your Dialogflow agent, please examine the How to Use Dialogflow Connector with Outbound Calls how-to.
Setting up Dialogflow
Recheck that your Dialogflow agent uses API V2. Now 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. The JSON file is required for Voximplant to be authorized before sending audio data to the agent.
Click on the Speech tab in the agent settings to setup Speech synthesis options.
Enable Automatic Text to Speech by clicking on the toggle button, choose MP3 or OGG in the Output Audio Encoding dropdown (IMPORTANT: only MP3 and OGG are currently supported) and one of the available voices - we highly recommend you to use WaveNet-powered voices, since they sound much better than standard ones. Save settings by clicking the Save button in the top right corner.
Setting up Voximplant
In the Voximplant control panel, go to your application and switch to the Dialogflow connector tab. Here, click Add in the center of the screen or Add Dialogflow agent in the upper right corner.
The Add Dialogflow agent dialog will appear, click the Choose a file button or drag'n'drop the JSON file downloaded from GCP console and click the Add button. After the file has been uploaded you will see a newly added agent in the list:
To make calls to the phone network from Voximplant, a real phone number is required, since it will be used as a caller ID. Create an app in the Voximplant control panel and a scenario inside the app, then buy a phone number and attach it to this app. After that, create a Rule that will forward all the calls from the number you bought to the scenario.
If you've chosen the number in the country where no special verification is required (for example, in The United States) then you will be able to make calls straight away, otherwise there will be a notification to upload verification documents required by the authorities in the country. It will take some time until the number becomes active if all the submitted verification documents are correct.
The scenario should look like this:
To launch the scenario, you just have to call the number you purchased a few steps ago.
You can see the connector in action on https://demos05.voximplant.com/dialogflow-connector. This demo is an example of automated pizza order via a phone call. You can also download the Dialogflow agent from this demo using the following link PizzaOrderDelivery.zip.