1

I'm having an issue with dialogflow, it is sending empty responses to twilio when a new conversation start. Im getting the error Warning - 14103 Invalid Body in the twilio debugger.

  • Im sure the webhook is sending a response to dialogflow but dialogflow is sending an empty response to twilio.
  • The request takes less than one second
  • Dialogflow bot send rigth answers after the third interaction

This is an example of how it looks from whatsapp:

Empty responses Example

This is the error that im getting from twilio, the request sended from the bot has an empty message:

Twilio empty request

this is an example of how im sending the responses from the webhook

// send message via agent or twilio according to operation response time
const sendMessage = (message, time, whatsappNumber, agent) => {
  if (time >= 4500) {
    twilio.sendSimpleMessage(message, whatsappNumber)
    agent.add(message) // dialogflow agents needs to return or Unhandled platform response exeception will be thrown
  } else {
    agent.add(message) 
  }
}
Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • Could you please explain what do you mean by "it is sending empty responses to twilio"? Is Dialogflow bot always sending right answers after the third interaction? And finally, have you tried lowering the threshold in your code (time variable)? Is it possible that that conditional block is preventing the bot to send the messages? – Joaquim Aug 19 '20 at 10:38
  • Hello @Joaquim, this is the error im getting in the twilio debugger [Error - 14103 invalid body] (https://www.twilio.com/docs/api/errors/14103) (i already updated the post and attached a couple of images from twilio). It seem the bot sleep or something like that, for example, when the bot has no interactions for a while, and then im gonna start a new conversation, the bot send empty responses to twilio as shown in the attached link. the bot after almost the third interaction start working normally and that error dont appear again, unless i stop interacting for a while again. – Neisser Villa Aug 19 '20 at 16:55
  • and could you explain why the conditional in your provided code block on the main issue is 'time' dependant? Isn't it possible that the bot gets stuck in the 'else' without executing 'twilio.sendSimplemessage()'? Have you debugged it? – Joaquim Aug 21 '20 at 07:37

0 Answers0