An item that has been on my todo list for a very long time, is finding a better way to handle voicemail.
Our Fritz!Box FON 7170 has a built-in Answering machine and a USB stick inserted into the back side. The files related to the answering machine are all stored on the USB stick and those files are all accessible by ftp and/or SMB. So everything is accessible, but finding out what to do with those files just never happened – until recently.
OK, where to start… The voicebox\rec directory contains a lot of small files, called rec.0.000, rec.0.001, and so on. I know these so-called rec files contain the encoded audio of the voice mail, but there’s no information about the phone number of the caller, time & date, the called number etc. I also knew that these ‘rec’ files could be converted to WAV format by a speexdec tool that can be found on the net. Half way there.
The missing information I mentioned above had to be found somewhere else, so I examined the rest of the files in the voicebox directory. I noticed that a file called meta0 had a time-stamp that was equal to the date & time of the last voice-mail we received, so let’s have a look inside meta0:
00000000h: 5C 01 00 00 00 00 00 00 03 00 00 00 00 53 07 00 ; \............S.. 00000010h: 16 1D 00 00 07 00 00 00 01 00 00 00 01 00 00 00 ; ................ 00000020h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000030h: 00 00 00 00 30 31 32 33 34 35 36 37 38 39 00 00 ; ....0123456789.. 00000040h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000050h: 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ............... 00000060h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000070h: 00 00 00 00 00 00 00 00 00 00 00 00 72 65 63 2E ; ............rec. 00000080h: 30 2E 30 30 30 00 00 00 00 00 00 00 00 00 00 00 ; 0.000........... 00000090h: 00 00 00 00 00 00 00 00 00 00 00 00 2F 76 61 72 ; ............/var 000000a0h: 2F 6D 65 64 69 61 2F 66 74 70 2F 55 53 42 46 6C ; /media/ftp/USBFl 000000b0h: 61 73 68 4D 65 6D 6F 72 79 2D 30 31 2F 46 52 49 ; ashMemory-01/FRI 000000c0h: 54 5A 2F 76 6F 69 63 65 62 6F 78 2F 72 65 63 2F ; TZ/voicebox/rec/ 000000d0h: 72 65 63 2E 30 2E 30 30 30 00 00 00 00 00 00 00 ; rec.0.000....... 000000e0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000000f0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000100h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000110h: 00 00 00 00 00 00 00 00 00 00 00 00 13 0B 09 0B ; ................ 00000120h: 12 00 00 00 E8 8B 66 25 00 0C AB 2A 50 00 01 00 ; ....è‹f%..«*P... 00000130h: 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 ; ........ ....... 00000140h: 30 31 32 33 34 35 36 37 38 39 00 00 00 00 00 00 ; 0123456789...... 00000150h: 00 00 00 00 00 00 00 00 00 00 00 00 5C 01 00 00 ; ............\... 00000160h: 01 00 00 00 03 00 00 00 00 53 07 00 2D 10 00 00 ; .........S..-... 00000170h: 06 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 ; ................ 00000180h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 00000190h: 39 38 37 36 35 34 33 32 31 30 00 00 00 00 00 00 ; 9876543210...... 000001a0h: 00 00 00 00 00 00 00 00 00 00 00 00 20 00 00 00 ; ............ ... 000001b0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001c0h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; ................ 000001d0h: 00 00 00 00 00 00 00 00 72 65 63 2E 30 2E 30 30 ; ........rec.0.00 000001e0h: 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ; 1............... 000001f0h: 00 00 00 00 00 00 00 00 2F 76 61 72 2F 6D 65 64 ; ......../var/med 00000200h: 69 61 2F 66 74 70 2F 55 53 42 46 6C 61 73 68 4D ; ia/ftp/USBFlashM
Hmm, this is interesting. I see phonenumbers, file names, even including path, so I’m looking in the right file.
Let’s see if I can find a record size or something else with which I can determine the bytes that belong to a single voice mail. The first filename I found starts at position $007C and the second one starts at position $01D8. $01D8-$007C = 472-124=348 ($015C). Hey, that’s the first 2 bytes in the file! And at position $015C those 2 bytes are found again.. and again.. all the way to the end of the file.
So I think this is some sort of data file with variable length records, where the first (2?) bytes contain the length of the record that is following those 2 bytes (in this case, all the records have a length of $015C). If I’m right, the rest of the information I’m looking for per voice-mail, has to be somewhere inside those 348 bytes. Besides 2 phonenumbers and a filename, it would also be nice to have a date & time.
So I asked everybody to not pick up the phone so that I could leave a new message on the Fritz answering machine and examined the meta0 file to see if I could find the known date & time somewhere. Ha! 5 bytes, containing year-2000, month, day, hour and minute, starting at offset $011C. And I also managed to find the voice mail duration in seconds (offset $0014) and the file size. There are still some bytes of which I don’t know the meaning, but this is enough to start with I guess!
With this information from the meta file and some code I can easily present a grid with voice mail information on the Touchscreen. I can even add a ‘play’ button to listen to those voice mail(s)! Adding a ‘new’ indicator to those voice mails which will be reset once the wav file has been played.
Wait, I can even play this wav file from my cell phone – a notification with a url in the message body and I’m done – lots of new opportunities!
Once I’ve got it all working here at home, I’ll upgrade my Homeseer Fritz!Box Plugin and make a nice web interface for listening to the voicemail.

http://www.partsim.com/