Would any one have a sample script or method how to setup Twilio Client to make and receive calls directly in a browser with Google apps script as a webapp or the like.
Here is how to initiate a Twilio call from GAS, but I can't seem to figure out how to do Twilio Client.
function makeCall() {
var to = "+1xxxxxxxxxx";
var from = "+1xxxxxxxxxx";
var callsUrl = "https://api.twilio.com/2010-04-01/Accounts/ACxxxxxxxxxxxx/Calls.json";
var payload = {
"To": to,
"From" : from,
"Twiml" : '<Response><Say>Hello this is a Twilio call</Say></Response>',
};
var options = {
"method" : "post",
"payload" : payload
};
options.headers = {
"Authorization" : "Basic " + Utilities.base64Encode("ACxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxx")
};
var res = UrlFetchApp.fetch(callsUrl, options);
Logger.log(res);
}
question from:
https://stackoverflow.com/questions/65875617/set-up-twilio-client-in-a-google-apps-script 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…