In part 1 of this article, I gave an example of how to use Voicemail for Amazon Connect solution to be able to send voicemail from IVR to group email or to group cell phone as SMS.
Now I would like to show how to add the ability to send voicemail messages to Queue.
The idea is that we will piggyback on the Voicemail solution built by Amazon:
- Whenever their solution does voicemail transcription it adds this information to DynamoDB table.
- We will create Lambda function that is triggered when a new record is added to this table.
- This lambda function in turn will gather all the available information about voicemail (voicemail timestamp, contact phone number, queue name, voicemail transcript, URL to voicemail message)
- It will then generate a Task that will have all this information and will send it to the queue.
- An agent will receive a Task contact with all the available information about voicemail including transcript and link to a voicemail message that can be played back in the browser.
- Contact Phone number - caller id
- Datetime - time when the client left a voicemail
- QueueName
- QueueID - this is a technical field that is required for the proper work of this solution
- Voicemail Transcript
- URL to the actual voicemail message
4) When Agent clicks on URL - it will open player in the separate browser window, which gives agent option to listen to the actual voicemail message.
5) Agent can also click on contactPhoneNumber and that will automatically initiate an outbound call.
- Since we already sent a voicemail to the queue it means that all the contact center stats and features (real-time reports, historical reports, contact search, Contact Lens) - will be automatically available
- You can use all the available Amazon Connect KPIs for voicemail
- In the contact search you will see a voicemail transcript
- If needed you can still be able to send voicemail by Email/SMS at the same time
It is the same step that we had to do in part 1 of this article. So if you already did it in part 1 - no need to do it again.
It is fairly simple - just need to follow this implementation guide. It usually takes about 1 hour
https://docs.aws.amazon.com/solutions/latest/voicemail-for-amazon-connect/welcome.html
After it is implemented you need to test it and make sure it works, make sure that you can log in to Amazon Connect Voicemail Management Portal and can actually receive voicemail.
Now we will create a "fake" agent account that will be used as a group voicemail box
- First name = "VM"
- Last name = must be equal to Name of Queue (for example "Tech_support")
- Login name = must be equal to VM.<Name of the queue> (example VM.Tech_support)
- Emal address - group email address that will be used to receive voicemails
Other parameters for this user can be anything you want because you would not need to log in to Amazon Connect with this user.
IMPORTANT:
For this solution to work correctly Login name must be in the following format
VM.<Name of the queue> (example VM.Tech_support)
It is the same step that we had to do in part 1 of this article. So if you already did it in part 1 - no need to do it again.
Now you need to login into your Amazon Connect Voicemail Management Portal.
1) Click on SYNC AGENTS button and your new user should appear in the list2) Click on your VM user and configure it as required.
3) First thing you need to assign any extension that will be used to reference this agent in IVR.
In my case I assigned extension 7000.
4) Now you need to make sure to enable the following options:
- Transcribe
- Encrypt
- Delivery Options - Email
This is required for the correct work of the solution. If you do not want to receive email notifications - you can assign to user a non-existent email address, but the delivery option must be enabled.
The next step is to create a new contact flow SendTask that is required to send tasks to the queue.
- Select Use attribute option.
- Type - User Defined
- Attribute - QueueID
and after that our flow uses Transfer to queue block to actually transfer task to the queue.
You can download this flow from my GitHub:
https://github.com/contactcenterdude/amazon-connect/blob/main/Voicemail/SendTask-flow.json
Before we can move to the next step - you need to get Contact Flow ID that will be required in future steps.
- Click on Show additional flow information.
- In the ARN string Flow ID is the last 36 characters after contact-flow/
- Amazon-Connect-Voicemail-VoicemailStack-1O9JZHZJ8ZD7Y-UsersTable-4DLIYWATXZ7T
- Amazon-Connect-Voicemail-VoicemailStack-1O9JZHZJ8ZD7Y-ContactVoicemailTable-10UMQELMDZKAJ
Now we will need to add lambda function create_Voicemail_Task that actually creates Task with voicemail info. This function is written in Python 3.9.
How it works:
- gets info from ContactVoicemailTable. this table is used by Voicemail to keep results of voicemail transcription
- if the transcription is completed it starts gathering data that will be added to Amazon Connect Task
- contact phone number
- timestamp
- queue name
- queue id
- URL to voicemail wav file
- voicemail transcript
- creates Amazon Connect Task
Source code available on my GitHub:
https://github.com/contactcenterdude/amazon-connect/blob/main/Voicemail/create_Voicemail_Task.py
- In AWS Management console open Lambda
- Go to your function
- Go to Configuration - General configuration
- Click edit and change timeout to 10 seconds
- On line 8 - you need to specify ARN of your S3 bucket that is used for storing voicemails:
- You can connect to S3 from the management console and find a bucket that has voicemail-vo-audiorecordingsbucket in the name.
Now we need to add a trigger to our lambda function create_Voicemail_Task.
It will be triggered every time there is a new record added to ContactVoicemailTable table.
How to do it:
1) Go to Lambda and open our function create_Voicemail_Task
2) Click Add Trigger and create a new DynamoDB trigger
- Trigger configuration - DynamoDB
- DynamoDB table - find your ContactVoicemailTable
- Batch size = 10
- Starting position = TRIM_HORIZON
- other configuration - by default
This is how it looks in my case.
You can download this module from my GitHub:
https://github.com/contactcenterdude/amazon-connect/blob/main/Voicemail/Transfer_to_VM_module.json
Import it to your Amazon Connect instance.
It is the same step that we had to do in part 1 of this article. So if you already did it in part 1 - no need to do it again.
Now we can use our module in any IVR flow.
I created a simple VoicemailDemo flow. It emulates a situation when you want to offer client to leave a voicemail during non-working hours.
How it works.
1) At first I play the message "Our contact center is currently closed, please call us tomorrow. If you want to leave us a voicemail press 1".
2) If a client enters 1
* First we need to add Set contact attributes block and assign voicemail user extension 7000 to user-defined attribute extensionNumber
* second - I invoke module Transfer_to_VM
Here is a full screenshot of VoicemailDemo flow
You can download it from my GitHub:
https://github.com/contactcenterdude/amazon-connect/blob/main/Voicemail/VoicemailDemo_flow.json
Step 11 (optional) .
It is the same step that we had to do in part 1 of this article. So if you already did it in part 1 - no need to do it again.
In steps 9 and 10 I gave you examples of how to offer the voicemail option in IVR before the call was transferred to queue.
What if you want to offer voicemail for the call that is already waiting in the queue?
I created another demo flow WaitInQueue_with_VM that demonstrates how to do it.
Important:
1) This is Customer queue flow so in order to use it you have to use Set customer queue flow in your main IVR before call is transferred to queue.
2) Amazon Connect does not allow to use of modules in Customer queue flows (hopefully this functionality would be added in the future). So I had to copy all the blocks from my module directly to customer queue flow.
3) Again, you have to assign an extension to extensionNumber attribute using Set contact attributes block like we did it before.
You can download this flow from my Github
**********
This solution is a little bit more complicated than my previous articles. So if you have any questions do not hesitate to contact me either in the comments or using the contact form on my site.
No comments:
Post a Comment