HOWTO Backup your iPhone Voicemail with sender number and timestamp (using linux/macosx/cygwin)

Here’s how to backup all your iPhone Voicemails, in case your voicemail inbox is full. (requires a JB iPhone)
Run the following script in a machine with sqlite installed:

#!/bin/bash

#your iPhone IP:
IP='192.168.0.12';

USR='root';
VOICEMAILPATH='/private/var/mobile/Library/Voicemail';
scp "$USR@$IP:$VOICEMAILPATH/{voicemail.db,*.amr}" .
sqlite3 -column voicemail.db "select ROWID||'.amr '||replace(replace(datetime(date,'unixepoch','localtime'),' ','-'),':','_')||'_'||sender||'_('||ROWID||').amr' from voicemail" | xargs -n 2 -t mv

All your voicemail files (.amr files) will be copied to your machine with a filename like %Y-%m-%d %H_%M_%S_sendernumber(id).amr, ex: “2010-04-28-22_50_56_+33630027552(19).amr”

Expected output:

~/Desktop/voicemail$ ./voicemail.sh 
voicemail.db         100%   28KB  28.0KB/s   00:01
19.amr                       100%   12KB  11.8KB/s   00:00
20.amr                       100%   21KB  20.9KB/s   00:00
mv 19.amr 2010-04-28-22-50-56_+336xxxxxxxx_(19).amr
mv 20.amr 2010-05-01-16-20-26_+336xxxxxxxx_(20).amr

Leave a Reply