Asterisk and Databases

Hello everyone new to the forum and asterisk but used linux and phone systems for a long long time!

My question is … Is their a module available that will let a caller dial an extension then enter a numeric reference number on the keypad. That reference number is then passed to an SQL statement that will return a specified field in a table which contains the path to a .WAV file. Then play the WAV back to the caller?

Asterisk provides the tools to do this, but you have to join them together, using a dialplan, etc. I can’t imagine the dialplan for this is more than 5 lines long.

Or alternatively you can use AGI , at least for me it’s easier :
Below you can find an example in PHP. … lerid+name

If your more familiar with PERL try the Asterisk::Common package