Created
July 21, 2015 05:32
-
-
Save zackproser/00a2a628e2086c25c9e9 to your computer and use it in GitHub Desktop.
A simple route in Express to handle an incoming Twilio call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Handle a user phoning the Super CatFacts Attack Call Center | |
* | |
* @param {Request} - POST request from Twilio - generated when a user calls the associated Twilio phone number | |
* @param {Response} | |
* @return {Response} - Response containing valid Twiml as a string - which creates the CatFacts call center experience | |
*/ | |
app.post('/incoming-call', function(req, res){ | |
res.writeHead(200, { 'Content-Type': 'text/xml' }); | |
res.end(generateCallResponseTwiml().toString()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment