diff --git a/templates/dashboard.html b/templates/dashboard.html index bd82efb..fc8fa9f 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -84,6 +84,8 @@ {% if seg.phone %} Telefoniert + {% else %} + Frei {% endif %} {% endif %} diff --git a/webhook.py b/webhook.py index e150784..88abf07 100644 --- a/webhook.py +++ b/webhook.py @@ -13,6 +13,21 @@ logger = logging.getLogger(__name__) webhook_app = FastAPI(title="Busylight Webhook") +@webhook_app.get("/", response_class=PlainTextResponse) +async def webhook_info(): + return """Busylight Webhook API (Telefonanlage) + +Endpoints: + GET/POST /{durchwahl}/callstart - Anruf gestartet (WLED -> Rot) + GET/POST /{durchwahl}/callend - Anruf beendet (WLED -> zurueck auf Teams-Status) + +Beispiel: + curl http://localhost:8081/123/callstart + curl http://localhost:8081/123/callend +""" + + + def _get_user_by_extension(extension, conn): """Find user and their assignment by phone extension.""" return conn.execute("""