繁体   English   中英

如何从传入的电话网络挂接请求中找到呼叫者?

[英]How can I get the caller from an incoming phone call webhook request?

我将为Twilio中的来电开发一个Webhook:

app.post('/voice', (req, res) => {
  const twiml = new VoiceResponse();
  const caller = ...;
  twiml.say('hello, your number is ' + caller);
  res.type('text/xml');
  res.send(twiml.toString());
});

如何从请求( req )中获取呼叫者电话号码? 我不需要名字,只需要数字。

我在文档中找不到调用webhook时在POST正文中发送的内容。

您要查找的caller phone numberreq对象中。

req.body.From

在您的示例中, const caller = ...;

成为const caller = req.body.From;


文档:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM