Created
March 10, 2014 02:38
-
-
Save kwhinnery/9458584 to your computer and use it in GitHub Desktop.
This file contains 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
var twilio = require('twilio'); | |
var client = twilio('your account sid', 'your auth token'); | |
// Call everyone that texted a number you just bought - remember, for this to work, | |
// this needs to be a number you just bought, that only this room full of people have | |
// texted | |
client.listMessages({ | |
to:'your twilio number' | |
}, function(err, data) { | |
data.messages.forEach(function(message) { | |
client.makeCall({ | |
to:message.from, | |
from:'your twilio number', | |
url:'http://someserver.com/twiml.php' // TwiML instructions for the outbound call | |
}); | |
}); | |
}); |
This file contains 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
<?php header('Content-Type:text/xml'); ?> | |
<!-- Would be easy to just generate this XML from a node server - doesn't need to be PHP --> | |
<Response> | |
<Play>http://someserver.com/audio/zelda.mp3</Play> | |
</Response> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment