Config for asterisk with mysql

I’m new to Asterisk and I want to implement a simple Asterisk Configuration: SIP server (only VoIP with SIP protocol).
The info founded in internet are confused and referred to single and old Asterisk version.
I’ve got a machine with Ubuntu.
I would to use mysql db to store users.
I thought to store in extension.conf file the template configuration, and insert the template-name in the users table in db.
Users would be able to inert themself to the users-table
The users should be able to see their friends on/off connected.

Which version of Asterisk can do this?
Which addon and modules I need?
Which file have I to configure?

I’m sorry, I’ve got a gprs connection and I can’t search in the forum…
thanks a lot for the support

i am looking for the same thing if u know it can you send me to

the latest version of asterisk i would say.
check this out … ysql+peers

and you need only to configure extensions.conf since ths sip accounts are going to be in the mysql data base.