The telephony gateway feature provides a telephone interface to your agent. It is used to build conversational IVR (interactive voice response) solutions that integrate with the rest of your call center network. Currently, you can select a telephone number hosted by Google.
Set up a telephony gateway
To set up your gateway, follow these steps:
- Click Integrations in the left menu.
Click Dialogflow Phone Gateway.
Select a language.
Select the country code for the telephone number.
Optionally, enter preferred area codes.
Choose a telephone number from the list.
The gateway is now active. You can also change the environment to alter the version of your agent you'd like to serve.
Make a note of the phone number and close the dialog. This information can always be retrieved from the Dialogflow Phone Gateway integration page.
Call the number
You can now call the number and follow the simple voice prompts, which are defined in the imported example intents.
Examine the intents
Now that you have a working telephony agent and have called it, take a look at the imported intents to get an idea of how to build your own.
Welcome the caller
When the agent is called, it greets the caller and provides a list of options. These are defined in the Default Welcome Intent.
In the Events section of the intent, both Welcome (
WELCOME) and Telephony Welcome (
TELEPHONY_WELCOME) are present. The
TELEPHONY_WELCOME event isn't required, and if the event is left out, the agent will use the
WELCOME event as the default.
In the Responses section of the intent, click on the TELEPHONY tab. The Synthesize speech response contains the welcome message to callers. This is in SSML (Speech Synthesis Markup Language):
<speak>Please press any key or say <break time="0.5s" /> test.</speak>
Respond to test command
When the caller says "test", the agent provides a new list of options. In the Responses section of the Test Telephony Intent intent, click on the TELEPHONY tab to see the SSML response:
Thanks for testing. Would you like to transfer or terminate the call?
Set a context
After saying "test", there are two possible commands the caller can make: "transfer" or "terminate". The intents associated with these commands are provided with context.
In the Contexts section of the Test Telephony Intent, make note of the TestTelephonyIntent-followup output context.
Click Intents in the left menu and then expand Test Telephony Intent in the list. Click on Test Telephony Intent - Terminate.
You should see TestTelephonyIntent-followup as an input context in the Context section of the intent. Using contexts in this way triggers these follow-up intents.
Terminate the call
When the caller responds with "terminate", the agent says "goodbye" and ends the call.
In the Responses section of the Test Telephony Intent - Terminate intent, "Goodbye!" is provided as the response and Set this intent as end of conversation is enabled. When this is enabled, Dialogflow will terminate the call after delivering its responses.
Telephony rich messages
The intents in the sample use rich messages for telephony responses. These are the types you can use:
- Play audio: Plays the supplied audio file.
Synthesize speech: Synthesizes the supplied text to audio and plays it. Alternatively, you can use Use response from the DEFAULT tab as the first response, which will use the default response to synthesize speech.
If you only define default responses, and you do not enable Use response from the DEFAULT tab as the first response, only the text populated in
QueryResult.fulfillment_text(populated with a randomly selected text response), is synthesized to audio.
Transfer call: Transfers the caller to another number.
Agent settings for telephony
To access speech settings, click the gear icon settings next to the agent name and then click on the Speech tab.
- Agent Voice Configuration:
- Voice: Choose a voice generation model.
- Speaking Rate: Adjusts the speed of the voice.
- Pitch: Adjusts the pitch of the voice.
- Volume Gain: Adjusts the volume gain.
- Audio Effects Profile: Select audio effect profiles you want applied to the synthesized voice. Speech audio is optimized for the devices associated with the selected profiles (i.e.. headphones, large speaker, phone call). For more information, see Audio Profiles in Text to Speech.
Use the simulator
When testing or experimenting with a telephony agent, you don't need to make a phone call. You can interact with the agent and receive audio responses via the Dialogflow simulator:
- Type "hello" and press the return key.
- Change Default Response to TELEPHONY.
- Click the Play Audio button to hear the agent response.
- Continue the conversation with the agent.