Skip to content

Conversation

@akulakum
Copy link
Contributor

@akulakum akulakum commented Nov 14, 2025

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:

  • WebRTC calls with auto-answer enabled in the agent profile.
  • Agent-initiated outbound calls (WebRTC and digital channels)

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

  1. 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

  2. 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)

  3. 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

@akulakum akulakum requested a review from a team as a code owner November 14, 2025 13:38
@akulakum akulakum added the validated If the pull request is validated for automation. label Nov 14, 2025
@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4571.d3m3l2kee0btzx.amplifyapp.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant