fix(handle-auto-answer): implement-auto-answer-for-desktop-calls #4571
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.
COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-7323
Vidcast Link: https://app.vidcast.io/share/7babff72-18e8-459a-bf67-2727b3256273
This pull request addresses
The need to support automatic task acceptance for contact center agents in specific scenarios, improving agent efficiency and user experience. Currently, agents must manually accept all incoming tasks, which creates unnecessary delays in certain workflows such as:
Additionally, this PR adds support for the AGENT_OFFER_CAMPAIGN_RESERVATION event, which was missing from the SDK's event handling syst
by making the following changes
Auto-Answer Infrastructure
Added helper functions in TaskUtils.ts to determine auto-answer eligibility:
isAutoAnswerEnabled() - Checks if auto-answer is enabled in agent profile
isWebRTCCall() - Validates WebRTC telephony calls
isDigitalOutbound() - Identifies digital outbound interactions (Email/SMS)
isAgentInitiatedOutdial() - Verifies agent-initiated outdial scenarios
shouldAutoAnswerTask() - Main orchestrator that evaluates all auto-answer conditions
TaskManager Integration
Added handleAutoAnswer() private method that automatically accepts tasks when conditions are met
Integrated auto-answer logic into three event handlers:
AGENT_OFFER_CONTACT - Standard contact offers
AGENT_OFFER_CONSULT - Consultation offers
AGENT_OFFER_CAMPAIGN_RESERVATION - Campaign reservation offers (new)
Campaign Reservation Support
Added AGENT_OFFER_CAMPAIGN_RESERVATION to CC_TASK_EVENTS for automatic task lookup
Created new SDK event: TASK_EVENTS.TASK_OFFER_CAMPAIGN_RESERVATION
Implemented event handler in TaskManager.ts following the same pattern as other offer events
Added event listener in sample app (app.js)
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.