(RADIATOR) multiple reply of the same attribute - SIP-AVP
Hugh Irvine
hugh at open.com.au
Wed Dec 27 21:18:18 CST 2006
Hello Rosario -
The PostAuthSelectHook is passed a number of attributes including a
pointer to the current request and a pointer to the list of rows
returned by the query. You will need to loop through the rows and
build a string of the form:
SIP-AVP = ....., SIP-AVP = ......, SIP-AVP = .... ......
then you can add the string to the current request like this:
$p->add_attr('MY-SIP-ATTRS', $attrs);
then your configuration can use this:
<AuthBy SQL>
......
AddToReply %{MY-SIP-ATTRS}
</AuthBy>
Otherwise you can simply have a single field in each user record
containing all the SIP-AVP's for the user in the same format as
above. Then you can just use an AuthAttrDef like I have shown
previously.
regards
Hugh
On 27 Dec 2006, at 22:59, Rosario Pingaro wrote:
> I don't understand the way I can tell radiator to insert a new
> attribute with a following row.....
> sorry about my ignorance....
>
> Regards
> Rosario
>
> ----- Original Message ----- From: "Hugh Irvine" <hugh at open.com.au>
> To: "Rosario Pingaro" <rpingar at nesec.it>
> Cc: <radiator at open.com.au>
> Sent: Wednesday, December 27, 2006 6:11 AM
> Subject: Re: (RADIATOR) multiple reply of the same attribute - SIP-AVP
>
>
>>
>> Hello Rosario -
>>
>> You will find a number of example hooks in the file "goodies/
>> hooks.txt" in the Radiator 3.16 distribution.
>>
>> See also section 18 in the reference manual ("doc/ref.html").
>>
>> regards
>>
>> Hugh
>>
>>
>> On 27 Dec 2006, at 19:34, Rosario Pingaro wrote:
>>
>>> The PostAuthSelect seems above my actual knowledge, may you give
>>> me a little help on how to prodice the desired results?
>>>
>>> Regards
>>> Rosario
>>>
>>>
>>>
>>> ----- Original Message ----- From: "Hugh Irvine" <hugh at open.com.au>
>>> To: "Rosario Pingaro" <rpingar at nesec.it>
>>> Cc: <radiator at open.com.au>
>>> Sent: Tuesday, December 26, 2006 5:56 PM
>>> Subject: Re: (RADIATOR) multiple reply of the same attribute -
>>> SIP-AVP
>>>
>>>
>>>>
>>>> Hello Rosario -
>>>>
>>>> Probably the simplest thing to do is have a stored procedure in
>>>> your database return a record like this:
>>>>
>>>> SIP-AVP = ....., SIP-AVP = ......, SIP-AVP = ......
>>>>
>>>> where "....." is each of the values for a particular user.
>>>>
>>>> Then your configuration file would look like this:
>>>>
>>>>
>>>> <Handler Service-Type=SIP-Callee-AVPs>
>>>>
>>>> PreAuthHook file:"/etc/radiator/user_domain.pl"
>>>>
>>>> AuthByPolicy ContinueWhileIgnore
>>>>
>>>> <AuthBy SQL>
>>>> DBSource dbi:mysql:ser:xxx.xxx.xxx.xxx
>>>> DBUsername ser
>>>> DBAuth ser
>>>>
>>>> AuthSelect exec your_sp(....)
>>>>
>>>> AuthColumnDef 0, GENERIC, reply
>>>> NoDefault
>>>> </AuthBy>
>>>>
>>>> <AuthBy INTERNAL>
>>>> DefaultResult REJECT
>>>> </AuthBy>
>>>>
>>>> </Handler>
>>>>
>>>>
>>>> You will need to check your database documentation and the Perl
>>>> DBD documentation for the exact calling syntax in the
>>>> AuthSelect line.
>>>>
>>>> Alternatively you could use a "PostAuthSelectHook" to
>>>> accomplish the same thing.
>>>>
>>>> See section 5.29.23 in the Radiator 3.16 reference manual ("doc/
>>>> ref.html").
>>>>
>>>> hope that helps
>>>>
>>>> regards
>>>>
>>>> Hugh
>>>>
>>>>
>>>> On 27 Dec 2006, at 09:06, Rosario Pingaro wrote:
>>>>
>>>>> We would like to use radiator to exctract from a db the AVPs
>>>>> for our SIP customers.
>>>>>
>>>>> The problem is that for each username I have multiple AVPs,
>>>>> each AVP is stored in a different records.
>>>>> So radiator should reply with a number of reply attributes SIP-
>>>>> AVP equal to the records presnt into the db.
>>>>>
>>>>> But now I get only one attribute, the first it founds.
>>>>>
>>>>> this is my handler:
>>>>> <Handler Service-Type=SIP-Callee-AVPs>
>>>>>
>>>>> PreAuthHook file:"/etc/radiator/user_domain.pl"
>>>>>
>>>>> AuthByPolicy ContinueWhileIgnore
>>>>>
>>>>> <AuthBy SQL>
>>>>> DBSource dbi:mysql:ser:xxx.xxx.xxx.xxx
>>>>> DBUsername ser
>>>>> DBAuth ser
>>>>> AuthSelect select value from usr_preferences
>>>>> where username='%{CheckGroup-User}' and domain='voiptest.\
>>>>> test.it'
>>>>>
>>>>> AuthColumnDef 0, SIP-AVP, reply
>>>>> NoDefault
>>>>>
>>>>>
>>>>> </AuthBy>
>>>>>
>>>>> <AuthBy INTERNAL>
>>>>> DefaultResult REJECT
>>>>> </AuthBy>
>>>>>
>>>>> </Handle>
>>>>>
>>>>>
>>>>> How to improve my config to get what I need??
>>>>>
>>>>> Regards
>>>>>
>>>>> Rosario
>>>>>
>>>>
>>>>
>>>>
>>>> NB:
>>>>
>>>> Have you read the reference manual ("doc/ref.html")?
>>>> Have you searched the mailing list archive (www.open.com.au/
>>>> archives/ radiator)?
>>>> Have you had a quick look on Google (www.google.com)?
>>>> Have you included a copy of your configuration file (no secrets),
>>>> together with a trace 4 debug showing what is happening?
>>>>
>>>> --
>>>> Radiator: the most portable, flexible and configurable RADIUS
>>>> server
>>>> anywhere. Available on *NIX, *BSD, Windows, MacOS X.
>>>> Includes support for reliable RADIUS transport (RadSec),
>>>> and DIAMETER translation agent.
>>>> -
>>>> Nets: internetwork inventory and management - graphical,
>>>> extensible,
>>>> flexible with hardware, software, platform and database
>>>> independence.
>>>> -
>>>> CATool: Private Certificate Authority for Unix and Unix-like
>>>> systems.
>>>>
>>>>
>>>> --
>>>> Archive at http://www.open.com.au/archives/radiator/
>>>> Announcements on radiator-announce at open.com.au
>>>> To unsubscribe, email 'majordomo at open.com.au' with
>>>> 'unsubscribe radiator' in the body of the message.
>>>>
>>>
>>
>>
>>
>> NB:
>>
>> Have you read the reference manual ("doc/ref.html")?
>> Have you searched the mailing list archive (www.open.com.au/
>> archives/ radiator)?
>> Have you had a quick look on Google (www.google.com)?
>> Have you included a copy of your configuration file (no secrets),
>> together with a trace 4 debug showing what is happening?
>>
>> --
>> Radiator: the most portable, flexible and configurable RADIUS server
>> anywhere. Available on *NIX, *BSD, Windows, MacOS X.
>> Includes support for reliable RADIUS transport (RadSec),
>> and DIAMETER translation agent.
>> -
>> Nets: internetwork inventory and management - graphical, extensible,
>> flexible with hardware, software, platform and database independence.
>> -
>> CATool: Private Certificate Authority for Unix and Unix-like systems.
>>
>>
>>
>
NB:
Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/
radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.
--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.
More information about the radiator
mailing list