ukd1 / node-twilio

A (deprecated) Twilio helper library for node. Use the official one:
https://github.com/twilio/twilio-node
177 stars 56 forks source link

undefined request params #19

Closed ekosz closed 12 years ago

ekosz commented 12 years ago

I there I have this code

phone.on('incomingSms', function(smsParams, response) {
    console.log("REQUEST:");
    console.log(smsParams);
    var from = smsParams.From;
    ...
});

And when I get a response I see this in my logs

012-01-20T00:00:41+00:00 app[web.1]: REQUEST:
2012-01-20T00:00:41+00:00 app[web.1]: undefined
2012-01-20T00:00:41+00:00 app[web.1]: TypeError: Cannot read property 'From' of undefined

Am I doing something wrong? This seems like the exact way the docs do it.

Thank you!

ekosz commented 12 years ago

Forgot bodyParser() for express. I'm good now.

sjwalter commented 12 years ago

Hmm, interesting. Can you post the rest of your code (initialization)?

Thanks, Stephen

On Thu, Jan 19, 2012 at 4:12 PM, Eric Koslow < reply@reply.github.com

wrote:

I there I have this code

phone.on('incomingSms', function(smsParams, response) {
   console.log("REQUEST:");
   console.log(smsParams);
   var from = smsParams.From;
   ...
});

And when I get a response I see this in my logs

012-01-20T00:00:41+00:00 app[web.1]: REQUEST:
2012-01-20T00:00:41+00:00 app[web.1]: undefined
2012-01-20T00:00:41+00:00 app[web.1]: TypeError: Cannot read property
'From' of undefined

Am I doing something wrong? This seems like the exact way the docs do it.

Thank you!


Reply to this email directly or view it on GitHub: https://github.com/sjwalter/node-twilio/issues/19