Renaming record filename, problem with the relation of 2 recorded files when a call is transferred

I made the appropriate modifications from the thread:
http://www.freepbx.org/forum/freepbx/users/renaming-recording-file-name#comment-54032

I have a last thing to do for having recorded files meet my needs. All in calls come in one ext and that person than transfer the call to the right ext. In this case I have 2 files recorded
1)g208-20120905-160729-2345042-1346854048.4985.wav
gExt-Date-Time-extCid-UniqueID.wav

2)IN211-20120905-160754-208–1346854074.4987.wav
InExt-Date-Time-Ext-UniqueID.wav

how can I modify the IN case in recordingcheck in order to save the second file name with InExt - extCid when a call is transferred or to have the same UniqueID in both files in order to get the relation between these two files.