hi oldbay,
i had the same kind of question a few days back but now i just did it.
got to register.conf and edit the below context accordingly
[user.auth]
query=SELECT secret FROM sip_users WHERE username='${username}' AND secret IS NOT NULL
result=secret