1
我在使用Twilio Node.js库转接呼叫时遇到了一些麻烦。有此库的小文件,并使用“拨号”的唯一例子是电话会议:Twilio Node.js API - 使用“拨号”转接呼叫时遇到问题
.dial({
action:'http://example.com/something.php'
}, function(node) {
node.conference('waitingRoom', {
beep:'false'
});
});
利用这一点,我已经能够使用产生类似XML作为Dial Documentation如下:
.dial('number', {
action: 'http://url'
hangupOnStar: true
}, (err, respData) => {
console.log(err);
console.log(respData);
})
这会导致该呼叫被立即转发到action
网址。
我使用他们的文档,Example 3: Dial to a phone number from Twilio Client
,这会产生以下XML的第三个例子也试过:
<Response>
<Dial hangupOnStar="true" callerId="number">
<Number>number to call</Number>
</Dial>
</Response>
通过下面的代码:
resp.dial({
hangupOnStar: true,
callerId: 'number'
}, (node) => {
node.number('number')
})
这些数字我测试与有效的数字,我也尝试了不同的格式。任何想法如何得到这个工作?任何帮助表示赞赏。