我正在试着把号码输入到电话里。我认为在引脚函数中使用res.Digits是可行的,但我得到了一个未定义的错误
exports.Say = function(req, res)
{
var resp = new twilio.TwimlResponse();
resp.gather(
{
action:'http://pap-papdemo.rhcloud.com/api/Phone/Pin',
finishOnKey:'#',
method:"POST"
}, function()
{
this.say('Please enter your Phone and Pin number followed by the hash key');
});
//Render the TwiML document using "toString"
res.writeHead(200,
{
'Content-Type':'text/xml'
});
res.end(resp.toString());
};
exports.Pin = function(req, res)
{
var resp = new twilio.TwimlResponse();
console.log("***** PIN *****");
console.log("Pin: Response " + res.body.Digits);
//Render the TwiML document using "toString"
res.writeHead(200,
{
'Content-Type':'text/xml'
});
res.end(resp.toString());
};是否知道我需要做什么,因为我需要在数据库中存储个人识别码
发布于 2016-03-02 05:04:07
来自Twilio的Megan。我看到你回答了你自己的问题,但我想我应该更新一下,作为其他登陆这里的人的答案。
除了标准的TwiML语音请求参数之外,它还可以请求“Twilio will pass Digits as a parameter”URL。
因此,var pin = JSON.stringify(req.body.Digits);在这种情况下工作。
https://stackoverflow.com/questions/35215925
复制相似问题