Introduction
Voicemail transcription is the process of converting a voicemail message left by a caller into text format. This text version of the voicemail message can be viewed in a user’s email or messaging app, making it easier to quickly understand the content of the message without having to listen to the entire voicemail.
It can be a useful tool for improving productivity and communication in both personal and business settings. By providing a quick and easy way to read voicemail messages, it can help users save time and stay organized, especially when dealing with a large volume of messages.
Voicemail transcription can be a good option for several reasons:
-
- Saves time: With voicemail transcription, you can quickly read through the message and get the gist of what the caller wanted to convey without having to listen to the entire message. This can be especially helpful when you’re busy and don’t have time to listen to a long voicemail.
-
- Improves accessibility: Voicemail transcription makes it easier for people with hearing impairments or deafness to understand the message. It can also be useful for people who are in a noisy environment and cannot listen to the voicemail.
-
- Increases accuracy: Sometimes voicemails can be garbled or difficult to understand, particularly if the caller has a strong accent or there is background noise. Voicemail transcription can help eliminate these issues and provide an accurate representation of the message.
-
- Convenience: With voicemail transcription, you can access your voicemails through email, text message, or a web portal, which can be more convenient than having to call your voicemail box.
Preparing VitalPBX to be able to send email
Email Settings
To be able to send Voicemail by email in VitalPBX it is necessary to have an email account and configure it in ADMIN/System Settings/Email Settings.
You must configure all the fields and do the email test.
Extension
Now we go to the extensions that we want to configure so that when a voicemail arrives, it is sent by email.
We configure the Email Address in the GENERAL TAB.
And in the VOICEMAIL TAB we enable the VoiceMail.
Configuring Google Cloud
Let’s assume that you already have a Google Cloud account, so the first step is to be logged in and go to the Console section to create a new project, for which we go to the list of projects in the upper left. A pop-up screen will appear, and in the upper right-hand corner, we click on NEW PROJECT.
Now we go to the hamburger menu (three lines icon) on the left and select APIs & Services/Enabled APIs & Services. We press +ENABLED APIS AND SERVICES and look for “Cloud Speech-to-Text API,” and enable it.
Now we go to the main menu Cloud Overview/Dashboard, and with our selected project, we copy the Project ID that we will use later in the installation process on the VitalPBX server.
Note:
Google Cloud gives us 60 minutes a month. After these 60 minutes, we will have to pay US$ 0.024 per additional minute.
Google Cloud CLI Installation
Now we return to the VitalPBX console to install and configure the necessary components.
Pre-requisites
Install Required Dependencies for Google Cloud CLI.
apt install curl apt-transport-https gnupg jq sox flac dos2unix gnupg
You can acquire the public Key for Google Cloud by executing the following command:
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add –
Use the following command to add the gcloud CLI distribution URI as a packet source:
echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
Run the following command to update and install the gcloud CLI:
apt-get update && sudo apt-get install google-cloud-cli
Use the following command to initialize the gcloud CLI:
gcloud init
You must log in to continue. Would you like to log in (Y/n)? Y
Go to the following link in your browser:
Google Cloud Link Show here
Enter authorization code:
We proceed to log into our Google Cloud account, pasting the content of the URL in our browser, select the account and give it Allow and copy the code and paste it.
Now that we are in our account, we select the project we want to use, in our case it is [7]. If for some reason the project does not appear you can select the option Enter a project ID.
You are logged in as: [vitalpbx@gmail.com].
Pick cloud project to use:
[1] animated-test-999999
[2] vitalpbx-99999
[3] vitalpbx-99998
[4] vitalpbx-99997
[5] vitalpbx-99996
[6] vitalpbx-99995
[7] vitalpbxvoicemailtranscription
[8] vpbx-99994
[9] Enter a project ID
[10] Create a new project
Please enter numeric choice or text value (must exactly match list item): 7
Now we can use Cloud Speech to Text from Google. For which we will do the following test.
gcloud ml speech recognize 'gs://cloud-samples-tests/speech/brooklyn.flac' --language-code='en-US'
If all is well, it should return something like this.
{
"requestId": "634647649735242593",
"results": [
{
"alternatives": [
{
"confidence": 0.9828748,
"transcript": "how old is the Brooklyn Bridge"
}
],
"languageCode": "en-us",
"resultEndTime": "1.770s"
}
],
"totalBilledTime": "2s"
}
Now we are going to authorize the Asterisk user to also have access to Google Cloud.
We change the user in the Linux console.
su -s /bin/bash asterisk
We now request access to Google Cloud. And we do the same procedure as in the previous step.
gcloud auth login
Finally, we do the test, and it should give us the same result as before.
gcloud ml speech recognize 'gs://cloud-samples-tests/speech/brooklyn.flac' --language-code='en-US'
Now we download the sendmail-gcloud file and copy it to /usr/sbin/
wget https://raw.githubusercontent.com/VitalPBX/vitalpbx-voicemail-transcription-google-cloud/main/sendmail-gcloud /usr/sbin/
Later we create the file voicemail__60-general.conf in /etc/Asterisk/vitalpbx/
nano /etc/asterisk/vitalpbx/voicemail__60-general.conf
And include the following content.
[general](+)
;You override the default program to send e-mail to use the script
mailcmd=/usr/sbin/sendmail-gcloud
Now we assign the corresponding permissions.
cd /usr/sbin/
chown asterisk:asterisk sendmail-gcloud
chmod 744 sendmail-gcloud
chmod 777 /usr/bin/dos2unix
Finally, we do a reload of the voicemail module.
asterisk -rx"module reload app_voicemail.so"
Conclusion
Overall, voicemail transcription can be a useful tool for anyone who receives voicemails regularly, and it can provide several benefits, including time savings, improved accessibility, increased accuracy, and convenience.