SOLVED Transcribing Voicemails with IBM Bluemix

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,082
Reaction score
2,601

We're going to write this up on Nerd Vittles in a couple weeks, but we wanted to give the pioneers a head start.

The scripts use IBM's Bluemix Speech to Text API to transcribe voicemails and then deliver both the transcribed message and the .WAV or .MP3 attachment via email.

Bluemix services are free for the first month. After that, your first 1,000 STT minutes each month are free. Then it's $.04 per minute.

We've taken Nicolas Bernaerts' sendmailmp3 script and reworked it to support IBM's Bluemix API.

We've completed the scripts for Incredible PBX for Wazo and Incredible PBX for the Raspberry Pi 3 and Incredible PBX 13 (CentOS or Ubuntu 14).

Create an IBM Bluemix Speech to Text Account

1. Create Bluemix account here: https://console.ng.bluemix.net/registration/?target=/catalog/?category=watson

2. Confirm registration by replying to email

3. Login to Bluemix: https://console.ng.bluemix.net/login?state=/catalog/?category=watson

4. Agree to T&C, name your organization, and name your space (STT)

5. Choose Watson Speech to Text service and click Create

6. When Speech to Text-kb opens, click Service Credentials tab

7. In Actions column, click View Credentials and copy your username and password

8. Insert deciphered Bluemix API username and password below.

9. Logout by clicking on image icon in upper right corner of dialog window

Install IBM Bluemix STT Engine for Incredible PBX for Wazo

1. Log into your Incredible PBX for Wazo server as root using SSH/Putty and issue the following commands:
Code:
cd /usr/sbin
wget http://incrediblepbx.com/sendmailibm.tar.gz
tar zxvf sendmailibm.tar.gz
rm -f sendmailibm.tar.gz
2. Edit sendmailibm and insert your Bluemix credentials on lines 29 and 30. Save the file.

3. Edit bluemix-test and insert your Bluemix credentials on the first two lines. Save the file.

4. Copy the updated sendmailibm file to sendmail:
Code:
cd /usr/sbin
cp -p sendmailibm sendmail
5. Test your Bluemix API setup: bluemix-test

6. Result should be: please record your message after the beep

7. Make certain that you have set up a voicemail account for a Wazo extension with your email address

8. Place a test call and record a voicemail when prompted

9. Your message will be transcribed and delivered via email


Install IBM Bluemix STT Engine for Incredible PBX for Raspbian 8

1. Log into your Incredible PBX for Raspberry Pi 3 server as root using SSH/Putty and issue the following commands:
Code:
cd /usr/sbin
wget http://incrediblepbx.com/sendmailibm-raspi.tar.gz
tar zxvf sendmailibm-raspi.tar.gz
rm -f sendmailibm-raspi.tar.gz
2. Edit sendmailmp3.ibm and insert your Bluemix credentials on lines 28 and 29. Save the file.

3. Edit bluemix-test and insert your Bluemix credentials on the first two lines. Save the file.

4. Copy the updated sendmailmp3.ibm file to sendmailmp3:
Code:
cd /usr/sbin
cp -p sendmailmp3.ibm sendmailmp3
5. Test your Bluemix API setup: bluemix-test

6. Result should be: your dictation is now being processed and emailed please wait

7. Make certain that you have set up voicemail for a RasPi extension with your email address

8. Log into the GUI and choose Settings, Voicemail Admin, Settings:

Code:
format: wav|wav49
mailcmd: /usr/sbin/sendmailmp3
9. Place a test call and record a voicemail when prompted

10. Your message will be transcribed and delivered via email

Install IBM Bluemix STT Engine for Incredible PBX 13

1. Log into your Incredible PBX 13 server as root using SSH/Putty and issue the following commands:
Code:
cd /usr/local/sbin
wget http://incrediblepbx.com/sendmailibm-13.tar.gz
tar zxvf sendmailibm-13.tar.gz
rm -f sendmailibm-13.tar.gz
2. Edit sendmailmp3.ibm and insert your Bluemix credentials on lines 28 and 29. Save the file.

3. Edit bluemix-test and insert your Bluemix credentials on the first two lines. Save the file.

4. Copy the updated sendmailmp3.ibm file to sendmailmp3:
Code:
cd /usr/local/sbin
cp -p sendmailmp3.ibm sendmailmp3
5. Test your Bluemix API setup: bluemix-test

6. Result should be: we are now transferring you out of the company directory please hold on for further assistance

7. Make certain that you have set up voicemail for an Incredible PBX 13 extension with your email address

8. Log into the GUI and choose Settings, Voicemail Admin, Settings:

Code:
format: wav|wav49
mailcmd: /usr/local/sbin/sendmailmp3
9. Place a test call and record a voicemail when prompted

10. Your message will be transcribed and delivered via email
 
Last edited:

tbrummell

Guru
Joined
Jan 8, 2011
Messages
625
Reaction score
66
No comments? Wow!

There is a small problem in the path on step 4 of the Incredible PBX 13 steps. It should be /usr/local/sbin.

I can confirm it works, I like the %HESITATION variable for every-time I paused while leaving myself a test message. :)
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,082
Reaction score
2,601
No comments? Wow!

There is a small problem in the path on step 4 of the Incredible PBX 13 steps. It should be /usr/local/sbin.

I can confirm it works, I like the %HESITATION variable for every-time I paused while leaving myself a test message. :)
Fixed. Thanks.
 

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
529
Reaction score
77
One other area which may need changes: i was using sendmailmp3 when google transcription was working. Because of that, I needed to edit the Settings -> Voicemail Admin -> Settings area under mailcmd and repoint to the new location of the script. I'm not sure that this is mentioned anywhere.

In any event, once the last edit was made, transcription (although seemingly not as good as we once had) is working.

Andrew
 
Last edited by a moderator:
  • Like
Reactions: wardmundy

phinphan

Active Member
Joined
Oct 19, 2007
Messages
419
Reaction score
36
Ward, any chance this will work on older pbx in a flash system (.2.0.6.4) on centos 6.4. The original sendmail.mp3 worked fine until google quit. I have avoided upgrading because this system has served us well for more than 3 years.

--EDIT -- Nevermind. Tried it and it works perfect. Thanks to all for this great update. 1,000 minutes per month will take care of my small office just fine.
 
Last edited:
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,082
Reaction score
2,601
@ostridge Please excuse our U.S.-centric view of the universe. That may be changing as millions migrate to other countries in coming months. :patriot:
 

Matthew Darnell

New Member
Joined
Mar 24, 2017
Messages
2
Reaction score
2
We had an issue where some of the programs used by the script were not installed - unix2dos and lame to be exact. Yummed unix2dos and compiled lame & everything is working perfectly.

The thing we are looking to update is the parsing of phone numbers. Right now it spells out the numbers "eight zero eight three five six zero zero zero zero", would be nice if it was presented as "(808) 356-0000".
 
  • Like
Reactions: wardmundy

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,082
Reaction score
2,601
We had an issue where some of the programs used by the script were not installed - unix2dos and lame to be exact. Yummed unix2dos and compiled lame & everything is working perfectly.

The thing we are looking to update is the parsing of phone numbers. Right now it spells out the numbers "eight zero eight three five six zero zero zero zero", would be nice if it was presented as "(808) 356-0000".
Just curious. What was your original platform?? Just want to be sure we haven't dropped the ball on one of our builds.

Phone number issue is worth pursuing. Bluemix has a forum so perhaps a post there might turn up a fix.
 

Matthew Darnell

New Member
Joined
Mar 24, 2017
Messages
2
Reaction score
2
The original platform was stock FreePBX 10.13.66 - brought it up to test this out.

I will comment on the bluemix forum, great thought. There are other smaller things, like it will spell out 'oh', very common for people to say 'oh' when they mean zero.
 
  • Like
Reactions: wardmundy

lynchpat

New Member
Joined
Apr 30, 2017
Messages
1
Reaction score
0
I installed successfully and the test was successful however I am not receiving the transcribed VM's. Prior to install I was getting voicemail notifications after install I no longer get the message. Tail of mail.log shows the following.

May 8 16:40:31 wazo postfix/qmgr[1292]: 3F75561CAB: from=<[email protected]>, size=781, nrcpt=1 (queue active)
May 8 16:40:31 wazo postfix/smtp[26351]: 3F75561CAB: to=<[email protected]>, relay=aspmx.l.google.com[]:25, delay=2229, delays=2229/0.04/0.22/0.13, dsn=2.0.0, status=sent (250 2.0.0 OK 1494279631 g10si13771028qte.110 - gsmtp)
May 8 16:46:34 wazo postfix/sendmail[27199]: fatal: asterisk(111): No recipient addresses found in message header
May 8 16:49:25 wazo postfix/sendmail[27326]: fatal: asterisk(111): No recipient addresses found in message header
May 8 17:09:24 wazo postfix/sendmail[30443]: fatal: asterisk(111): No recipient addresses found in message header

Any ideas? Thanks
 

Christian

New Member
Joined
Sep 16, 2013
Messages
4
Reaction score
1
Hi,
If I want the french transcription I need to take the fr_FR-broadband model which is 16khz, and actually only narrowband work within this script. Any plan to adapt a script for other language limited to broadband?

And BTW thanks for this awesome idea and development.
 
  • Like
Reactions: wardmundy

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
529
Reaction score
77
Having added a credit card to the BlueMix site, I can now receive transcriptions again.

However, there seems to be something slightly wrong with the version of the script I'm using (format issue, the translation works).

the line in sendmailmp3
Code:
echo "\r\n\r\n Message contents: $TRANSCRIPT" >> stream.new
creates an email with the text "\r\n\r\n Message .....". (ie the '\r\n\r\n is printed in the email)

I'm guessing that these are supposed to be newlines - which is what I want.

What should I edit this line to be so that it just inserts a pair of returns before the "Message contents:" as well as a return after "Message contents" but before the translation?

Thanks


Andrew
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
601
Reaction score
74
Location
Bangor, ME USA
Somehow these clowns (site is IBM .. emails are softlayer) don't like my discover card and want me to call a number --- how gullable do they think I am? -- Can't put in my card and their CS is canned responses. Oh well - another part I can't use.
 

AndyInNYC

Active Member
Joined
May 23, 2013
Messages
529
Reaction score
77
Does anyone have a quick fix for me for my post (two up) where I'm printing 'codes' instead of getting newlines in the message? I'd just delete them, but I would like the spacing the newlines would provide for easier reading/better formatting.

Andrew
 

billsimon

Experienced in Asterisk, FreePBX, and SIP
Joined
Jan 2, 2011
Messages
947
Reaction score
294
Does anyone have a quick fix for me for my post (two up) where I'm printing 'codes' instead of getting newlines in the message? I'd just delete them, but I would like the spacing the newlines would provide for easier reading/better formatting.

Andrew
Months later... here is the quick fix. "echo -e"

The -e switch tells echo to interpret the escape sequences (\r\n)
 
  • Like
Reactions: wardmundy

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,319
Messages
137,016
Members
14,549
Latest member
mawa1213