GoogleCloudPlatform / dialogflow-integrations

Dialogflow integrations with multiple platforms including KIK, Skype, Spark, Twlio, Twitter and Viber
https://cloud.google.com/dialogflow/
Apache License 2.0
256 stars 503 forks source link

Successful Integration to Twilio But SMS Issues - Help Needed #22

Open mdelucchi opened 4 years ago

mdelucchi commented 4 years ago

Successfully completed a new integration of Dialogflow to Twilio since the current integration will be deprecated in April 2020. We followed all of the steps in the Repository and was able to get an intention to successfully run and send an SMS message from Dialogflow to Twilio and out to a text. The issue is that prior to the new integration Dialogflow allows for more than one response to a training phrase. So if the training phrase was "hi" then you can set up multiple responses that would send one after the other like a conversation vs one big sms response.

It looked like this:

image

Since doing the integration the response is only the last part "Let's get started what can I help you with"

When testing in Dialogflow on the google assistant it works correctly so it is something that is preventing the 3 responses to be sent from DF to Twillio and out to SMS.

Thank you for any help or ideas

tyhu-google commented 4 years ago

mdelucchi@, thanks for bring up the issue. I assume you deploy your server through CloudRun, if so, could you add some logs to https://github.com/GoogleCloudPlatform/dialogflow-integrations/blob/master/twilio/server.js#L50. It only sends the one fulfillment text. You may need to update the server to iterate over QueryResult.fulfillmentMessages fields and call send per each message. The API reference is at: https://googleapis.dev/nodejs/dialogflow/latest/google.cloud.dialogflow.v2beta1.html#.QueryResult.