Support new MedControl API format, dynamic ring groups, and multi-recipient extensions#2
Closed
lramos15 wants to merge 5 commits into
Closed
Support new MedControl API format, dynamic ring groups, and multi-recipient extensions#2lramos15 wants to merge 5 commits into
lramos15 wants to merge 5 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/currentendpoint is moving from a flatrecipients[]structure to agroups[]structure where each group can contain multiple recipients.getCurrentSchedulenow detects which format was returned (body.groupsvsbody.recipients) and normalizes both into a consistent internalgroupsrepresentation.\n\n### 2. Multi-recipient ring groups\n\nEach ring group can now simultaneously call multiple people. TheextensionListis built by joining all recipient numbers in a group (e.g.5551234567#-5559876543#), and the existingringallstrategy handles simultaneous ringing.\n\n### 3. Dynamic ring group naming viaRING_GROUP_PREFIX\n\nReplaces the hardcodedRG1/RG2/RG3env vars with a singleRING_GROUP_PREFIX. Ring group numbers are computed as<prefix><priority>(e.g. prefix100→ groups1001,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 hardcodedswitch/ifbranches for 1–3 recipients. It now works for any count: each group chains to the next, and the last group terminates withapp-blackhole,busy,1.\n\n## Env changes\n\ndiff\n- RG1=1001\n- RG2=1002\n- RG3=1003\n+ RING_GROUP_PREFIX=100\n