0

我尝试从 twilio 做一个简单的电话,播放按摩并挂断,但无论我输入什么网址,当我拨打电话时,我会收到关于功能错误的语音按摩,这是我的代码:

let twilio = require('twilio');

var accountSid =; // Your Account SID from www.twilio.com/console
var authToken = ;   // Your Auth Token from www.twilio.com/console

var client = new twilio(accountSid, authToken);

const VoiceResponse = require('twilio').twiml.VoiceResponse;


const response = new VoiceResponse();
response.play({
    loop : 1,
},"https://scribie.com/records/7941e240b8884865872ac859e389927b78757fae_orig.mp3?fn=test2.mp3&to=FHtRpSzUlmmaVRWjl7n23mC3Ezm5nYwK");

console.log(response.toString());

client.calls
    .create({
        twiml: response.toString(),
        to: '',
        from: ''
    }).then(call => console.log(call.sid)).catch(e=>console.log(e));
4

1 回答 1

0

Twilio 开发人员布道者在这里。

当我将 Scribie URL 替换为“http://demo.twilio.com/docs/classic.mp3”时,我可以让您的代码正常工作。当我尝试打开您拥有的 Scribie URL 时,它会将我带到此网页,必须登录才能查看。相反,我会尝试将文件上传到Twilio Assets或其他托管服务。

于 2021-03-15T18:10:02.677 回答