0
我想获取输入手机的数字。我想在引脚功能res.Digits会的方式,但我得到一个未定义的错误从twilio收集数字收集
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());
};
任何知道我需要做的,因为我需要存储针数分贝
我看到数字是在请求参数,所以尝试req.params.Digits但没有工作 – ActionManning
我最终得到了答案var pin = JSON.stringify(req.body.Digits); – ActionManning