How can i auhtenticate my caller

Can anybody done this before? I am just asking if anyone gonna give me some help. I have authenticated my user useing password checking perl script from Mysql DA. But now i want to authenticate the caller with some PIN fetched from SimpleDB.

How do i do that?
Any help or advice expected.
Thanks in advance.

Never worked with simple DB. You can try to use an agi with mysql or use a simple go to if. You can also look at a2billing and astcc.