change order of digit press
Some checks failed
Build and push image for doorman-homeassistant / docker (push) Failing after 59s
Build and push image for doorman-homeassistant / deploy-gitainer (push) Has been skipped
Build and push Doorman UI / API / docker (push) Successful in 1m34s

This commit is contained in:
Martin Dimitrov 2025-05-26 16:28:19 -07:00
parent 7a2ebb92be
commit 4f7ecfa5a3

View File

@ -4,9 +4,19 @@ import { InfoResponseClient } from '../../../doorman-api/src/functions/api/door/
export function doorOpenTwiml(config: InfoResponseClient): VoiceResponse { export function doorOpenTwiml(config: InfoResponseClient): VoiceResponse {
const twiml = new Twilio.twiml.VoiceResponse(); const twiml = new Twilio.twiml.VoiceResponse();
twiml.play('https://buzzer-2439-prod.twil.io/buzzing_up_boosted.mp3'); // pause for some time
twiml.play({ digits: config.pressKey }); // configured in doorman what button to click and passed into this function
twiml.pause({ length: 1 }); twiml.pause({ length: 1 });
// press digit
twiml.play({ digits: config.pressKey }); // configured in doorman what button to click and passed into this function
// play audio
twiml.play('https://buzzer-2439-prod.twil.io/buzzing_up_boosted.mp3');
// pause again
twiml.pause({ length: 1 });
// exit
twiml.hangup(); twiml.hangup();
// @ts-ignore // @ts-ignore
return twiml; return twiml;