mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Upgrade to Twilio sdk v3 (#411)
This commit is contained in:
parent
da96f9e869
commit
9ea27f94ef
@ -58,20 +58,14 @@ module.exports = function(RED) {
|
|||||||
if ( this.twilioType == "call" ) {
|
if ( this.twilioType == "call" ) {
|
||||||
// Make a call
|
// Make a call
|
||||||
var twimlurl = node.url || msg.payload;
|
var twimlurl = node.url || msg.payload;
|
||||||
node.twilioClient.makeCall( {to: tonum, from: node.fromNumber, url: twimlurl}, function(err, response) {
|
node.twilioClient.calls.create({to: tonum, from: node.fromNumber, url: twimlurl}).catch(function(err) {
|
||||||
if (err) {
|
node.error(err.message,msg);
|
||||||
node.error(err.message,msg);
|
|
||||||
}
|
|
||||||
//console.log(response);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Send SMS
|
// Send SMS
|
||||||
node.twilioClient.sendMessage( {to: tonum, from: node.fromNumber, body: msg.payload}, function(err, response) {
|
node.twilioClient.messages.create({to: tonum, from: node.fromNumber, body: msg.payload}).catch( function(err) {
|
||||||
if (err) {
|
node.error(err.message,msg);
|
||||||
node.error(err.message,msg);
|
|
||||||
}
|
|
||||||
//console.log(response);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version" : "0.0.15",
|
"version" : "0.0.15",
|
||||||
"description" : "A Node-RED node to send SMS messages via the Twilio service.",
|
"description" : "A Node-RED node to send SMS messages via the Twilio service.",
|
||||||
"dependencies" : {
|
"dependencies" : {
|
||||||
"twilio" : "^2.11.1"
|
"twilio" : "^3.11.3"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
"type":"git",
|
"type":"git",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user