Skip to content

Instantly share code, notes, and snippets.

@paul-english
Created November 10, 2012 20:20
Show Gist options
  • Save paul-english/4052368 to your computer and use it in GitHub Desktop.
Save paul-english/4052368 to your computer and use it in GitHub Desktop.
function smsInboundCallback (req, res) {
console.log('smsInboundCallback', req.body);
// { AccountSid: 'AC64065c2140fe4bf6849b13316fe1847a',
// ApiVersion: 'v1',
// Body: 'Oh hai',
// From: '+18012101024',
// SmsSid: 'SMa4bfb6db0a10413bad796d33ca0dcadf',
// SmsStatus: 'sent',
// To: '+12676708074' }
var response = new InboundXML.Response();
response.append(
new InboundXML.Sms("SMS message from our production app", {
action: 'http://sprouthelp.com/api/sms/test-action',
method: 'POST',
from: '(267) 670-8074',
to: '(805) 440-0925',
statusCallback: 'http://sprouthelp.com/api/sms/test-statusCallback'
})
);
console.log(response.toString());
res.send(response.toString());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment