Hi team,
I am trying to get the status of my outgoing twilio calls and update them onto a spreadsheet.
I found this related article but not working in my case
I don't know why but for some reasons Twillio don't send the HTTP request to my app so I can grab the infos i need...
Who can figure out, what's the issue with my code.
function make_call(){
var url = ScriptApp.getService().getUrl()
var payload = {
"From" : twilio_number
,"To" : mynumber
,"Twiml" : '<Response> <Dial>'+string+'</Dial> </Response>'
,"StatusCallback" : url
};
var headers = {
"Authorization" : "Basic " + Utilities.base64Encode(ACCOUNT_SID + ':' + ACCOUNT_TOKEN)
};
var options =
{
"method" : "post",
"payload" : payload,
"headers" : headers
};
var response = UrlFetchApp.fetch(url, options);
}
function doPost(e) {
var callSid = e.parameter("CallSid");
let callStatus = e.parameter("CallStatus");
//Here i access the sheet where I want to put the informations in (CallSid, CallStatus)
SpreadsheetApp.openById("1223Xdwd").getSheetByName("Sheet1").appendRow([callSid,callStatus]);
return ContentService.createTextOutput('')
};