【发布时间】:2020-12-16 11:42:05
【问题描述】:
根据文档here,我创建了以下脚本,但它不起作用。
const accountSid = 'xxxxxxxxxxxxxxx';
const authToken = 'xxxxxxxxxxxxxx';
const client = require('twilio')(accountSid, authToken);
connectNumbers('+1xxxxxxxxxxx','+1xxxxxxxxx');
function connectNumbers(number1, number2) {
[number1, number2].forEach(function(number) {
client.calls.create({
url: 'https://2f3b18f01640.ngrok.io/voice/callConference.xml',
to: number,
from: '+1xxxxxxxxxxx',
})
.then((call) => process.stdout.write(`Called ${number}`));
})
}
Twiml link 生成以下 xml:
<Response>
<Dial>
<Conference>My conference</Conference>
</Dial>
</Response>
谁能告诉我我做错了什么。
【问题讨论】:
-
错误是什么?
-
没有显示错误,但呼叫未连接。这是输出:“呼叫 +18778423210 呼叫 +16174025654”
-
@Alan 在 twilio 调试器中我发现以下消息:尝试从2f3b18f01640.ngrok.io/voice/callConference.xml 检索内容返回 HTTP 状态代码 405。但该 xms 仅有效
-
@Alan 我错过了添加“GET”方法。感谢您的回复。
标签: node.js twilio twilio-programmable-voice