Skip to content

fix(cc-components): show dialed number instead of entrypoint for outdial calls#657

Open
bhabalan wants to merge 4 commits intowebex:nextfrom
bhabalan:CAI-7359
Open

fix(cc-components): show dialed number instead of entrypoint for outdial calls#657
bhabalan wants to merge 4 commits intowebex:nextfrom
bhabalan:CAI-7359

Conversation

@bhabalan
Copy link
Copy Markdown
Contributor

@bhabalan bhabalan commented Mar 18, 2026

COMPLETES CAI-7359

This pull request addresses

Two related display issues in the CallControlCAD, IncomingTask, and TaskList widgets:

  1. Caller ID (title): Outdial calls incorrectly showed the entrypoint number (ANI) instead of the dialed number (DN) in the caller ID across all three task display surfaces.
  2. Phone Number field (CAD section): The Phone Number field in CallControlCAD was showing dn (entry point/DNIS) instead of ani (the actual phone number) for both inbound and outdial calls, mismatching the desktop client.

by making the following changes

Caller ID fix (title display)

  • Modified extractIncomingTaskData in incoming-task.utils.tsx to check outboundType === 'OUTDIAL' and use dn (dialed number) instead of ani for the title
  • Applied the same fix to extractTaskListItemData in task-list.utils.ts for the task list display
  • Updated CallControlCAD component to use a callerNumber variable (dn || ani for outdial, ani for inbound) for the caller ID
  • Falls back to ani if dn is not available, maintaining backward compatibility

Phone Number field fix (CAD section)

  • Changed renderPhoneNumber in CallControlCAD to use ani instead of dn, matching desktop client behavior:
    • Inbound: Phone Number = ani (caller's number)
    • Outdial: Phone Number = ani (customer's number dialed by agent)

Tests

  • Added outdial test suites for incoming-task.utils (7 tests) and task-list.utils (7 tests) covering: outdial title display, dn fallback to ani, empty dn fallback, CALLBACK outboundType, social media outdial, and button states
  • Added dn field to CallControlCAD unit test mock data to verify dn is not incorrectly used for Phone Number
  • Added inbound vs outdial phone number display test in CallControlCAD
  • Updated 9 snapshots reflecting the Phone Number field now correctly showing ani

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

Vidcast: https://app.vidcast.io/share/2e933e24-985f-49a1-ad81-99c31f444c63

  • The testing is done with the amplify link
  • Unit tests added/updated and passing (647 tests, all passing, 224 snapshots)
  • Inbound call: Caller ID shows ANI, Phone Number shows ANI (matches desktop)
  • Outdial call: Caller ID shows DN, Phone Number shows ANI (matches desktop)
  • Outdial task falls back to ANI when DN is unavailable
  • Inbound telephony tasks continue to show ANI as caller ID (non-regression)
  • Social media tasks continue to use customerName (non-regression)

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 - Claude Code
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

Checklist before merging

  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the testing document
  • I have tested the functionality with amplify link

Make sure to have followed the contributing guidelines before submitting.

…ial calls

When making an outdial call via dialpad, the incoming task, task list, and
active task were incorrectly showing the entrypoint number (ANI) instead of
the actual dialed number (DN). This fix checks for outboundType === 'OUTDIAL'
and uses the DN field from callAssociatedDetails for the title display.

CAI-7359
@bhabalan bhabalan marked this pull request as ready for review March 18, 2026 02:33
@bhabalan bhabalan requested a review from a team as a code owner March 18, 2026 02:33
});
});

describe('Outdial tasks', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Add more comprehensive tests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added 8 comprehensive test cases (4 for IncomingTask, 4 for TaskList) covering:

  • Empty dn string fallback to ani
  • CALLBACK outboundType correctly uses ani (not dn)
  • Social media outdial tasks use customerName
  • Non-browser outdial button states (Ringing..., disabled accept)

Also fixed 3 prettier lint errors in source files. All 646 tests passing.

@bhabalan bhabalan added the validated Indicates that the PR is ready for actions label Mar 18, 2026
@aws-amplify-us-east-2
Copy link
Copy Markdown

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

Access this pull request here: https://pr-657.d1b38q61t1z947.amplifyapp.com

…lint errors

Add 4 new test cases each for IncomingTask and TaskList outdial scenarios:
- Empty dn string fallback to ani
- CALLBACK outboundType uses ani (not dn)
- Social media outdial uses customerName
- Non-browser outdial button states

Fix prettier formatting in source files.

CAI-7359
… ID and phone number for inbound and outdial calls

Refactor logic to determine caller number based on call type, ensuring that for inbound calls, the caller ID is derived from ANI, while for outdial calls, it uses DN for caller ID and ANI for the phone number. Update tests to validate these changes and ensure accurate rendering in various scenarios.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de91094576

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


const renderPhoneNumber = () => {
const phoneText = isSocial ? customerName || NO_CUSTOMER_NAME : dn || NO_PHONE_NUMBER;
const phoneText = isSocial ? customerName || NO_CUSTOMER_NAME : ani || NO_PHONE_NUMBER;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit phone-number override to telephony interactions

The new phoneText expression now uses ani for every non-social interaction, not just telephony. In CallControlCAD, chat/email/SMS tasks are non-social, so their ANI (often an email/handle or channel identifier) is now shown under the literal Phone Number label; this is visible in the updated chat-media-type snapshot where chat-customer@example.com replaced No Phone Number. That broadens a telephony-specific fix into digital channels and can present incorrect/misleading data to agents.

Useful? React with 👍 / 👎.

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

Labels

validated Indicates that the PR is ready for actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant