TUTORIAL VM to email with MP3 attachments

Discussion in 'PIAF 3 Add-Ons' started by paulnye, Nov 22, 2011.

  1. paulnye

    paulnye Guru

    Joined:
    Apr 17, 2011
    Messages:
    202
    Likes Received:
    2
    The email notifications attach a WAV file with the recorded message that someone left you. It would be way better if it could be a MP3 file instead, that way I could play the sound clip right inside my email message (using gmail). For WAV files its a pain :-(
     
  2. rossiv

    rossiv Guru

    Joined:
    Oct 26, 2008
    Messages:
    2,626
    Likes Received:
    138
    I think you can change the format in the voicemail config files. Would certainly require considerably more CPU power, though.
     
  3. paulnye

    paulnye Guru

    Joined:
    Apr 17, 2011
    Messages:
    202
    Likes Received:
    2
    Before posting I searched in the gui, and searched in the 'voicemail admin' module to see if it was obvious, but couldnt find anything to change from wav to mp3. I would willingly sacrifice CPU capacity for this as I hardly see it go over 5% usage. Will I need to edit a config file manually do you think?
     
  4. rossiv

    rossiv Guru

    Joined:
    Oct 26, 2008
    Messages:
    2,626
    Likes Received:
    138
  5. paulnye

    paulnye Guru

    Joined:
    Apr 17, 2011
    Messages:
    202
    Likes Received:
    2
    found this field in Voicemail Admin..

    [​IMG]

    -----

    but cant find any documentation on the allowed syntax. So far I tried mp3, wav49|mp3, mp3|mp3 etc... but when leaving a message you hear the persons greeting, then immediately after you hear, 'press one to accept..' (so it doesnt let you leave a message) BUT, I did get an MP3 file attachment.
    I feel that If I knew the syntax, I could get it working without trying to install a 3rd party script (Im a linux noob)
     
  6. rossiv

    rossiv Guru

    Joined:
    Oct 26, 2008
    Messages:
    2,626
    Likes Received:
    138
    Using that script, I got a 0k MP3 attachment. :(
    Will keep working on it.
     
  7. rossiv

    rossiv Guru

    Joined:
    Oct 26, 2008
    Messages:
    2,626
    Likes Received:
    138
  8. paulnye

    paulnye Guru

    Joined:
    Apr 17, 2011
    Messages:
    202
    Likes Received:
    2
  9. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,432
    Likes Received:
    2,450
    This was lost in the disaster, but to bring it current...

    NOTE: Originally coded by Delta End, Inc for version 1.0 and 2.0

    UPDATED on 10/11/14 to support playback on all iPhones and Android devices. See this thread.

    With FreePBX 2.11, to get voicemail messages delivered by email in a format you can actually listen to on your computer or cellphone plus optional 15-second transcription of message...

    NOTE: This modified script now works with Incredible PBX for Raspberry Pi as well.

    Log into your server as root. If you want transcription, before running the script, edit installmp3stt.sh and change transcribe=0 to transcribe=1.

    Code:
    cd /root
    wget http://pbxinaflash.com/installmp3stt.sh
    chmod +x installmp3stt.sh
    ./installmp3stt.sh
    
    Log into FreePBX 2.11 and choose Settings, Voicemail Admin, Settings:

    Code:
    format: wav|wav49
    mailcmd: /usr/sbin/sendmailmp3
    
     
  10. krzykat

    krzykat Guru

    Joined:
    Aug 2, 2008
    Messages:
    1,368
    Likes Received:
    327
    I remember there was a thread that had this combined with having speech to text. So you could have the e-mail sent out with the MP3 coupled with the dictation of the message so that one could read it as well as listen to it. Was this that thread or does anyone know where that one is?
     
  11. Cam__

    Cam__ Member

    Joined:
    May 22, 2013
    Messages:
    43
    Likes Received:
    8
    If I found the right one, the title of that thread was "Voicemails as MP3 Attachments with Google Transcription" and as far as I can tell from a quick check, Google's cache has some but not all of the pages. However there is enough there to reveal that at the end it had stopped working for all practical purposes because Google had reduced the amount of Speech to Text it would do to the first 15 seconds. If you want to see what is still available, search on that title and view the cached version, then for subsequent pages right click on the page numbers (on the cached page) and copy the link addresses, then put each address into a new Google search with the word "cache:" at the beginning. It appeared to me that out of seven pages, two were missing.

    Here are links to the five pages I found:

    http://webcache.googleusercontent.com/search?q=cache:http://pbxinaflash.com/community/index.php?threads/voicemails-as-mp3-attachments-with-google-transcription.14923/

    http://webcache.googleusercontent.com/search?q=cache:http://pbxinaflash.com/community/index.php?threads/voicemails-as-mp3-attachments-with-google-transcription.14923/page-2

    http://webcache.googleusercontent.com/search?q=cache:http://pbxinaflash.com/community/index.php?threads/voicemails-as-mp3-attachments-with-google-transcription.14923/page-4

    http://webcache.googleusercontent.com/search?q=cache:http://pbxinaflash.com/community/index.php?threads/voicemails-as-mp3-attachments-with-google-transcription.14923/page-5

    http://webcache.googleusercontent.com/search?q=cache:http://pbxinaflash.com/community/index.php?threads/voicemails-as-mp3-attachments-with-google-transcription.14923/page-7

    Pages 3 and 6 are missing.
     
  12. matt91

    matt91 Member

    Joined:
    Jul 29, 2010
    Messages:
    58
    Likes Received:
    5
    Ran this last week on PIAF-Green, and it worked fine.

    1. Log into your server via SSH as root and...

    Code:
     
    cd /root
    wget -N http://pbxinaflash.com/installmp3stt.sh
    chmod 0755 installmp3stt.sh
    ./installmp3stt.sh
    
    2. In FreePBX, choose Settings -> Voicemail Admin -> Settings, make the following changes, then click Submit and Reload FreePBX.

    Code:
    format -> wav
    mailcmd -> /usr/sbin/sendmailmp3
    
    3. Leave yourself a voicemail and you should see the first 30 seconds of the voicemail transcribed for you.

    From krzykat:
     
    peterbata, krzykat and Cam__ like this.
  13. krzykat

    krzykat Guru

    Joined:
    Aug 2, 2008
    Messages:
    1,368
    Likes Received:
    327
    Worked like a charm. I think this should be the default setup for voicemail.
     
  14. matt91

    matt91 Member

    Joined:
    Jul 29, 2010
    Messages:
    58
    Likes Received:
    5
    There are a couple of dependencies that are needed on the Pi - lame and flac maybe? It was in that thread. i'll try to look later on, in case someone on a stock Pi wants to use this too.
     
  15. tm1000

    tm1000 Schmoozecom INC/FreePBX

    Joined:
    Dec 1, 2009
    Messages:
    1,360
    Likes Received:
    77
    It's against Google TOS as far as I am aware so it would never been a default setup.

     
  16. wardmundy

    wardmundy Nerd Uno

    Joined:
    Oct 12, 2007
    Messages:
    14,432
    Likes Received:
    2,450
    Link please?
     
  17. matt91

    matt91 Member

    Joined:
    Jul 29, 2010
    Messages:
    58
    Likes Received:
    5
    I tried a few times on my two Pi's, and it never auto-installed the dependencies. I seen to recall that the ARM check wasn't working on all Pi's for some reason.
     
  18. tim

    tim New Member

    Joined:
    Jun 24, 2011
    Messages:
    6
    Likes Received:
    2
    I'm not running a standard PiaF image (green on XEN, both 32 and 64-bit, pretty modified), but I thought I'd let folks know that lame installation in the script failed with my default setup. From the other posts, it looks like the repositories are set up in the suported PiaF distros so this wouldn't be an issue, but it was for me. I added a repo that has lame, yum installed it, and it works like a champ.

    I put in /etc/yum.repos.d/linuxtech.repo:

    Code:
    [linuxtech]
    name=LinuxTECH
    baseurl=http://pkgrepo.linuxtech.net/el6/release/
    enabled=1
    gpgcheck=1
    gpgkey=http://pkgrepo.linuxtech.net/el6/release/RPM-GPG-KEY-LinuxTECH.NET
    Thanks everyone, this is great!
     
  19. tim

    tim New Member

    Joined:
    Jun 24, 2011
    Messages:
    6
    Likes Received:
    2
    By the way, Ward, I really like the new forum. I didn't realize how much I've relied on your forum for the last six or seven years until it was gone -- it was like the googs for asterisk, freepbx, and PiaF (every google result that was worth anything led here). I'm glad it's back and I'm glad you decided to leap headstrong into the 21st century with the new backend :) .

    Thank you, and thanks to everyone who contributes. This is an invaluable resource.

    Best,
    Tim
     
    wardmundy likes this.
  20. krzykat

    krzykat Guru

    Joined:
    Aug 2, 2008
    Messages:
    1,368
    Likes Received:
    327
    Does anyone else have issues with this? The transcription portion is not working any longer for me.