-
Notifications
You must be signed in to change notification settings - Fork 364
feat(outdial): added auto answer functionality for Outdial call #4207
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: next
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe changes introduce a new function, 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. 🔧 ESLint
yarn install v1.22.22 (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this 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
🧹 Nitpick comments (2)
docs/samples/contact-center/app.js (2)
454-454
: Consider using await for task.acceptIf
task.accept()
returns a Promise, it should be awaited to ensure the call is properly accepted before updating the UI state.-task.accept(task.data.interactionId); +await task.accept(task.data.interactionId);This would require changing the function to be async:
-function autoAnswerOutdial(task) { +async function autoAnswerOutdial(task) {
450-462
: Add validation for task parameterThe function should validate that the task parameter exists and has the expected properties before attempting to use them.
function autoAnswerOutdial(task) { try { + if (!task || !task.data || !task.data.interactionId) { + console.error('Invalid task object provided to autoAnswerOutdial'); + return; + } console.log('Auto-answering the outdial call'); task.accept(task.data.interactionId); answerElm.disabled = true; declineElm.disabled = true; incomingDetailsElm.innerText = 'Outdial call auto-answered'; console.log('Outdial call auto-answered successfully'); } catch (error) { console.error('Failed to auto-answer the outdial call', error); } }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/samples/contact-center/app.js
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
docs/samples/contact-center/app.js (1)
packages/@webex/plugin-cc/src/logger-proxy.ts (1)
error
(35-39)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Build Packages
- GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (1)
docs/samples/contact-center/app.js (1)
450-462
: Well-structured function for auto-answering outdial callsThe new
autoAnswerOutdial
function is clearly implemented with proper error handling using try-catch. It effectively updates the UI state and provides logging for both success and error scenarios.
// Auto-answer the outdial call | ||
autoAnswerOutdial(outdialTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reference error: outdialTask
is undefined
The autoAnswerOutdial
function is called with outdialTask
which is not defined in the current scope. This will cause a runtime error when the function is executed.
// Auto-answer the outdial call
-autoAnswerOutdial(outdialTask);
+const outdialTask = await webex.cc.startOutdial(destination);
+autoAnswerOutdial(outdialTask);
Alternatively, if the task is returned from the startOutdial
call:
// Auto-answer the outdial call
-autoAnswerOutdial(outdialTask);
+const task = await webex.cc.startOutdial(destination);
+autoAnswerOutdial(task);
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// Auto-answer the outdial call | |
autoAnswerOutdial(outdialTask); | |
// Auto-answer the outdial call | |
const outdialTask = await webex.cc.startOutdial(destination); | |
autoAnswerOutdial(outdialTask); |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
Had a quick discussion with the team, we are speculating that this is more of feature-flag controlled functionality rather than a default function. |
COMPLETES <NO JIRA - ADHOC>
This pull request addresses
Added auto answer functionality for Outdial call
by making the following changes
Made changes in CC Sample App.
Change Type
The following scenarios were tested
Tested the CC SDK functionality end to end to ensure nothing breaks.
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.