/** * Automatically open the door */ exports.handler = function(context, event, callback) { let twiml = new Twilio.twiml.VoiceResponse(); let config = JSON.parse(event.config); let configQuery = `config=${encodeURIComponent(JSON.stringify(config))}`; let passAlong = `fingerprint=${encodeURIComponent(event.fingerprint)}&${configQuery}`; twiml.play('https://buzzer-2439-prod.twil.io/buzzing_up_boosted.mp3'); twiml.play({ digits: config.pressKey }); // configured in doorman what button to click and passed into this function twiml.pause({ length: 1 }); twiml.redirect(`/text-me?Method=doorman&${passAlong}`); callback(null, twiml); };