Use processed number instead of request number

This commit is contained in:
Ian Webster 2014-06-30 22:20:48 -07:00
parent e2a23644e3
commit f16ca7d7ed

6
app.js
View File

@ -63,7 +63,7 @@ app.post('/intl', function(req, res) {
}); });
function textRequestHandler(req, res, number, region, key) { function textRequestHandler(req, res, number, region, key) {
if (!req.body.number || !req.body.message) { if (!number || !req.body.message) {
mpq.track('incomplete request'); mpq.track('incomplete request');
res.send({success:false,message:'Number and message parameters are required.'}); res.send({success:false,message:'Number and message parameters are required.'});
return; return;
@ -78,7 +78,7 @@ function textRequestHandler(req, res, number, region, key) {
} }
var tracking_details = { var tracking_details = {
number: req.body.number, number: number,
message: req.body.message, message: req.body.message,
ip: ip ip: ip
}; };
@ -87,7 +87,7 @@ function textRequestHandler(req, res, number, region, key) {
response_obj = response_obj || {}; response_obj = response_obj || {};
// Time to actually send the message // Time to actually send the message
sendText(req.body.number, message, region, function(err) { sendText(number, message, region, function(err) {
if (err) { if (err) {
mpq.track('sendText failed', tracking_details); mpq.track('sendText failed', tracking_details);
res.send(_.extend(response_obj, res.send(_.extend(response_obj,