Receiving Texts and Making Calls with Twilio
This example receives a text message from a user and responds by calling that user and playing them a compliment from The Flatterist.
This example uses the Twilio module.
This script receives the incoming text message and makes the outbound call in response. Twilio is configured to POST all text messages to this URL.
The last parameter to
twilio.call above was the URL for the following script. Twilio will request TwiML from this URL. This script responds with TwiML that instructs Twilio to play the MP3 for a random compliment from The Flatterist. (The list of available compliments is maintained here: http://www.flatterist.com/compliments.json.)
To try it out, just send a text message to 425-967-8361.