RingCentral Telephony Integration
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The RingCentral Telephony Integration provides embedded communication capabilities within the Care Ops frontend application. This integration allows clinicians to manage outbound calls and track telephony interactions directly from the user interface. It is managed by a centralized Dialer Service that abstracts the complexity of different telephony providers, including RingCentral and Five9.
The integration utilizes an "Embeddable" approach, likely leveraging iframe-based communication or postMessage protocols common in CRM SDKs to facilitate seamless interaction between the RoundingWell platform and the RingCentral telephony service.
Sources: packages/care-ops-ringcentral/package.json:3, src/js/services/dialer.test.js:33-40
Architecture and Service Orchestration
Dialer Service
The DialerService acts as the primary controller for telephony operations. It is responsible for detecting the active provider (e.g., 'ringcentral') based on organization settings and initializing the corresponding integration module.
The Dialer Service handles the lifecycle of the telephony integration, ensuring that only one provider is active at a time and forwarding generic call requests to the provider-specific implementation.
Sources: src/js/services/dialer.test.js:80-100
Component Communication
The integration utilizes Backbone.Radio for decoupled messaging between the core application and the telephony packages. This allows the application to trigger calls or update the current patient context without direct coupling to the RingCentral implementation.
| Message Channel | Type | Purpose |
|---|---|---|
settings | Request | Retrieves the configured dialer provider ('ringcentral') |
dialer | Trigger | Notifies integration of change:currentPatientId |
entities | Request | Saves call artifacts (logs) to the backend |
Sources: src/js/services/dialer.test.js:42-45, src/js/services/dialer.test.js:107-115
Interaction Logic
Initialization and Data Sync
When the RingCentral provider is initialized, it receives a target UI region (typically an overlay) and a collection of patient models. This collection is kept in sync with the application's state to provide context-aware telephony features, such as matching incoming numbers to existing patient records.
Artifact Generation
Successful interactions through RingCentral result in the creation of call artifacts. These artifacts are saved as ringcentral-call-log entries, containing the specific callId and associated metadata.
// Example of artifact saving logic in Dialer Service
service.ringcentralCall({
callData: {
callId: 'abc1234',
},
});
Sources: src/js/services/dialer.test.js:63-75
Technical Implementation Details
Package Structure
The integration is housed within a dedicated workspace package: @roundingwell/care-ops-ringcentral. This encapsulation follows the repository's pattern of treating shared packages as stable entry points.
- Entry Point:
index.jsserves as the primary export for initialization and call methods. - Module Type: The package uses ES modules (
type: "module"). - Integration Method: Described as "RingCentral Embeddable integration".
Sources: packages/care-ops-ringcentral/package.json:1-7, CLAUDE.md:65-68
Cross-Frame Security and Communication
While specific to the Five9 SDK implementation in this repo, the underlying communication protocol for these embedded telephony integrations typically involves a message bus system using window.postMessage or MessageChannel. This architecture allows a "Master" frame (the main app) to communicate with "Remote" frames (the telephony embeddable) securely across different domains.
Conclusion
The RingCentral Telephony Integration is a modular component of the Care Ops platform, managed via the Dialer Service. By abstracting provider-specific logic into the @roundingwell/care-ops-ringcentral package, the application maintains a consistent API for telephony interactions while supporting specialized features like automatic call logging and patient context synchronization.