Hello Lisa -
On Wednesday 10 January 2001 20:19, Lisa Goulet wrote:
> I need to return certain cvx attributes(example vpop_id). I have them in a
> postgres table with the DNIS as the key. After the AuthSelect gets this
> information, how can I pass this information to a postAuthHook which can
> then do a set_attr?
>
> Here is the AuthBy SQL and the handler part of the config file.
>
> <AuthBy SQL>
> DBSource dbi:Pg:dbname=radmin;host=xxx.xxx.xxx.xxx
> DBUsername radmin
> DBAuth xxxx
>
> Identifier CVXAttributes
>
> AuthSelect select VPOP_ID from CVX_ATTRIBUTES \
> where DNIS = '%{Called-Station-Id}'
> </AuthBy>
>
>
> <Handler zon_cvx_dnis="true">
> ....
> AuthBy CVXAttributes
> ....
> </Handler>
>
If your attributes are stored in the form "vpop_id = ....." and you have the
corresponding attributes defined in your dictionary, all you have to do is
define the appropriate AuthColumnDef in your configuration file:
<AuthBy SQL>
DBSource dbi:Pg:dbname=radmin;host=xxx.xxx.xxx.xxx
DBUsername radmin
DBAuth xxxx
Identifier CVXAttributes
AuthSelect select VPOP_ID from CVX_ATTRIBUTES \
where DNIS = '%{Called-Station-Id}'
AuthColumnDef 0, GENERIC, reply
</AuthBy>
Note that with the above you do not need a hook at all.
Otherwise, you would do something like this:
<AuthBy SQL>
DBSource dbi:Pg:dbname=radmin;host=xxx.xxx.xxx.xxx
DBUsername radmin
DBAuth xxxx
Identifier CVXAttributes
AuthSelect select VPOP_ID from CVX_ATTRIBUTES \
where DNIS = '%{Called-Station-Id}'
AuthColumnDef 0, Some-Pseudo-Attribute, reply
</AuthBy>
And in your PostAuthHook you would access the pseudo-attribute in the reply
packet just like any other attribute.
hth
Hugh
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
Archive at http://www.starport.net/~radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.