Build a RingCentral Virtual Voicemail Assistant for Your Business   — Part 1

Disable user greeting and connecting message

Turn off Forwarding Sequences

Last but not least, you can set the “User Hours” option to 24 hours and 7 days a week to make your virtual voicemail assistant work around the clock.

Set User Hours

That’s pretty much all you need to setup for the voicemail inbox using the RingCentral service dashboard. The next question is how do you access the voicemail programmatically to build your virtual voicemail assistant? The RingCentral Developer platform allows you to access to a growing number of APIs and integrate rich communication features into your application.

Get New Voicemail Notification

RingCentral platform supports real-time push notifications. It is an event-triggered mechanism to get notified when something happens to the service you are observing. You can choose between PubNub or Webhooks delivery mechanism to get notifications.

To get notified when there is a new voicemail arriving in a voicemail inbox, you can subscribe to the voicemail event for that particular user (inbox). What data comes together in a voicemail notification message? Below is a typical payload of a voicemail event:

{ "uuid":"473993724243953516", "event":"/restapi/v1.0/account/~/extension/~/voicemail", "timestamp":"2019-06-16T21:27:06.525Z", "subscriptionId":"c204cdb4-d8b0-4b3e-808a-xxxx", "ownerId":"17800xxxx", "body":{ "uri":'https://api.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1054xxxx', "id": 1054xxxx, "to": [ { "phoneNumber": '+1650513xxxx', "name": '(650) 513-xxxx', "location": 'San Mateo, CA' } ], "from": { "phoneNumber": '+1650224xxxx', "name": 'Henry Taylor', "location": 'Mountain View, CA' }, "type": 'VoiceMail', "creationTime": '2019-06-16T22:17:27.000Z', "readStatus": 'Unread', "priority": 'Normal', "attachments": [ { "id": 1054xxxx, "uri":'https://media.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1054xxxx/content/1054xxxx', "type": 'AudioRecording', "contentType": 'audio/mpeg', "vmDuration": 11 },{ "id": 2406yyyy, "uri": 'https://media.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1054xxxx/content/2406yyyy', "type": 'AudioTranscription', "contentType": 'text/plain', "vmDuration": 11, "fileName": 'transcription' } ], "direction": 'Inbound', "availability": 'Alive', "messageStatus": 'Received', "lastModifiedTime": '2019-06-16T22:17:41.584Z', "vmTranscriptionStatus": 'Completed' }

There is some key information you will be interested in  —  the “to” phone number and the voicemail attachments.

Who Just Left a Voicemail?

Obviously, the “to” phone number is the caller’s phone number. This is the key information for you to identify the caller’s identity. You can search for the phone number from your customer database to check if the caller is your customer or not. If the caller is a known customer, you can pull the necessary information of that customer from your database to get ready for the conversation with the customer when you make a call back. What if the caller’s identity is unrecognized? It can be an existing customer who uses a different phone number, it can be a potential customer, or it can be some spammer or scammer whom you really want to flag and ignore.

Scam Call Detection

Like email, voicemail is also another popular channel for scammers and spammers to exploit. Sometimes you can recognize a scam phone number if you’ve seen it several times earlier. But most of the time you’ll find out if a voicemail is spammy or not only after you start listening to it. That makes spam voicemails extremely disturbing when you are overwhelmed with real customers’ voicemails. So, you don’t want to see spam voicemails in your voicemail list, or do you?

Your virtual voicemail assistant should be able to identify and flag such non-business voicemail for you. The fastest way to identify a spammy voicemail is to look up for the caller’s phone number from a blacklist if you have one. If you don’t have a blacklist or cannot detect from your own blacklist, you can use online services such as the phone reputation detection from WhitePages, to enquire for a detailed report of a phone number.

The response from WhitePages’s Phone Reputation service contains detailed reputation information of a phone number. You might be interested in a couple of key attributes — the reputation level and the category — that help you make a quick decision if a voicemail is a spam or not.

The reputation level is a score number ranging from 1 to 4; with 1 indicating high confidence that the phone number has not been associated with spam/risky behavior and 4 indicating high confidence that this is a spammy/risky number. You can use the reputation score to classify a caller’s number as follow:

1: Clean; 2: Likely; 3: Highly; 4: Risky

The category label specifies the type of spam or scam associated with the phone number. Here is a list of categories the Phone Reputation API could identify:

Not Spam — Debt Collector — Telemarketer — Political Call — Phone Survey — Phishing — Extortion — IRS Scam — Tax Scam — Tech Support Scam — Vacation Scam — Lucky Winner Scam — Scam — NonProfit — Robocaller — TollFree Pumping — Other Spam

You can use the categories above to indicate the source of a voicemail. Optionally, for those voicemails came from your customers, you can specify a value of 1 to the reputation score and a label “Customer” for the category.

You can also detect a spammy voicemail by analyzing the voicemail content using AI technology. But let’s explore that feature later when we discuss about AI solutions.

Access the Voicemail Audio

The voicemail audio content can be accessed via the attachment URI from the notification body.

{ "id": 1054xxxx, "uri": 'https://media.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1054xxxx/content/1054xxxx', "type": 'AudioRecording', "contentType": 'audio/mpeg', "vmDuration": 11
}

Now that you’ll get notified when there is a new voicemail; you’ll know the caller’s identity so you can avoid spending time on those spam voicemails and you’ll be able to listen to the voicemail audio. But your virtual voicemail assistant should do more to help you organize and prioritize your voicemail list. The challenge is how to make it recognize human speeches and understand the message for making decisions like a real assistant.

You are thinking about AI and machine learning right now, right? You have to develop NLP (Natural Language Processing) algorithms and statistical models to build the brain of your virtual assistant. It is a sophisticated project that normally it would take years to turn from technical concepts into an actual model in production.

Today, fortunately, you don’t always need to develop your own machine learning algorithms for your AI solutions. Many companies provide AI services such as speech recognition, language detection, sentiment analysis, concept extraction etc. Most of the services are accessible on-demand via their cloud API platform. Your focus will be shifted from developing such complicated technology to creating great user experience and choosing the best AI solution available on the market for your application.

Now, let’s move on to explore the AI services you would need for this project.

Voicemail Transcription

Most of the RingCentral service plans include the Voicemail-to-Text feature. This means that all voicemails will be automatically transcribed. You can set the Voicemail to Text option from the RingCentral service dashboard mentioned earlier at the “Messages” section.

If the Voicemail to Text option is set, you can access the voicemail transcript via the attachment URI from the notification body.

{ "id": 2406yyyy, "uri": 'https://media.ringcentral.com/restapi/v1.0/account/~/extension/~/message-store/1054xxxx/content/2406yyyy', "type": 'AudioTranscription', "contentType": 'text/plain', "vmDuration": 11, "fileName": 'transcription'
}

For testing on the sandbox environment or for other reasons if you cannot use the transcription service from RingCentral (e.g. support other languages than English), you can use any Speech-to-Text service provided by many AI leading companies such as Google, AWS, IBM, Rev.ai, VoiceBase, AI Sense etc. to transcribe a voicemail.

The more accurate the voicemail transcript is, the better your virtual assistant would be able to process the customer’s message

Getting the voicemail transcript is just the first step of preparation for the data analysis.

Define Objectives

In customer services, sometimes the FIFS (First In First Serve) model is not preferable as you might want to give higher priority to a customer who needs urgent help. Assign a customer’s case automatically to an agent based on competency and skills would also improve response time for your customer service, thus, increase your customer satisfaction.

So, your virtual voicemail assistant must be able to identify a voicemail urgency and to categorize the voicemail message then assign it to the right agent.

Train Your Dataset

Unfortunately, some generic AI services are not the perfect solutions for certain types of problems you are trying to solve. You can use general sentiment analysis to detect the common sense of customer satisfaction — how much they like or dislike something, but not necessarily about your product. You can also use the generic categorization from Google AI service to categorize your customer’s problems. However, you will find it very hard to map their predefined categories into your own product or service categories.

Luckily, some leading AI companies let you customize the service to meet your expectations. In other words, they let you use their machine learning algorithms to train your own dataset.

To obtain a great data model that fits your customer service context, you must collect as many real sample messages as possible for your dataset, then train it with appropriate machine learning algorithms. Think of the dataset as a maths book with lots of addition and subtraction exercises. The more exercises you practice, the more knowledge about addition and subtraction you’ll gain.

Different companies provide different methods to train custom datasets. Some allow you to choose algorithms, some automatically select the most suitable algorithms based on the type of model you selected. MonkeyLearn is one of the leading AI companies that provides easy ways to train custom datasets for different service models. They also provide lots of demo models for quick evaluations.

MonkeyLearn AI services Dashboard

Auto Reply With an SMS Message

To enhance the customer experiences, you can instantly send a reply SMS message to notify the callers that you have received their message and will call them back as soon as you can. Of course, you are not going to reply to spammers nor trying to send an SMS message if the caller’s phone number is not a mobile phone number.

There are different ways to detect if the caller’s number is a mobile number. Once you identify if the caller is one of your customers, you can check from the customer database has contact number type then we can check the phone number from the customer database. If not, you can use WhitePages Phone Intelligence API to detect if a number is a mobile phone number.

To send a reply SMS message, all you need is to compose a relevant message and send it using RingCentral SMS API.

Try the Virtual Voicemail Assistant Demo

Click here to start the app and login with your own RingCentral user credentials. Open the Help page for detailed instructions.

Stay tuned for Part 2 where I discuss how the demo was built.

Further Reading

Build and Graduate Your App in RingCentral

Getting Started With RingCentral APIs

This UrIoTNews article is syndicated fromDzone