Contacts management page + MySQL-only backend
- vm_contacts: mysql-only backend (removed file/google/carddav from _BACKENDS) - contacts.conf: backends=mysql (no fallback) - vm_web.py: /contacts CRUD list (list, new, edit, delete, delete_all) - vm_web.py: /contacts/import_vcf re-imports from VCF (skips junk names) - nav: Contacts link added for authenticated users - fixes: _MySQLCon.__iter__ for get_settings loop; add_contact row.id check
This commit is contained in:
+3
-5
@@ -2,11 +2,9 @@
|
||||
"""
|
||||
Caller-ID -> contact name resolution for Asterisk voicemail notifications.
|
||||
|
||||
Backends (tried in the order given by contacts.conf 'backends='):
|
||||
Backends (contacts are resolved exclusively from the MySQL `contacts` table
|
||||
on the asterisk DB):
|
||||
mysql - MySQL contacts table on the asterisk DB (primary, fast, offline).
|
||||
file - local vCard (.vcf) or CSV export; no auth, offline, fast.
|
||||
google - Google People API via the Hermes OAuth token.
|
||||
carddav - generic CardDAV with username + app password.
|
||||
|
||||
Everything here is best-effort: a lookup failure returns None and the caller
|
||||
falls back to the raw caller-ID string. Results (hits AND misses) are cached
|
||||
@@ -393,7 +391,7 @@ def lookup_carddav(cfg, num_digits, n, log):
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- entrypoint
|
||||
_BACKENDS = {"mysql": lookup_mysql, "file": lookup_file, "google": lookup_google, "carddav": lookup_carddav}
|
||||
_BACKENDS = {"mysql": lookup_mysql}
|
||||
|
||||
|
||||
def resolve(caller_id, log=print):
|
||||
|
||||
Reference in New Issue
Block a user