Voicemail Transcription via IBM Watson Update

I had been using the sendmail-bluemix script found on these forums quite some time ago. It all worked flawlessly across all my freepbx installs until recently. My IBM Watson API account had changed and been migrated to a different API and price plan and required different credentials and URL syntax to work. I didn’t see this update on the forums, so I thought I would post it in case anyone else comes looking.

Basically what I did was set the API_USERNAME variable equal to “apikey” and the API_PASSWORD variable set to my new API KEY from my IBM Watson account.

Then I updated the URL being called by curl to basically what was listed on my IBM Watson API account to use, but I had to append everything after ‘recognize’ including the question mark to get it to work, like:
https://api.us-south.speech-to-text.watson.cloud.ibm.com/instances/6be883bf-e4b6-47b0-a009-fafXXXXX1e1/v1/recognize?model=en-US_NarrowbandModel” 1>audio.txt

I hope this helps anyone else.


I was told we have 2 more weeks until we need to use the API token.

Did you get the email from Dan? I talk to Dan yesterday and he pointed me to his blog for how to fix it.
After reading it, it looking like a token is only good for an hour, so we need some way to get a new one every 55 minutes or something like that. Dan’s blog is here https://dtoczala.wordpress.com/2019/11/18/authentication-for-your-app-on-the-ibm-cloud/

Mulderlr, do you think you can fix this? I will donate to the cause.

@posi211 I am not going to use the token method because my VM to text transcription API calls do not make that many API calls to Watson to where that is required. So, the changes I mentioned above seem to be working fine and I had to implement it because the previous IAM access method and/or URL stopped working and I no longer had working transcription.

Also, I was not aware of Dan’s blog and just figured this out on my own.

I’m going to try it the way you explained and hope they don’t change it again.

Thanks for the quick response and for posting a solution to this issue.

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

I’ve been maintaining a script for this project as well, and only now getting it updated to the new API method: https://gist.github.com/lgaetz/2cd9c54fb1714e0d509f5f8215b3f5e6