![](/img/trans.png)
[英]How do I get the user IP address from the incoming request in loopback 4?
[英]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 number
在req
对象中。
是req.body.From
。
在您的示例中, const caller = ...;
成为const caller = req.body.From;
。
文档:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.