Martin Dimitrov e37df33c08
All checks were successful
Build and push Doorman UI / API / docker (push) Successful in 49s
migrate buzzer client
2024-10-26 11:39:48 -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);
};