Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
58 lines (53 loc) · 1.45 KB
/
Copy pathindex.js
File metadata and controls
58 lines (53 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const Nexmo = require('nexmo');
const privateKey = require('fs').readFileSync('./private.key');
const zoomRoom = '<confNumber>';
const recipientNumber = '<myNumber>';
const nexmo = new Nexmo({
apiKey: '<APIKEY>',
apiSecret: '<APISECRET>',
applicationId: '<APPID>',
privateKey: privateKey
})
exports.handler = (event, context, callback) => {
console.log('Calling phone number', zoomRoom);
nexmo.calls.create({
to: [{
type: 'phone',
number: zoomRoom,
dtmfAnswer: 'pppp2863566849#pppp#'
}],
from: {
type: 'phone',
number: '12345678901'
},
answer_url: ['https://raw.githubusercontent.com/justdroo/aws_button/master/ncco_zoom.json']
}, (err, res) => {
if(err) {
console.error("there is an error");
console.error(err);
}
else {
console.log(res);
console.log('Calling phone number', recipientNumber);
nexmo.calls.create({
to: [{
type: 'phone',
number: recipientNumber
}],
from: {
type: 'phone',
number: '12345678901'
},
answer_url: ['https://raw.githubusercontent.com/justdroo/aws_button/master/ncco_drew.json']
}, (err, res) => {
if(err) {
console.error("there is an error");
console.error(err);
}
else {
console.log(res);
}
});
}
});
};