问题
I followed this tutorial from the GAS team.
Adding voice and SMS to Google Apps using Twilio and Apps Script
However, when I modify the TwiML as per the Twilio Docs to add <Redirect> upon timeout, I get an "Application Error".
<Response>
<Gather action="https://script.google.com/macros/s/SCRIPT_ID/exec" numDigits="1" timeout="10">
<Say>Welcome to Yard Stars</Say>
<Say>To schedule a Sprinkler Service visit, press 1.</Say>
<Say>To discuss a new Sprinkler System, press 2.</Say>
<Say>To speak with someone in accounting, press 3.</Say>
</Gather>
<Say>Sorry, I didn't get your response.</Say>
<Redirect method="GET">https://script.google.com/macros/s/SCRIPT_ID/exec</Redirect>
</Response>
One thing that I noticed is that GAS is sending back "Transfer-Encoding Chunked" which Twilio does not support.
However it appears to only effect the Redirect Call.
Any idea of a workaround how I can make a Redirect call to an Apps Script?
回答1:
I answered myself....The issue with this turned out to be that Twilio does not support "chunked" Requests. The error was being caused by Twilio truncating my Request (and thus thinking the XML was not valid due to the perception of missing End Tags) I contacted Twilio support via their support pages and they were able to give me a workaround (they pointed my application to a different proxy server).
来源:https://stackoverflow.com/questions/15438334/connect-twilio-wtih-google-apps-script