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:
+6
-3
@@ -246,7 +246,8 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# Device pairing is LAN-only (APPS_PLATFORM D-8): a device must be in the venue to pair.
|
||||
location /api/devices/pair-request {
|
||||
# So is the phone system's call webhook (caller ID, plan step 3.5): only the venue's UCM calls it.
|
||||
location ~ ^/api/(devices/pair-request|phone/call-event) {
|
||||
allow 10.0.0.0/8;
|
||||
allow 172.16.0.0/12;
|
||||
allow 192.168.0.0/16;
|
||||
@@ -288,7 +289,8 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# Device pairing is LAN-only (APPS_PLATFORM D-8): a device must be in the venue to pair.
|
||||
location /api/devices/pair-request {
|
||||
# So is the phone system's call webhook (caller ID, plan step 3.5): only the venue's UCM calls it.
|
||||
location ~ ^/api/(devices/pair-request|phone/call-event) {
|
||||
allow 10.0.0.0/8;
|
||||
allow 172.16.0.0/12;
|
||||
allow 192.168.0.0/16;
|
||||
@@ -330,7 +332,8 @@ server {
|
||||
ssl_ciphers HIGH:!aNULL:!MD5;
|
||||
|
||||
# Device pairing is LAN-only (APPS_PLATFORM D-8): a device must be in the venue to pair.
|
||||
location /api/devices/pair-request {
|
||||
# So is the phone system's call webhook (caller ID, plan step 3.5): only the venue's UCM calls it.
|
||||
location ~ ^/api/(devices/pair-request|phone/call-event) {
|
||||
allow 10.0.0.0/8;
|
||||
allow 172.16.0.0/12;
|
||||
allow 192.168.0.0/16;
|
||||
|
||||
Reference in New Issue
Block a user