我知道这是一个完整的n00b问题,但我很难过。twilio节点语音输出快速启动失败默默
我已经创建了一个帐户并将节点快速启动代码剪切/粘贴到make_call.js文件中。我已经输入了我的帐户信息和正确的(我的twilio号码)和(我家)的电话号码。
当我通过'节点make_call.js'运行有轻微的暂停,然后shell提示符,没有输出,没有电话。
如果我修改帐户字段,以便他们是错误的,无论是哪一种,我得到相同的结果,因此它似乎代码没有与twilio服务器进行通信?
关于如何弄清楚发生了什么的任何指针?
这是我的代码,从字面上复制/粘贴4个字段的示例更改。
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const authToken = '0bxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
const Twilio = require('twilio');
const client = new Twilio(accountSid, authToken);
client.api.calls
.create({
url: 'http://demo.twilio.com/docs/voice.xml',
to: '+1212xxxxxxx',
from: '+1929xxxxxxx',
})
.then((call) => console.log(call.sid));
不确切地说,这个代码块和我发布的代码块之间有什么不同,不过我仍然尝试过。剪下并粘贴我的acct和电话号码。同样的结果,运行一两秒钟,然后静静地退回到shell。没有电话,没有输出。我很想弄清楚如何在那里粘贴一些代码,看看它在做什么 – jdkullmann