Skip to content

Inbound call with IVR menu: Appointment Booking #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajitht-msft
Copy link
Contributor

@ajitht-msft ajitht-msft commented May 29, 2023

Purpose

Call Contoso Dental office to confirm your appointment: Inbound call with IVR menu.

User dials Dentist’s office number.
Call is answered by CA endpoint.
Start recording
Play Audio – “Welcome to Contoso Dental’s virtual booking center. This call is being recorded for quality purposes. Please pick from the following times to select an appointment with your dentist.”
Play Audio - “Press 1 for 9:30am, Press 2 for 10:30am, Press 3 for 11:30am.”
Receive dtmf input.
Play audio –

if pressed 1 -> “Thank you for confirming your appointment at 9:30am. We look forward to seeing you, goodbye.”

if pressed 2 -> “Thank you for confirming your appointment at 10:30am. We look forward to seeing you, goodbye.” 

if pressed 3 -> “Thank you for confirming your appointment at 11:30am. We look forward to seeing you, goodbye.” 

any other key-> "I'm sorry that is not a valid input, please choose from the options provided"

Play Audio -  “Press 1 for 9:30am, Press 2 for 10:30am, Press 3 for 11:30am.” 
Terminate the call.
Recording should end too.

Does this introduce a breaking change?

[ ] Yes
[x ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@ajitht-msft ajitht-msft changed the title initial commit Inbound call with IVR menu: Appointment Booking May 29, 2023

Choose a reason for hiding this comment

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

I believe we don't check-in this file. It's auto generated in build process.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok will remove it

validationResponse: event.data.validationCode
});
}
else {
Copy link

@vivekmore-msft vivekmore-msft May 30, 2023

Choose a reason for hiding this comment

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

We need to check for incoming call event for answering call


await callContext.callConnection.getCallMedia().playToAll(audioPrompt);
} catch (error) {
console.error('An error occurred while playing audio prompt:', error);

Choose a reason for hiding this comment

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

Not rethrowing catched exception


// Process and handle the received tone input
switch (tone) {
case "one":

Choose a reason for hiding this comment

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

Can we use Enums instead of string?

else {
const eventType = event.type;
console.log("Received Unexpected event: " + eventType + ". Terminating Call.");
callAutomationService.hangUpCall();

Choose a reason for hiding this comment

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

I don't think we should hangUpCall here as we may get extra events due to other components changes.


// Method to hang up the call
async hangUpCall() {
await callContext.acsClient.getCallRecording().stop(callContext.recordingId);

Choose a reason for hiding this comment

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

Need to handle exceptions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants