Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!
Python
fix: JWT tokens are sometimes not allowed from Communication Services
Clémence Lesné8891b650d5e4
diff --git a/function_app.py b/function_app.pyindex af6ca5a..ef2c891 100644--- a/function_app.py+++ b/function_app.py@@ -1,5 +1,6 @@import asyncioimport json+from datetime import timedeltafrom http import HTTPStatusfrom os import getenvfrom typing import Any, Optional, Union@@ -568,6 +569,9 @@ async def communicationservices_event_post(audience=CONFIG.communication_services.resource_id,issuer="https://acscallautomation.communication.azure.com",jwt=service_jwt,+ leeway=timedelta(+ minutes=5+ ), # Recommended practice by Azure to mitigate clock skewkey=_communication_services_jwks_client.get_signing_key_from_jwt(service_jwt).key,