How to authenticate out calls using pin via asterisk realtime

Any suggestion or table structure for pins?

I’d use FUNC_ODBC to do this.

Create a table with two columns, accountcode and pin, then pull the pin out of the database based on what account code the calling phone has.