Author Topic: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?  (Read 3073 times)

Offline Twinsen

  • Contributer
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Hey Guys,

I won't bore you with the details why, but I am so close to achieving what I need to do - wondering if anyone knows how it is done - shared my batch file as well in case it helps anyone else

I am writing a batch file which will run every hour from a local machine and pull out new VM recordings\convert to wav and put them on a dropbox, I was almost finished but then ran into the road block where it seems the VM files are obfuscated and it is a requirement that I have the number associated with the VM - sort of how you get it when you do VM to EMAIL and it comes as a WAV

PS, I can not use SMPT the 3300 controller is completely offline


Tools I used;
  • WINSCP to handle proper timestamp and better than windows ftp client
  • sox for audio conversion


My Main Batch File:

Code: [Select]
@echo off
echo *
echo * Process Recordings for Processing
echo * Gavan Walker
echo *  21.10.2015
echo *
echo * Grabbing VoiceMail Messages
echo *start /wait winscp /script=commandsv2.dat
echo * Copy Raw files for processing
robocopy c:\temp\raw c:\temp\temp
echo * Renaming Files to Correct readable Timestamps
setlocal enabledelayedexpansion
cd c:\temp\temp
ren *.*  *.raw

for /r %%i in (*.raw) do ( C:\sox\Sox.exe  -r 8000 -t raw -L -G -e u-law -b 8 -c 1 --norm %%i c:\temp\processed\%%~ni.wav  )


FYI if anyone else is interested, the commandsv2.dat contents are:
*YYYY is Voicebox number
*XXX is your Mitel Admin password

Code: [Select]
option batch abort
option confirm off
open ftp://Gavan:XXXX@192.168.101.2
synchronize -nopreservetime -criteria=none local c:\temp\raw  /vmail/d/vm/grp/YYYY
byer

the above scrips retrieves the contents of the VM & then processes to WAV - however I need to get the associated phone number from the recording -  the file names: (2 VM examples below);
V56258f55.00c
V562599b3.00d


It is easy enough to get them out, convert them to a wav format -> but how can I get the associated number which left the VM?
Hoping the name just needs to be converted with some basic function.

Any help would really be appreciated.

Cheers



« Last Edit: October 20, 2015, 09:41:21 PM by Twinsen »


Offline matthew

  • Full Member
  • ***
  • Posts: 123
  • Country: au
  • Karma: +2/-0
    • View Profile
Re: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?
« Reply #1 on: October 21, 2015, 02:56:46 AM »
Sorry, I don't have a direct answer to your question, but I wanted to thank you for sharing your code.


PS, I can not use SMPT the 3300 controller is completely offline


Well, not completely - you're able to access it from another machine, which could run an SMTP service. There's plenty of free ones around. I'd personally probably run Linux in a Virtualbox VM and do something in there.

Still, programmatically pulling the attachment out of an email might have it's own challenges depending on how you approach it.

Offline ralph

  • Mitel Forums Admin
  • Hero Member
  • *****
  • Posts: 5767
  • Country: us
  • Karma: +469/-0
  • Published Author: http://amzn.to/2dcYSY5
    • View Profile
Re: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?
« Reply #2 on: October 21, 2015, 08:14:13 AM »
I hope you can get this to work.
I was thinking of something similar but my thought was to have each mailbox email it to a linux server and then have it forwarded from there.
I can see the problem of not knowing which mailbox a message belongs to.  I don't know a way around that.

Ralph

Offline acejavelin

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4099
  • Country: us
  • Karma: +133/-0
  • High-tech, heavy metal redneck!
    • View Profile
    • Like what I do and wanna help out? Send me a donation!
Re: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?
« Reply #3 on: October 21, 2015, 10:44:53 AM »
I use a MSL server to do this, just install MSL,doesn't have to be licensed, on a box and use it as an email relay... works well.

Offline ralph

  • Mitel Forums Admin
  • Hero Member
  • *****
  • Posts: 5767
  • Country: us
  • Karma: +469/-0
  • Published Author: http://amzn.to/2dcYSY5
    • View Profile
Re: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?
« Reply #4 on: October 21, 2015, 11:38:19 AM »
Ace,
Did you ever think about trying to convert that wav file to Speech to Text  or to MP3 while in transit?

Ralph

Offline acejavelin

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4099
  • Country: us
  • Karma: +133/-0
  • High-tech, heavy metal redneck!
    • View Profile
    • Like what I do and wanna help out? Send me a donation!
Re: FTP to retrieve VM, convert to WAV - How To Get Phone Number associated?
« Reply #5 on: October 21, 2015, 02:09:03 PM »
Ace,
Did you ever think about trying to convert that wav file to Speech to Text  or to MP3 while in transit?

Ralph
No, but we do this when either there is no easily accessible email server, or the phone system cannot be on on a network with direct internet connection, but it's been a while. We just use it as a email relay.


 

Sitemap 1 2 3 4 5 6 7 8 9 10