Skip to content

Instantly share code, notes, and snippets.

@solexious
Created October 20, 2014 21:31
Show Gist options
  • Save solexious/1171e7e292863e45e953 to your computer and use it in GitHub Desktop.
Save solexious/1171e7e292863e45e953 to your computer and use it in GitHub Desktop.
//require the Twilio module and create a REST client
var client = require('twilio')('AC82d14595fc25b83ac0792700a360b8a2', '8d527ac03e9a652d97280d8dbed43e9c');
client.makeCall({
to:'+447733223902', // Any number Twilio can call
from: '+44441782435506', // A number you bought from Twilio and can use for outbound communication
url: 'http://twimlets.com/echo?Twiml=%3CResponse%3E%0A%20%20%20%20%3CSay%3EDialing%20crew%20now%2C%20standby%3C%2FSay%3E%0A%3C%2FResponse%3E&' // A URL that produces an XML document (TwiML) which contains instructions for the call
}, function(err, responseData) {
//executed when the call has been initiated.
console.log(responseData.from); // outputs "+14506667788"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment