Connect Twilio wtih Google Apps Script

99封情书 提交于 2019-12-13 00:13:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!