{"id":1903,"date":"2024-04-30T11:03:46","date_gmt":"2024-04-30T15:03:46","guid":{"rendered":"https:\/\/www.unliterate.net\/?p=1903"},"modified":"2025-03-01T11:46:15","modified_gmt":"2025-03-01T16:46:15","slug":"still-trying-to-listen-to-skype-voicemails","status":"publish","type":"post","link":"https:\/\/www.unliterate.net\/index.php\/2024\/04\/30\/still-trying-to-listen-to-skype-voicemails\/","title":{"rendered":"Still trying to listen to Skype Voicemails&#8230;"},"content":{"rendered":"\n<p>This is a follow-up and a &#8220;get what I&#8217;ve done down&#8221; to<a href=\"\/index.php\/2022\/10\/02\/listening-to-skype-voicemail-dat-files\/\" data-type=\"link\" data-id=\"\/index.php\/2022\/10\/02\/listening-to-skype-voicemail-dat-files\/\"> Listening to Skype Voicemail .dat files<\/a>.<\/p>\n\n\n\n<p>I got back on the &#8220;Lets get these 70+ Skype voicemails listened to&#8221; bandwagon&#8230;<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">Filename relevance<\/h2>\n\n\n\n<p>I previously pondered the relevance of the filename that the voicemail was saved under and, aside from the embedding of the Unix timestamp as one of the 4 numerical sets I couldn&#8217;t really determine the actual relevance of the other 3 and what they actually imply. I went so far as to load <a href=\"https:\/\/www.nirsoft.net\/utils\/skype_log_view.html\">SkypeLogView<\/a> with my old database to see the Voicemail records and determine if any of that data could be correlated. Aside from database &#8220;Action Time&#8221; and Unix timestamp the short answer for additional correlation is a resounding no.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SILK -&gt; Opus<\/h2>\n\n\n\n<p>I was re-creating my Music collection from a long, long time ago, making sure I get FLACs instead of MP3s. My curiosity led me to look into FLACs and how awesome they were and I came across Opus.<\/p>\n\n\n\n<p>Looking into Opus and <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc6716\" target=\"_blank\" rel=\"noreferrer noopener\">it&#8217;s RFC 6716 spec<\/a> I saw it was extended from two previous codecs: SILK and CELT.<\/p>\n\n\n\n<p>SILK was originally on the standards track in 2010 as <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/draft-vos-silk-02\" data-type=\"link\" data-id=\"https:\/\/datatracker.ietf.org\/doc\/html\/draft-vos-silk-02\" target=\"_blank\" rel=\"noreferrer noopener\">draft-vos-silk-02<\/a> by Skype Technologies S.A., complete with encoder\/decoder. This overly tweaked my curiosity, but the voicemail file formats look nothing like what the Silk stream looks like, so I decided to dig deeper into the files&#8230;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">00 20 80 12<\/h2>\n\n\n\n<p>In deciding to look at the 1s and 0s of the voicemail files there wasn&#8217;t really a &#8220;file signature&#8221;, or a magic header that determined something specific. A large majority of the files either started off with 4 00s or with 00 20 80 12. Consequently the files that started off with 4 00s also had the 4-digit 00 20 80 12 afterwards. After writing <a href=\"https:\/\/github.com\/mjheick\/skype7server\/tree\/master\/dats\" data-type=\"link\" data-id=\"https:\/\/github.com\/mjheick\/skype7server\/tree\/master\/dats\" target=\"_blank\" rel=\"noreferrer noopener\">a couple files<\/a> and <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1ARAIpbNxMG2nlKnWfQ39lUdLBfV51LBwNJp-H6nSzQY\/edit?usp=sharing\" target=\"_blank\" rel=\"noreferrer noopener\">making a spreadsheet<\/a> to help visualize the data, and then later on <em>extending<\/em> the quantity of data I was looking at I was seeing that 00 20 80 12 was the <strong>start of a packet<\/strong> of data.<\/p>\n\n\n\n<p>In fact, the voicemail files contained a plethora of packets with 20 bytes of data curiously hidden:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>00 20 80 12 | header (magic number)\nxx xx xx xx | counter\nxx xx xx xx | counter\n00 00       | padding\nxx xx xx xx | data\nxx xx xx xx | data \nxx xx xx xx | data\nxx xx xx xx | data\nxx xx xx xx | data\n00 00       | padding (optional)<\/code><\/pre>\n\n\n\n<p>This was just a breakthrough for me. Writing a program to convert voicemails to &#8220;streams&#8221; of data helped to extract out the protocol junk and gave me data to attempt to plug into a TON of programs (again). Unfortunately, all those programs yielded static and more static.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Silk Encoder\/Decoder<\/h2>\n\n\n\n<p>Extracting all 140 files from draft-vos-silk-02 was a minor <a href=\"https:\/\/github.com\/mjheick\/skype7server\/blob\/master\/silk\/extract-draft-source.php\" target=\"_blank\" rel=\"noreferrer noopener\">editing\/programmatic<\/a> effort. After fixing a space\/tabs issue with the Makefile the build was able to create for me encoder and decoder.<\/p>\n\n\n\n<p>The source needed to be raw PCM data, so I grabbed a generic wav file from the interwebs and plugged it into encoder to get a bit file. Subsequently running the decoder on the bit file gave me back my raw PCM data that I could import into Audacity and verify that, in fact, this SILK program was working fine.<\/p>\n\n\n\n<p>Plugging in my previously-created voicemail\/stream files led to segfaults.<\/p>\n\n\n\n<p>Looking at both the decoder source code and the bit file I see that the decoder reads &#8220;packets&#8221; of data and then sends them to the decoder routine. The loop that loads the bit file was especially telling:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    for( i = 0; i &lt; MAX_LBRR_DELAY; i++ ) {\n        \/* Read payload size *\/\n        counter = fread( &amp;nBytes, sizeof( SKP_int16 ), 1, bitInFile );\n        \/* Read payload *\/\n        counter = fread( payloadEnd, sizeof( SKP_uint8 ), nBytes, bitInFile );\n        if( (SKP_int16)counter &lt; nBytes ) {\n            break;\n        }\n        nBytesPerPacket&#91; i ] = nBytes;\n        payloadEnd          += nBytes;\n    }<\/code><\/pre>\n\n\n\n<p>Read payload size (16 bits), then read payload.<\/p>\n\n\n\n<p>Modified my stream program to create the necessary bit files, where the payload size was a static 20 bytes followed by the voicemail data. Plugged all this into the decoder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ .\/decoder V1323104856M1M1000000417D396988293.bit out.pcm\n******************* Silk Decoder v 1.0.2 ****************\n******************* Compiled for 64 bit cpu *********\nInput:                       V1323104856M1M1000000417D396988293.bit\nOutput:                      out.pcm\n\nFrames decoded:              1SKP_Silk_SDK_Decode returned -10\nFrames decoded:              3SKP_Silk_SDK_Decode returned -10\nFrames decoded:              4SKP_Silk_SDK_Decode returned -12\nFrames decoded:              5SKP_Silk_SDK_Decode returned -12\nFrames decoded:              6SKP_Silk_SDK_Decode returned -12\nFrames decoded:              9SKP_Silk_SDK_Decode returned -12\nFrames decoded:              10SKP_Silk_SDK_Decode returned -12\nFrames decoded:              11SKP_Silk_SDK_Decode returned -12\nFrames decoded:              12SKP_Silk_SDK_Decode returned -12\nFrames decoded:              13SKP_Silk_SDK_Decode returned -12\nFrames decoded:              14SKP_Silk_SDK_Decode returned -10\nFrames decoded:              15SKP_Silk_SDK_Decode returned -10\nFrames decoded:              16Segmentation fault (core dumped)<\/code><\/pre>\n\n\n\n<p>Blasted. I didn&#8217;t go so far to see what the return codes implied or meant, or why the segfault happened on the 16th frame. I did, however, get an output file that I was able to plug into Audacity, and instead of hissing I got silence.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Where to go from here&#8230;<\/h2>\n\n\n\n<p>Knowing where to find the data was a large milestone from here. <\/p>\n\n\n\n<p>Knowing that it&#8217;s <em>not really raw SILK<\/em> that&#8217;s being stored is a good start but doesn&#8217;t completely eliminate it.<\/p>\n\n\n\n<p>Knowing that I could use Opus and create some generic Ogg-containerization routine to shove these streams into could be a next step.<\/p>\n\n\n\n<p>Being able to run Skype with a disassembly program to step through and see <em>exactly<\/em> what the program would be doing would be a timely process&#8230;<\/p>\n\n\n\n<p>Maybe while letting this sit for another 12+ months another idea would come along, or some discovered realization would set itself into my gourd and lead down a better path.<\/p>\n\n\n\n<p>Updating code\/scripts\/info at <a href=\"https:\/\/github.com\/mjheick\/skype7-voicemail-listener\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/github.com\/mjheick\/skype7-voicemail-listener<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a follow-up and a &#8220;get what I&#8217;ve done down&#8221; to Listening to Skype Voicemail .dat files. I got back on the &#8220;Lets get these 70+ Skype voicemails listened to&#8221; bandwagon&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,14,17,7],"tags":[],"class_list":["post-1903","post","type-post","status-publish","format-standard","hentry","category-geek-instructions","category-goals","category-linux","category-music"],"_links":{"self":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/comments?post=1903"}],"version-history":[{"count":6,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1903\/revisions"}],"predecessor-version":[{"id":2214,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/posts\/1903\/revisions\/2214"}],"wp:attachment":[{"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/media?parent=1903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/categories?post=1903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unliterate.net\/index.php\/wp-json\/wp\/v2\/tags?post=1903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}