Files
asterisk-voicemail/config/contacts.conf.example
jp 21dc883e99 Fix contacts matcher: full-number (15-digit) matching, junk-name guard
- Index by full E.164 digits instead of last-9 only; previously different
  people sharing a 9-digit suffix collided and lookups returned the wrong
  name. Resolve now tries longest match first.
- match_digits default 9 -> 15 in code and example config.
- Skip emoji/punctuation-only contact names so a junk card can't shadow a
  real one when a number is duplicated in the export.
- Verified: 513 contacts self-consistent; 6 remaining collisions are genuine
  duplicate entries in the source VCF (two cards, same number), not a matcher
  error.

Also: placed /home/jp/contacts.vcf at /var/lib/vm-transcribe/contacts.vcf
(640 asterisk:asterisk), set backends=file, cleared stale cache, restarted
vm-portal.
2026-08-13 11:13:12 +01:00

74 lines
2.7 KiB
Plaintext

# /opt/vm-transcribe/contacts.conf
#
# Caller-ID -> name lookup for voicemail notifications.
# Re-read on every voicemail; no restart needed.
#
# chmod 640, owned root:asterisk - may contain a password.
[contacts]
# Master switch. If no, notifications just show the raw caller ID.
enabled = yes
# Which backends to try, in order, comma separated:
# file - a local vCard (.vcf) or CSV export. No auth, fast, works offline.
# google - Google People API using the Hermes OAuth token (recommended
# for Google accounts; see note about app passwords below).
# carddav - any CardDAV server with username + app password.
backends = file, google
# Successful and failed lookups are cached here to avoid hammering an API
# on every call. Delete the file to force a refresh.
cache_path = /var/lib/vm-transcribe/contacts_cache.json
cache_ttl = 86400
# Match on the last N digits of the number, so +447941223856,
# 07941223856 and 447941223856 all resolve to the same contact.
# 9 is a sane default for UK/US. Lower it only if you get misses.
match_digits = 15
# ---------------------------------------------------------------------------
[file]
# vCard (.vcf) or CSV exported from Google Contacts:
# contacts.google.com -> Export -> vCard (or Google CSV)
# This is the most reliable option: no tokens, no API limits, no network.
path = /var/lib/vm-transcribe/contacts.vcf
# ---------------------------------------------------------------------------
[google]
# Uses the OAuth token from the Hermes google-workspace skill, which must be
# authorised with the People API / contacts.readonly scope.
token_path = /var/lib/vm-transcribe/google_token.json
# Optional: refresh the local export from the People API on this schedule
# (seconds). 0 = only look up on demand. Bulk-syncing to the file backend is
# much faster per call than a live query.
sync_interval = 0
# ---------------------------------------------------------------------------
[carddav]
# Generic CardDAV with an app password.
#
# !! IMPORTANT: this will NOT work against Google. Google disabled basic
# !! authentication for CardDAV, CalDAV, IMAP, SMTP and POP on 2024-09-30;
# !! app passwords are rejected and Google's CardDAV now requires OAuth 2.0.
# !! Use the 'google' or 'file' backend for Google Contacts instead.
#
# These settings do work for Nextcloud, Fastmail, iCloud, Radicale, etc.
url =
username =
# App password (NOT the main account password). Generate one in your
# provider's security settings.
app_password =
# Some providers need an explicit addressbook path, e.g.
# Nextcloud: /remote.php/dav/addressbooks/users/<user>/contacts/
# iCloud: discovered automatically from the principal URL
addressbook_path =
verify_tls = yes
timeout = 20