Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Apartment Door Unlocker - twilio style
<?php
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
function randomResponseString(){
$responses = array( 'Sup wid it?', 'Helloooooooooooooo',
'Noob Noob Noob Noob', 'Let the Base Cannon Kick It: wub wub wub wub',
'A horse passes behind you', 'Help I am stuck in an apartment buzzer factory. Please send help!',
'Skynet became self aware at '.date('g h A').' today.', 'Access Denied',
'I will grant you access if you spin around 3 times! Go on. Do it. Hooray',
);
return $responses[rand(0, sizeof($responses)-1)];
//return $responses[sizeof($responses)-1]; //for testing
}
?>
<Response>
<Say><?php echo randomResponseString(); ?></Say>
<Pause length="1"/>
<Play>http://example.com/twilio/dtmf-9.mp3</Play>
<Pause length="1"/>
<Hangup/>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.