Matching recordings to DB records

I am trying to match recordings to d/b records for an application and I am having troubles figuring out what the layout of the recording name is.

For example below is a recording on my system:

The first two file names have the extension in the beginning, then date, then time, then some number.

The last one is inbound and does not start with the extension but still ends with some number of unknown origin.

What table do I read to match the recording up with a call?

What is that last unknown number?

The last number is a unique id that is created by asterisk. It is not recorded in the database unless you compile the mysql module in the asterisk add-ons to use it (not sure why this is a compile time option) and have your database setup with the correct column for it. If you look through some of the settings in the ARI for recordings you can find some more documentation about it as well. If you do record the unique id it can be come much easier to match calls to recordings.

Well, according to Asterisk doc this unique number is not always unique…
My idea is that it’s better to use Date + called party number.
We know that there is only one phone for one person, but sometimes we are calling the same person twice… So adding date makes it possible to differentiate all calls place to a single phone number.

Thanks for responding.

I have been looking everywhere for information relating to “compile the mysql module in the asterisk add-ons”. I can’t find a thing. Can you point me to where documentation exists referring to how you do this?

Somehow it knows in the ARI where the recordings are. Where is its data being stored - thats what I want to get to. I can’t see how the ARI is matching things up without that number at the end of the file. It must be using a different database than just the asteriskcdrdb.cdr.