diff --git a/social/twilio/56-twilio.js b/social/twilio/56-twilio.js index 75d47823..48403ba5 100644 --- a/social/twilio/56-twilio.js +++ b/social/twilio/56-twilio.js @@ -58,20 +58,14 @@ module.exports = function(RED) { if ( this.twilioType == "call" ) { // Make a call var twimlurl = node.url || msg.payload; - node.twilioClient.makeCall( {to: tonum, from: node.fromNumber, url: twimlurl}, function(err, response) { - if (err) { - node.error(err.message,msg); - } - //console.log(response); + node.twilioClient.calls.create({to: tonum, from: node.fromNumber, url: twimlurl}).catch(function(err) { + node.error(err.message,msg); }); } else { // Send SMS - node.twilioClient.sendMessage( {to: tonum, from: node.fromNumber, body: msg.payload}, function(err, response) { - if (err) { - node.error(err.message,msg); - } - //console.log(response); + node.twilioClient.messages.create({to: tonum, from: node.fromNumber, body: msg.payload}).catch( function(err) { + node.error(err.message,msg); }); } } diff --git a/social/twilio/package.json b/social/twilio/package.json index 43b86383..4c0c4e12 100644 --- a/social/twilio/package.json +++ b/social/twilio/package.json @@ -3,7 +3,7 @@ "version" : "0.0.15", "description" : "A Node-RED node to send SMS messages via the Twilio service.", "dependencies" : { - "twilio" : "^2.11.1" + "twilio" : "^3.11.3" }, "repository" : { "type":"git",