I am trying to run a simple node js script for making a voice call using Twilio API. The problem is that when I type node app.js, nothing happens and it returns to the console. Like even if there is some kind of error, the error object should be printed into the console, right?
const accountSid = PROCESS.ENV.SID;
const authToken = PROCESS.ENV.AUTH;
const client = require('twilio')(accountSid, authToken);
client.calls
.create({
url: 'http://demo.twilio.com/docs/voice.xml',
to: PROCESS.ENV.TO,
from: PROCESS.ENV.FROM
}), function(err, call){
if(err){
console.log(err);
} else {
console.log(call.sid)
}
}