【问题标题】:Trying to forward calls to mobile using Node.js and Twilio尝试使用 Node.js 和 Twilio 将呼叫转接到移动设备
【发布时间】:2019-10-17 11:45:26
【问题描述】:

我有一个 Twilio 语音号码设置(现阶段试用),我有一个使用 ngrok 运行的 node.js 服务器。

我正在尝试使用以下代码将来电转接到 webhook 端点上的手机号码:

const ivrTwilRes = new twilio.TwimlResponse();
ivrTwilRes.dial({callerId:'+xxxxxxxx'},
function(){
    this.number('+xxxxxxxx');
}).record();

o_Res.set('Content-Type','text/xml');
o_Res.send(ivrTwilRes.toString());

但它不断返回应用程序错误或只是挂断。

我可以使用 Twilio Studio 使其正常工作,但我希望最终获得由我的应用程序动态生成的转发号码。

【问题讨论】:

    标签: node.js twilio


    【解决方案1】:

    任何正在寻找答案的人。

    app.get('/voice', (request,response) => {
    
        const twilio = new VoiceResponse();
        twilio.dial('+xxxxxxxxxx');
    
        response.set('Content-Type','text/xml');
        response.send(twilio.toString());
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多