diff --git a/app/messages/pages/messages.tsx b/app/messages/pages/messages.tsx
index 5cd9f27..4a94e12 100644
--- a/app/messages/pages/messages.tsx
+++ b/app/messages/pages/messages.tsx
@@ -23,7 +23,7 @@ const Messages: BlitzPage = () => {
return (
<>
-
+
Messages
diff --git a/app/phone-calls/api/queue/fetch-calls.ts b/app/phone-calls/api/queue/fetch-calls.ts
index c06a18c..0abb8c9 100644
--- a/app/phone-calls/api/queue/fetch-calls.ts
+++ b/app/phone-calls/api/queue/fetch-calls.ts
@@ -3,6 +3,9 @@ import { Queue } from "quirrel/blitz";
import db from "../../../../db";
import insertCallsQueue from "./insert-calls";
import getTwilioClient from "../../../../integrations/twilio";
+import appLogger from "../../../../integrations/logger";
+
+const logger = appLogger.child({ queue: "fetch-calls" });
type Payload = {
organizationId: string;
@@ -15,7 +18,7 @@ const fetchCallsQueue = Queue("api/queue/fetch-calls", async ({ organiz
include: { organization: true },
});
if (!phoneNumber) {
- console.log("no phone number found");
+ logger.warn(`No phone number found with id=${phoneNumberId}, organizationId=${organizationId}`);
return;
}
diff --git a/app/phone-calls/api/webhook/call.ts b/app/phone-calls/api/webhook/call.ts
index 3b6865c..5e6beaa 100644
--- a/app/phone-calls/api/webhook/call.ts
+++ b/app/phone-calls/api/webhook/call.ts
@@ -116,10 +116,9 @@ export default async function incomingCallHandler(req: BlitzApiRequest, res: Bli
// TODO dial.client("unique id of device user is picking up with");
// TODO send notification
// TODO db.phoneCall.create(...);
+ // TODO subscribe to status updates to update duration when call ends
}
- // TODO queue job to update duration when call ends
-
res.status(500).end();
}
@@ -135,3 +134,32 @@ const outgoingBody = {
From: "client:95267d60-3d35-4c36-9905-8543ecb4f174__673b461a-11ba-43a4-89d7-9e29403053d4",
To: "+33613370787",
};
+
+const incomingBody = {
+ AccountSid: "ACa886d066be0832990d1cf43fb1d53362",
+ ApiVersion: "2010-04-01",
+ ApplicationSid: "APa43d85150ad6f6cf9869fbe1c1e36a66",
+ CallSid: "CA09a5d9a4cfacf2b56d66f8f743d2881a",
+ CallStatus: "ringing",
+ Called: "+33757592025",
+ CalledCity: "",
+ CalledCountry: "FR",
+ CalledState: "",
+ CalledZip: "",
+ Caller: "+33613370787",
+ CallerCity: "",
+ CallerCountry: "FR",
+ CallerState: "",
+ CallerZip: "",
+ Direction: "inbound",
+ From: "+33613370787",
+ FromCity: "",
+ FromCountry: "FR",
+ FromState: "",
+ FromZip: "",
+ To: "+33757592025",
+ ToCity: "",
+ ToCountry: "FR",
+ ToState: "",
+ ToZip: "",
+};
diff --git a/app/phone-calls/components/phone-calls-list.tsx b/app/phone-calls/components/phone-calls-list.tsx
index fe0bc21..a74356b 100644
--- a/app/phone-calls/components/phone-calls-list.tsx
+++ b/app/phone-calls/components/phone-calls-list.tsx
@@ -1,5 +1,9 @@
+import { PhoneMissedCallIcon, PhoneOutgoingIcon } from "@heroicons/react/solid";
+
import { Direction } from "../../../db";
import usePhoneCalls from "../hooks/use-phone-calls";
+import { formatRelativeDate } from "../../core/helpers/date-formatter";
+import clsx from "clsx";
export default function PhoneCallsList() {
const phoneCalls = usePhoneCalls()[0];
@@ -11,11 +15,27 @@ export default function PhoneCallsList() {
return (