Skip to content

RE1-T115 Outbound TTS work#373

Merged
ucswift merged 1 commit intomasterfrom
develop
May 7, 2026
Merged

RE1-T115 Outbound TTS work#373
ucswift merged 1 commit intomasterfrom
develop

Conversation

@ucswift
Copy link
Copy Markdown
Member

@ucswift ucswift commented May 7, 2026

Summary by CodeRabbit

  • New Features

    • Enabled automatic machine detection for all outbound voice calls to improve call management capabilities.
  • Bug Fixes

    • Improved timing of voice dispatch playback for better call flow.
  • Documentation

    • Updated API documentation for staffing models with new fields and properties.

@request-info
Copy link
Copy Markdown

request-info Bot commented May 7, 2026

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR enhances the Twilio voice call integration by enabling machine detection for outbound calls and adds a response pause before dispatch playback. Additionally, API documentation is updated to reflect staffing model changes in v3 and extended model definitions for v4 endpoints.

Changes

Voice Call Enhancement

Layer / File(s) Summary
Machine Detection Configuration
Providers/Resgrid.Providers.Number/OutboundVoiceProvider.cs
Both mobile and home call paths now set options.MachineDetection = "Enable" on CreateCallOptions before creating the Twilio call resource.
Voice Response Handling
Web/Resgrid.Web.Services/Controllers/TwilioController.cs
The VoiceCall endpoint adds a one-second pause response before dispatching playback logic.

API Documentation Updates

Layer / File(s) Summary
v3 Staffing API Documentation
Web/Resgrid.Web.Services/Resgrid.Web.Services.xml
Documentation metadata added for StaffingInput and StaffingResult types with fields: Uid, Typ, Not (input) and Uid, Nme, Typ, Tms, Not (result).
v4 API Models Documentation
Web/Resgrid.Web.Services/Resgrid.Web.Services.xml
Documentation extended for v4 personnel, protocols, and units models, including filter options, result types, and related data structures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Resgrid/Core#332: Both PRs modify the Twilio outbound voice call flow in OutboundVoiceProvider and TwilioController.
  • Resgrid/Core#237: Both PRs modify OutboundVoiceProvider.cs; this PR adds machine detection to the async CreateAsync flow established in that earlier change.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'RE1-T115 Outbound TTS work' is too vague and generic. While it references a ticket identifier, it uses non-descriptive language ('work') that doesn't convey what was actually changed. Replace with a more specific title describing the actual changes, such as 'Enable Twilio machine detection for outbound voice calls' or 'Add TTS enhancements for outbound voice calls'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Microsoft Presidio Analyzer (2.2.362)
Providers/Resgrid.Providers.Number/OutboundVoiceProvider.cs

Microsoft Presidio Analyzer failed to scan this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Web/Resgrid.Web.Services/Resgrid.Web.Services.xml`:
- Around line 7869-7877: The XML docs incorrectly describe personnel fields as
unit fields; update the <member> summaries for
Resgrid.Web.Services.Models.v4.PersonnelStaffing.SavePersonnelStaffingInput.UserId
to state it is the UserId of the personnel being staffed (not a UnitId), and for
SavePersonnelStaffingInput.Type change the summary to describe the personnel
staffing type/role (not UnitStateType). Also correct the
SavePersonnelStaffingsInput summary to reflect it accepts multiple UserIds
(i.e., applies to multiple users), not “for a single user.” Ensure you update
the <member> entries for SavePersonnelStaffingInput.UserId,
SavePersonnelStaffingInput.Type and SavePersonnelStaffingsInput summaries
accordingly so they accurately describe their purpose.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 09bb7943-be1b-4528-9526-4009d5635a95

📥 Commits

Reviewing files that changed from the base of the PR and between 034e26f and feb3018.

📒 Files selected for processing (3)
  • Providers/Resgrid.Providers.Number/OutboundVoiceProvider.cs
  • Web/Resgrid.Web.Services/Controllers/TwilioController.cs
  • Web/Resgrid.Web.Services/Resgrid.Web.Services.xml

Comment on lines +7869 to +7877
<member name="P:Resgrid.Web.Services.Models.v4.PersonnelStaffing.SavePersonnelStaffingInput.UserId">
<summary>
UnitId of the apparatus that the state is being set for
</summary>
</member>
<member name="P:Resgrid.Web.Services.Models.v4.PersonnelStaffing.SavePersonnelStaffingInput.Type">
<summary>
The UnitStateType of the Unit
</summary>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix incorrect field descriptions in Personnel Staffing input docs.

Line [7871] and Line [7876] describe SavePersonnelStaffingInput.UserId/Type as unit fields, and Line [7911] says SavePersonnelStaffingsInput is “for a single user” despite UserIds. This is misleading for API consumers.

Also applies to: 7910-7912

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Web/Resgrid.Web.Services/Resgrid.Web.Services.xml` around lines 7869 - 7877,
The XML docs incorrectly describe personnel fields as unit fields; update the
<member> summaries for
Resgrid.Web.Services.Models.v4.PersonnelStaffing.SavePersonnelStaffingInput.UserId
to state it is the UserId of the personnel being staffed (not a UnitId), and for
SavePersonnelStaffingInput.Type change the summary to describe the personnel
staffing type/role (not UnitStateType). Also correct the
SavePersonnelStaffingsInput summary to reflect it accepts multiple UserIds
(i.e., applies to multiple users), not “for a single user.” Ensure you update
the <member> entries for SavePersonnelStaffingInput.UserId,
SavePersonnelStaffingInput.Type and SavePersonnelStaffingsInput summaries
accordingly so they accurately describe their purpose.

@ucswift
Copy link
Copy Markdown
Member Author

ucswift commented May 7, 2026

Approve

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved.

@ucswift ucswift merged commit 3518a7c into master May 7, 2026
19 checks passed
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.

1 participant