Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Issue with Receiving and Passing Data from Telephony Provider to Playbook

Hi everyone,

I’m facing an issue with receiving and passing data from my telephony provider to the playbook.

Context:
I’ve integrated my bot with AudioCodes and triggered it via an HTTP request to the AudioCodes API. During phone initialization, I pass metadata with information like program_name. AudioCodes then triggers an outbound call to the customer who requested it.

Problem:
I’m unsure how to access this data and allow the bot to use it during the greeting.

Expected Behavior:
The bot should call the user, greet them, introduce itself, and then inform the user that they are receiving the call because they requested information about program_name.

Current Setup:
I’ve created the bot entirely using Playbooks (this is my first time using Dialogflow). I’m not familiar with how to use session parameters. Before attempting to use the metadata passed during call initialization, I tried to at least use the sessionId and force the bot to say it at the beginning of the conversation. I’ve tried various syntaxes from the documentation, such as $session.id and different types of brackets, but none worked.

The only way I managed to make it work was by creating a TOOL and forcing it to pass the sessionId as a query parameter, which it then returned. While I could use this sessionId to make an API call to my server and retrieve the data from the database, I believe there should be a way to achieve this without this extra step.

Another issue with using the TOOL is that I couldn’t trigger it at the beginning of the conversation. The bot only triggers the TOOL when I explicitly ask for it, and only then does it return the sessionId.

Example Use Case (for Testing):
I wanted to test something like this:

  • Greet the user and say the sessionId (e.g., “Hello, this is your session ID: [sessionId]”).

However, this doesn’t work.

Questions:

  1. Can I access parameters like sessionId and metadata directly in Playbooks?

  2. How can I trigger a TOOL before starting the conversation?

  3. If accessing session data in Playbooks is possible, how can I do it?

Any help or guidance would be greatly appreciated!

0 2 109
2 REPLIES 2

Hi @les_dev,

Welcome to the Google Cloud Community!

 I understand you're having issues with accessing session data and metadata within your Dialogflow Playbooks, as well as with triggering your TOOL at the correct time. Here are possible  ways to manage session data and trigger the necessary actions within your Playbooks : 

  1. Access parameters like sessionId and metadata directly in Playbooks - Use a webhook to capture the initial HTTP request from AudioCodes, extract the metadata, and then use the Dialogflow API to set session parameters with that metadata. You can then access these session parameters in the Playbook
  2. Trigger a TOOL before starting the conversation - You can use webhooks to call external APIs at the beginning of the conversation to set session parameters that your bot can later use. 
  3. Accessing session data in Playbooks - Once the data is correctly set as session parameters (using the webhook method), you access it using the syntax in Playbooks.

For more information about playbook best practices, you may read this documentation.

Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.

I’m sorry, but this is not very helpful.

  1. In the documentation, there is no example provided on how to capture HTTP requests from AudioCodes.

  2. I know it’s possible to do it, but there is no information on how to achieve it. After several attempts, I was able to figure it out by entering numerous examples that triggered TOOL at the beginning.

  3. Again, I know it’s technically possible, but none of the $session syntaxes seem to work. Additionally, there is no information in the documentation about the proper syntax or available parameters.