twilio error when called person hangs up
I'm placing a call to a number via Betty's web interface. Call works great.
Then when the called person hangs up, twilio reports an error on https://www.twilio.com/user/account/developer-tools/app-monitor when posting back to status:
http://{IP}:3000/twiml/{IP}/twiml/dial/status (note that the IP and twiml appear twice)
My TwiML is configured with the following URLS:
request URL: http://{IP}:3000/twiml/call
fallback URL: http://{IP}:3000/twiml/call/fallback
It happens when status callback URL is either empty, or when I use http://{IP}:3000/twiml/call/status or http://{IP}:3000/twiml/dial/status
exported HOST is the IP address.
HOST should be http://{IP}, not just {IP}.
Thanks @SamyPesse
After updating HOST to http://{IP} then twilio app monitor reports a 502 error on http://{IP}/twiml/dial/status though.
What is the body of the 502 error ?
body:
<html>
<head>
<title>502 Bad Gateway</title>
</head>
<body>
<h1>Bad Gateway</h1>An upstream server returned an invalid response.
</body>
</html>
I just noticed that the POST from twilio was to the same host, but not on port 3000, like other requests though. Even when I set the full url including the port in the status callback URL. i.e. it went to http://{IP}/twiml/dial/status, instead of http://{IP}:3000/twiml/dial/status
You need to set HOST={IP}:3000
ok, thanks. Will try this later.
Feels like this should be taken care of automatically though, setting a HOST parameter to include http:// and port isn't that standard or particularly intuitive I would say - especially if there's a separate env var for PORT, or at least the documentation gets updated to make this clear.
I might take a look at the code later to see if I can contribute. A good chance to get more familiar with the project, but unfortunately not that much time on my hands.
with the HOST set to http://{IP}:3000 - it responds with 403 with this body:
Limited to team member
Ok that's a bug I already fixed in https://github.com/SamyPesse/betty/pull/17 (not yet tested)