Skip to content

Support new MedControl API format, dynamic ring groups, and multi-recipient extensions#2

Closed
lramos15 wants to merge 5 commits into
techinems:mainfrom
lramos15:lramos15/latin-bonobo
Closed

Support new MedControl API format, dynamic ring groups, and multi-recipient extensions#2
lramos15 wants to merge 5 commits into
techinems:mainfrom
lramos15:lramos15/latin-bonobo

Conversation

@lramos15
Copy link
Copy Markdown

Summary\n\nAdapts DiALERT to the upcoming MedControl scheduling API changes and generalizes the PBX ring group configuration.\n\n## Changes\n\n### 1. Support both old and new MedControl API shapes\n\nThe GET /api/shifts/current endpoint is moving from a flat recipients[] structure to a groups[] structure where each group can contain multiple recipients. getCurrentSchedule now detects which format was returned (body.groups vs body.recipients) and normalizes both into a consistent internal groups representation.\n\n### 2. Multi-recipient ring groups\n\nEach ring group can now simultaneously call multiple people. The extensionList is built by joining all recipient numbers in a group (e.g. 5551234567#-5559876543#), and the existing ringall strategy handles simultaneous ringing.\n\n### 3. Dynamic ring group naming via RING_GROUP_PREFIX\n\nReplaces the hardcoded RG1/RG2/RG3 env vars with a single RING_GROUP_PREFIX. Ring group numbers are computed as <prefix><priority> (e.g. prefix 100 → groups 1001, 1002, 1003, …). This also removes the previous 3-group cap — the system now supports any number of groups.\n\n### 4. Generalized chaining logic\n\nThe ring group overflow chaining (postAnswer) is no longer a set of hardcoded switch/if branches for 1–3 recipients. It now works for any count: each group chains to the next, and the last group terminates with app-blackhole,busy,1.\n\n## Env changes\n\ndiff\n- RG1=1001\n- RG2=1002\n- RG3=1003\n+ RING_GROUP_PREFIX=100\n

@lramos15 lramos15 requested a review from ddbruce as a code owner May 31, 2026 22:10
@lramos15 lramos15 closed this May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants