30 lines
1.2 KiB
Markdown

# doorman-client
This is the Twilio Function that is triggered when receiving a call from a buzzer. In short, it's job is to talk to the doorman-api to determine the buzzers configuration and to check if the door should be auto unlocked, or dial through to a phone number on file.
## dependency services
This service has a hard dependency on doorman-api, specifically on the /api/door/info Function. if this is down, the buzzer client will not work.
It has soft dependencies on self hosted monitoring solutions:
- Pushgateway (prometheus metrics)
- Loki (logs)
## running locally
NOTE: You'll want to make sure that doorman-api is also running locally first. .env.local is configured to use http://localhost:8080 as the doorman-api endpoint
First install the necessary dependencies `bun install`.
Run the doorman-client
`bun run start`
To test doorman-client head over to
`http://localhost:4500/buzzer-activated?From=6133163433`
This will simulate a buzzer calling from 6133163433 (the test buzzer)
If you let it poll for 10s then it should respond with Twilio xml saying to dial fallback numbers.
If doorman-api is not running, it would always return with a `<Reject/>`