如何使用twilio连接两个匿名来电者

我目前正在使用节点js twilio模块在我正在为客户端工作的项目中的function。 基本上服务器将启动一个调用使用twilio api来呼叫某个人A将他连接到另一个人B.我是twilio的新手,所以我仍然是一个noob,但这是我迄今为止所写的代码。 请我需要你们如何实现这一点input。 干杯

var client = require('twilio')(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN); exports.makeCall = function(callDetails, cb) { client.makeCall({ to:'+16515556677', // Any number Twilio can call from: TWILIO_CALLER_ID, url: 'https://demo.twilio.com/welcome/voice' // A URL that produces an XML document (TwiML) which contains instructions for the call }, function(err, responseData) { //executed when the call has been initiated. console.log(responseData.from); // outputs "+14506667788" var resp = new client.TwimlResponse(); resp.say('Welcome to Acme Customer Service!') .gather({ action:'http://www.example.com/callFinished.php', finishOnKey:'*' }, function() { this.say('Press 1 for customer service') .say('Press 2 for British customer service', { language:'en-gb' }); }); }); }; 

Twilio开发者在这里传道。

你在这方面的一部分,但你不想在你的调用client.makeCall的callback中创build一个TwiML响应。 responseData是Twilio系统中的呼叫表示。

你需要做的是提供一个URL到makeCall函数,该函数承载一些TwiML,将呼叫连接到另一个电话号码。 目前,您已经有了演示url,因此您需要将其指向您拥有的url。

关于如何在Twilio网站上完成所有这些内容,您可能会发现这些内容有帮助。 你可以在这里find教程 ,给它一个去,让我知道如果有帮助。