Martin Dimitrov 24ca5f8e0b
Some checks failed
Build and push Doorman UI / API / docker (push) Failing after 17s
move packages
2024-10-26 11:49:42 -07:00

15 lines
530 B
JavaScript

/**
* Automatically open the door
*/
exports.handler = function(context, event, callback) {
let twiml = new Twilio.twiml.VoiceResponse();
let passAlong = `fingerprint=${encodeURIComponent(event.fingerprint)}`;
twiml.play('https://smart-door-buzzer-3172.twil.io/buzzing_up_boosted.mp3');
twiml.play({ digits: event.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);
};