Re: [Asterisk-java-users] Account authorization?
Brought to you by:
srt
From: S. B. S. <bs...@no...> - 2007-05-25 09:57:55
|
The code sample you supplied is not an asterisk database but something that asterisk2billing layers on top of asterisk. The closet thing you will get is the sip_buddies table which is used in asterisk realtime. Normally sip entries are kept in sip.conf but you can move these to a sql db by using the asterisk realtime feature. Having said that sip entries are not users/accounts but telephone extensions. If you are doing some sort of billing application you will have to create/manage your own account tables. Cord wrote: > Hello list! > > I'm quite new to programming Asterisk-Java. > I wrote a servlet which successfully calls an originate action with the given parameters. > > My problem is related to the setAccount method: > > I have to authenticate the account, so if the given password is not right, I reject calling the originate, else I do it. > > I would like to achive the same funcionality, which is in the Asterisk2Billing php goodness: > > function login ($user, $pass) { > global $DBHandle; > [...] > $QUERY = "SELECT userid, perms, confaddcust, groupid FROM cc_ui_authen WHERE login = '".$user."' AND password = '".$pass."'"; > $res = $DBHandle -> query($QUERY); > if (!$res) { > $errstr = $DBHandle->ErrorMsg(); > return (false); > } > [...] > } > > I don't understand PHP much, but I have read about the DB handling of asterisk-java, but no clue how to match the user password. > > How can I access Asterisk's database, where can I read about the scheme, etc. > > > Thanks in advance! > > > > Attila > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |