Repository navigation
Backlog
Labels
milestone goal 👑This describes an announced milestone goalnethvoiceBug or features releted to the NethVoice project
Description
Summary
Add calendar support to NethVoice so that calendar events can drive:
- Inbound dialplan – time conditions that match or don't match based on calendar events (holidays, closures, special openings, on-call shifts) instead of, or in addition to, static time groups.
- CTI user presence – when a user's calendar has an event that marks them as busy, the user is automatically treated as DND for the duration of the event, then restored to the previous state when it ends.
The issue also covers deciding which external calendar providers to support (Google, Microsoft 365 / Exchange, WebTop) and whether to offer an internal calendar as an alternative for customers without a groupware.
Motivation
- Static time groups are hard to maintain for irregular schedules (Easter, bridge days, company closures, one-off events) and require access to the admin UI.
- Office staff already manage these schedules in their groupware calendar: letting the PBX read that calendar removes double data entry.
- Users often forget to set DND before meetings. Deriving presence from the calendar keeps CTI presence accurate and avoids ringing users who are busy.
Use cases
1. Inbound dialplan (time conditions)
- A time condition can be linked to a calendar (or a group of calendars / an event filter) instead of a time group.
- The condition matches when an event is active at call time (e.g. a "Closed" calendar), doesn't match otherwise.
- Optional filter on event category/title/tag, so a single calendar can contain several kinds of events.
- Timezone must be configurable per calendar.
- Recurring events (RRULE, EXDATE), all-day and multi-day events must be handled correctly.
2. CTI presence from user calendar
- Each CTI user can link one (or more) personal calendars.
- While an event considered busy is active, the user's presence becomes DND.
- Busy detection uses the free/busy status of the event, not just its existence:
- CalDAV/iCal:
TRANSP:OPAQUEvsTRANSPARENT,STATUS(ignoreCANCELLED), free/busy query. - Google: event
transparency(opaque/transparent) or the FreeBusy API. - Microsoft Graph:
showAs(free,tentative,busy,oof,workingElsewhere) orgetSchedule.
- CalDAV/iCal:
- Configurable mapping (e.g.
tentative→ available or DND;oof→ DND or a different presence such as "away"). - At the end of the event the previous presence is restored. A presence set manually by the user during the event must not be overwritten.
- Visible in the CTI (e.g. "DND – from calendar until 15:30") and possibly overridable by the user.
Calendar sources to evaluate
| Source | Protocol / API | Auth | Notes |
|---|---|---|---|
| WebTop (NS8) | CalDAV | Username/password, or a service account | Native NethServer groupware; CalDAV is already exposed. Most natural first target. |
| Generic CalDAV (Nextcloud, SOGo, etc.) | CalDAV (RFC 4791) | Basic auth / app password | Covers WebTop and many others with a single driver. |
| Remote iCal (ICS URL) | HTTP GET of .ics |
Secret URL | Read-only, easiest; polling only; RRULE expansion done locally. Good for shared company calendars (holidays). |
| Google Calendar | Google Calendar API (or CalDAV) | OAuth 2.0 (per user or domain-wide delegation for Workspace) | Push notifications available (watch channels); requires a Google Cloud project/consent screen. |
| Microsoft 365 / Exchange Online | Microsoft Graph | OAuth 2.0 (Entra ID app, application or delegated permissions) | Do not use EWS: it is being blocked in Exchange Online from Oct 1, 2026 and permanently removed on Apr 1, 2027. Graph supports change notifications (webhooks) and getSchedule for free/busy. |
| Exchange on-premises | EWS (still supported on-prem) or CalDAV via gateway | NTLM/Basic/OAuth | Lower priority; evaluate demand. |
Open questions
- Driver architecture: a single "calendar service" (NS8 module or NethVoice container) that syncs all sources and exposes a normalized API/state to both Asterisk/FreePBX and the CTI server, rather than separate integrations in each component.
- Sync model: polling interval vs push (Google watch channels, Graph subscriptions need a publicly reachable HTTPS endpoint, which not every installation has). Polling with a reasonable interval (1–5 min) as baseline, push as optimization.
- Credentials: per-user OAuth consent vs admin/tenant-wide consent (domain-wide delegation for Google, application permissions for Graph). Tenant-wide is much simpler for presence across many users.
- User mapping: how to map NethVoice users to calendar accounts (email address from the user directory/LDAP is the obvious key).
- Privacy: only free/busy information should be needed for presence; avoid storing event titles/details for user calendars.
- Failure behavior: if the calendar source is unreachable, keep the last known state or fall back to the time group? Must be configurable for the dialplan (fail-open vs fail-closed).
- Reuse of FreePBX Calendar module: FreePBX already ships a Calendar module (local, iCal, CalDAV, EWS) that integrates with Time Conditions. Evaluate whether to adopt/extend it or build a dedicated component. Known issues in the community with recurring events and all-day events, and its EWS driver is no longer viable for Exchange Online.
- Asterisk native
res_calendar(CalDAV, iCal, EWS, Exchange): evaluate as an alternative for dialplan evaluation (CALENDAR_BUSY()), keeping in mind it is independent from the FreePBX layer.
Metadata
Metadata
Assignees
Labels
milestone goal 👑This describes an announced milestone goalnethvoiceBug or features releted to the NethVoice project
Type
Projects
- StatusShow more project fieldsTodo
Activity