Telephony Gateway

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. In the future, you will also be able to transfer an existing telephone number.

For a list of supported languages, see the Telephony column on the languages page.

For telephony pricing and quota information, see the Pricing and Quotas and Limits pages.

Set up your GCP project and authentication

Create an agent

Import the example intents and entities

Enable beta features

You may need to enable the beta API:

  1. Go to the Dialogflow console.
  2. Select an agent.
  3. Click the gear icon settings next to the agent name.
  4. Scroll down while on the General tab and ensure that BETA FEATURES is enabled.
  5. If you have made changes, click SAVE.

Set up a telephony gateway

To set up your gateway, follow these steps:

  1. Select a provider:
    1. Go to the Dialogflow console.
    2. Select your agent.
    3. Click Integrations.
    4. Click Dialogflow Phone Gateway.
  2. Configure Phone Gateway:
    1. Select the language.
    2. Select the country code for the telephone number.
    3. Optional. Select preferred area codes.
    4. Click Next.
  3. Select a number:
    1. Choose a telephone number from the list.
    2. Click Create.
  4. Completion:
    1. The gateway is now active.
    2. Optionally change the environment.
    3. Save the displayed telephone number and close the dialog window. You can click the Dialogflow Phone Gateway integrations button again to retrieve this information.

Call the telephone number

You can now call the number and follow the simple voice prompts. The interactions are defined in your agent.

Examine the intents

Now that you have a working telephony agent, let's look at the intents you imported. This will help you understand how to build your own telephony agents.

Welcome the caller

When you called the number, the agent greeted you and provided a list of options. Follow these steps to see how this was configured:

  1. Go to the Dialogflow console.
  2. Select your agent.
  3. Click Intents.
  4. Click Default Welcome Intent.
  5. Scroll down to the Events section. Notice that both Welcome (WELCOME) and Telephony Welcome (TELEPHONY_WELCOME) events are present, which means that all types of welcome events will trigger this intent. As an alternative, you could create separate intents, each dedicated to a specific welcome event.
  6. Scroll down to the Responses section and click the TELEPHONY tab.
  7. Notice that the Synthesize speech response contains the welcome message you heard when calling the number.

Response to test command

After you responded with "test", the agent presented a new list of options. Follow these steps to see how this was configured:

  1. Click Intents.
  2. Click Test Telephony Intent.
  3. Scroll down to the Responses section and click the TELEPHONY tab.
  4. Note that the Synthesize speech response contains the response you heard after you said "test".

Setting context

After saying "test", there are two possible commands you can make: "transfer" or "terminate". This is not a limitation of telephony agents; it is just how this intent is defined. The intents associated with these commands are provided with context. Follow these steps to see how this was configured:

  1. Scroll to the Context section at the top.
  2. Notice the TestTelephonyIntent-followup output context.
  3. Click Intents.
  4. Click the expansion button next to Test Telephony Intent.
  5. Click Test Telephony Intent - Terminate
  6. Scroll to the Context section at the top.
  7. Notice the TestTelephonyIntent-followup input context.

Terminate the call

When you responded with "terminate", the agent said "goodbye" and terminated the call. Follow these steps to see how this was configured:

  1. Scroll down to the Training phrases section and note the phrases used to terminate the call.
  2. Scroll down to the Responses section and click the TELEPHONY tab.
  3. Notice that the Synthesize speech response contains "goodbye".
  4. Notice that Set this intent as end of conversation is enabled. If this is enabled, Dialogflow terminates the phone call after playing all other audio prompts.

Telephony rich message responses

The intents for this example use rich messages for telephony responses. These are the types that you can use:

  • Play audio: Plays the supplied audio file.
  • Synthesize speech: Synthesizes the supplied text to audio and plays it. Alternatively, you can enable Use response from the DEFAULT tab as the first response, which will use the default response to synthesize a speech response. 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

Here are the agent settings for voice configuration:

  • Agent Voice Configuration:
    • Voice: Choose a voice generation model.
    • Speaking Rate: Adjusts the voice speaking rate.
    • Pitch: Adjusts the voice pitch.
    • Volume Gain: Adjust the audio volume gain.
    • Audio Effects Profile: Select audio effects profiles you want applied to the synthesized voice. Speech audio is optimized for the devices associated with the selected profiles (for example, headphones, large speaker, phone call). For more information, see Audio Profiles in Text to Speech documentation.

To access agent settings:

  1. Go to the Dialogflow console
  2. Select your agent
  3. Click the gear icon settings next to the agent name
  4. Select the Speech tab

Use the Dialogflow 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:

  1. Type "hello" and press the return key
  2. Change Default Response to TELEPHONY
  3. Click the Play Audio button to hear the agent response
  4. Continue the conversation with the agent
Was this page helpful? Let us know how we did:

Send feedback about...

Dialogflow Enterprise Edition Documentation