feat(connect): caller ID as an integration: calls on the signed-in live connection, matched on the server

Plan step 3.5.
- The public /api/phone/ws socket is removed (anyone on the LAN could listen to every
  caller). GET /api/phone/call-event stays public for the Grandstream UCM but is LAN-only in
  the proxy (the 443 blocks' LAN-only location now covers it, in nginx-proxy/nginx.conf and
  install.sh), with an optional shared secret (setting caller_id.secret → &key=).
- Calls are logged (phone_calls, migration 0023), matched to a customer on the server
  (services/caller_id.py: Greek number rules moved from the manager) and published as
  `call_incoming` {call_id, at, number, ext, customer card: visits, spent, last 3 orders} to
  users with caller_id.use and to the counter POS screens. GET /api/phone/calls (the log),
  GET /api/customers/lookup?phone=. Calls older than a minute don't pop up (replays).
- Manager: PhoneListener on the live connection and the shared Dialog (no more downloading
  every customer to match); Integrations → Caller ID shows the server's log live and the UCM
  Action URL. Counter: CallPopup with "New takeaway sale".
- Tests: tests/test_caller_id.py (10), terminal unit test, e2e terminal and manager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 09:06:39 +02:00
co-authored by Claude Opus 5.5
parent 88a9703902
commit dabe807ce0
28 changed files with 609 additions and 501 deletions
+3
View File
@@ -116,5 +116,8 @@
"media_type": "Ανεβάστε εικόνα JPG, PNG, WebP ή GIF.",
"media_too_big": "Η εικόνα είναι πολύ μεγάλη (έως {{max_mb}} MB).",
"qr_url_missing": "Γράψτε τον σύνδεσμο που ανοίγει ο QR κωδικός."
},
"caller_id": {
"key_invalid": "Το κλειδί του τηλεφωνικού κέντρου λείπει ή είναι λάθος."
}
}
+20
View File
@@ -658,5 +658,25 @@
"pickSlides": "Διαλέξτε τις φωτογραφίες, με τη σειρά (ξανά πάτημα για αφαίρεση)",
"upload": "Ανέβασμα εικόνων",
"noImages": "Δεν υπάρχουν εικόνες: ανεβάστε (JPG, PNG, WebP ή GIF, έως 5 MB)."
},
"calls": {
"title": "Αναγνώριση κλήσης",
"intro": "Εισερχόμενες κλήσεις από το τηλεφωνικό σας κέντρο, με την καρτέλα του πελάτη όταν τον γνωρίζουμε. Η διαχείριση και το ταμείο δείχνουν ειδοποίηση.",
"incoming": "Εισερχόμενη κλήση",
"close": "Κλείσιμο",
"unknown": "Άγνωστος καλών",
"unknownBody": "Δεν είναι ακόμα πελάτης σας.",
"ext": "εσωτ. {{ext}}",
"visits": "Επισκέψεις",
"spent": "Σύνολο",
"recent": "Τελευταίες παραγγελίες",
"noOrders": "Καμία παραγγελία ακόμα",
"items_one": "{{count}} είδος",
"items_other": "{{count}} είδη",
"log": "Κλήσεις",
"none": "Καμία κλήση ακόμα",
"setup": "Σύνδεση του τηλεφωνικού κέντρου",
"setupBody": "Στο Grandstream UCM, ορίστε το Action URL για τις εισερχόμενες κλήσεις σε αυτή τη διεύθυνση (λειτουργεί μόνο μέσα από το κατάστημα):",
"setupSecret": "Για επιπλέον ασφάλεια, ορίστε ένα κλειδί στις Ρυθμίσεις (caller_id.secret) και προσθέστε &key=<το κλειδί> στη διεύθυνση."
}
}
+7
View File
@@ -464,6 +464,13 @@
"arrive": "Ήρθαν: καθίστε τους",
"cancel": "Ακύρωση",
"noShow": "Δεν ήρθαν"
},
"call": {
"title": "Εισερχόμενη κλήση",
"unknown": "Άγνωστος καλών",
"takeaway": "Νέα πώληση για παραλαβή",
"visits_one": "{{count}} επίσκεψη · {{spent}}",
"visits_other": "{{count}} επισκέψεις · {{spent}}"
}
},
"display": {