This guide will shows how to use Google Cloud to add speech-to-text voicemail transcription to voicemail notification email messages.
1) The first thing you need to do is to have a Google Cloud account, you can request a free account for testing here
2) Now we need to install Google Cloud SDK package, just go to your CLI and type this as root: (just copy&paste and hit Enter)
We add the repository first
3) We need to download the bash script which will be the one for sending the emails and converting audio files to text. (just copy this file to your PBX on /usr/sbin)
If you need to change the language, just change this line: (change the en-US to your language)
4) You will need some extra packages, just type this on your CLI:
5) Type these commands:
6) Now it's time to go to your Google Cloud Platform and create a new project or use the one you already have.
Inside our project, we search for Cloud Speech to API and we enable it.
Finally, if you go to your projects, you will see your project ID, keep it cause we will need that in a few.
7) Go back to the CLI and do this:
You will be asked to copy a URL and paste on your browser, you have to select your Google Cloud account and then accept the Google Cloud SDK permission.
Finally, you should see a code which is your verification code, you need to paste that on your CLI
If the above command gives you the warning 'You are authorizing gcloud CLI without access to a web browser...' without the direct URL to paste on the browser, add the --no-launch-browser so it looks like this: gcloud auth login --no-launch-browser
The last thing we need from the CLI is to tell gcloud which is our project.
8) We are almost done, go to your FreePBX web interface
Settings > Voicemail Admin > Settings > Email Config
Change Mail Command to: /usr/sbin/sendmail-gcloud
Submit and apply changes
Ok, we just need to make a test now and see how it goes, if everything went ok you should see something like this: