Voicemail Transcription

We have google based voicemail transcription on several PBXes. It quit working. The transcriptions using a glcloud script that uses ACCESSTOKEN to authenticate to google cloud apps. I do not see too many of the several scripts running around using such. Here is an example of the code in the script:

ACCESSTOKEN is derived from the curl output below. This token is used to authenticate to the google cloud storage API to send and remove the voicemail recordings for transcription.
This token expires every hour, so this script will request a new ACCESS TOKEN for each voicemail to transcribe to keep things fresh.

ACCESSTOKEN=$(curl
–request POST
–data “client_id=${ClientID}&client_secret=${ClientSECRET}&refresh_token=${REFRESHtoken}&grant_type=refresh_token”
https://accounts.google.com/o/oauth2/token)
ACCESSTOKEN=$((echo $ACCESSTOKEN) | jq ‘.access_token’)
ACCESSTOKEN=$(echo “${ACCESSTOKEN//”/}")
#echo $ACCESSTOKEN

The other scripts I see, such as Tony722 in github, has the following statement to install GCloud CLI and establish authentication. “Follow steps 1 and 2 of the instructions on Google Cloud Installing the gcloud CLI  |  Google Cloud

That page on google says, do the following to establish authentication:
sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-cli]
name=Google Cloud CLI
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el8-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM

Is either of these approaches better than the other? drawbacks of either?
Why cant I make the gcloud CLI install work - not the best linux admin here!!

For anybody looking for this in the future - pull the script from Freepbx Voicemail Transcription Script: Google Speech API · GitHub. It is a fork of tony722 script with some minor, but nice, enhancements (found at Freepbx Voicemail Transcription Script: Google Speech API · GitHub)

When you download the script it will walk you through setting up OAuth authentication in its comment lines at its beginning. Remember if you are using the FreePBX distro, DNF is not supported, so just use the yum command “yum install google-cloud-cli” when the script instructions say “Follow steps 1 and 2 of the instructions on Google Cloud Como instalar a CLI gcloud  |  Google Cloud

BTW - setup your google cloud account at: https://console.cloud.google.com

Your first PBX will take you 45-90 mins to setup. You next will take you 5 mins

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.