Skip to content

Send a phone call from AI agent, in an API call. Or, directly call the bot from the configured phone number!

Python

ux: Add a call me button for reports pages

Clémence Lesné5cbe2f1eb9a7
diff --git a/function_app.py b/function_app.py
index 8a3e329..e4e8033 100644
--- a/function_app.py
+++ b/function_app.py
@@ -151,6 +151,7 @@ async def report_get(req: func.HttpRequest) -> func.HttpResponse:
applicationinsights_connection_string=getenv(
"APPLICATIONINSIGHTS_CONNECTION_STRING"
),
+ bot_phone_number=CONFIG.communication_services.phone_number,
calls=calls or [],
count=count,
phone_number=phone_number,
@@ -189,6 +190,7 @@ async def report_single_get(req: func.HttpRequest) -> func.HttpResponse:
),
bot_company=call.initiate.bot_company,
bot_name=call.initiate.bot_name,
+ bot_phone_number=CONFIG.communication_services.phone_number,
call=call,
next_actions=[action for action in NextActionEnum],
version=CONFIG.version,
diff --git a/public_website/list.html.jinja b/public_website/list.html.jinja
index 2ace20c..4b980d6 100644
--- a/public_website/list.html.jinja
+++ b/public_website/list.html.jinja
@@ -5,6 +5,8 @@ History for {{ phone_number or 'all numbers' }}
{% endblock %}
{% block content %}
+<!-- Call me button -->
+{% include "templates/call_me.html.jinja" %}
<!-- Search bar for phone number -->
<div class="p-4 -mb-4 col-span-full sticky top-0 lg:px-0 lg:grid lg:grid-cols-6">
<div class="lg:col-start-2 lg:col-end-6">
diff --git a/public_website/single.html.jinja b/public_website/single.html.jinja
index 116640d..6fb68f9 100644
--- a/public_website/single.html.jinja
+++ b/public_website/single.html.jinja
@@ -5,6 +5,8 @@ Claim ({{ call.initiate.phone_number }})
{% endblock %}
{% block content %}
+<!-- Call me button -->
+{% include "templates/call_me.html.jinja" %}
<!-- Top introduction -->
<header class="col-span-full mx-4 mb-4">
<div class="my-4 text-neutral-600 dark:text-neutral-400">
diff --git a/public_website/templates/call_me.html.jinja b/public_website/templates/call_me.html.jinja
new file mode 100644
index 0000000..38323d2
--- /dev/null
+++ b/public_website/templates/call_me.html.jinja
@@ -0,0 +1 @@
+<a href="tel:{{ bot_phone_number }}" class="fixed bottom-0 right-0 m-4 px-6 py-4 rounded-full backdrop-blur shadow-md font-semibold bg-gradient-to-r from-pink-300/30 hover:from-pink-400/30 dark:from-pink-700/30 dark:hover:from-pink-600/30 to-violet-300/30 hover:to-violet-400/30 dark:to-violet-700/30 dark:hover:to-violet-600/30">☎️&nbsp;&nbsp;Call me</a>