(RADIATOR) Handler SIP Proxy
Hugh Irvine
hugh at open.com.au
Fri Oct 17 19:44:37 CDT 2003
Hello Frank, Hello Jesus -
Frank is quite correct (thanks as always).
If you have multiple Client clauses you might consider using a
PreClientHook instead.
And I usually keep my hook code in seperate files - see the examples in
"goodies/hooks.txt".
regards
Hugh
On Saturday, Oct 18, 2003, at 05:52 Australia/Melbourne, Frank
Danielson wrote:
> I would use a PreHandler hook in your Client clause to look for the
> request
> type and set an appropriate attribute to use in a Handler later. Since
> you
> have multiple Digest-Attribute attributes the only way I know of to
> handle
> it would be to spool through the incoming request's attrbutes looking
> for
> the one you want. You could try something like this->
>
> <Client 111.222.333.444>
> Secret somesecret
> PreHandlerHook sub {my ($r,$value);\
> foreach $r (@{${$_[0]}->{Attributes}})\
> {\
> if ($r->[0] eq "Digest-Attributes")\
> {\
> $value = Radius::AttrVal::pclean($r->[1]);\
> ${$_[0]}->add_attr('SIP-Request',$value) if ($value
> =~ /REGISTER|INVITE/);\
> }\
> }}
> </Client>
>
> <Handler SIP-Request=REGISTER>
> </Handler>
>
> <Handler SIP-Request=INVITE>
> </Handler>
>
>
> Obviously I have not tested this so proceed at your own risk.
>
> Frank Danielson
> [Infrastructure Architect]
>
> voice:407.515.8633
> fax:407.515.9001
>
> ClearSky Mobile Media, Inc.
> 56 E. Pine St. Suite 200
> Orlando, FL 32801
> USA
>
> -----Original Message-----
> From: Jesus Rodriguez [mailto:jesusr at endercom.com]
> Sent: Friday, October 17, 2003 2:30 PM
> To: radiator at open.com.au
> Subject: (RADIATOR) Handler SIP Proxy
>
>
> Hello,
>
> My SIP proxy authenticates REGISTER and INVITE requests against
> Radiator. I
> would like to be able to diferentiate between both requests.
>
> This is a REGISTER request:
>
> Code: Access-Request
> Identifier: 104
> Authentic: <217><134><30>y<250>D<214>j<212>`N\F<254>{<222>
> Attributes:
> User-Name = "3400000002 at voztele.com"
> Digest-Attributes = <10><12>3400000002
> Digest-Attributes = <1><13>voztele.com
> Digest-Attributes =
> <2>*3f9032160a04f9a07db6b7431a03c66e63917d8e
> Digest-Attributes = <4><17>sip:voztele.com
> Digest-Attributes = <3><10>REGISTER
> Digest-Response = "5d484ab3e8c3ee3aa8aeb4f7238d9456"
> Service-Type = SIP
> SIP-URI-User = "3400000002"
> NAS-IP-Address = 192.168.1.34
> NAS-Port = 5060
>
>
> And this is an INVITE request:
>
> Code: Access-Request
> Identifier: 100
> Authentic: <230><141><168>k<203>:}<239><134><139>O<227>]<6><147>'
> Attributes:
> User-Name = "3400000000 at voztele.com"
> Digest-Attributes = <10><12>3400000000
> Digest-Attributes = <1><13>voztele.com
> Digest-Attributes =
> <2>*3f90309d03749b41dfcc0d202bc35f89ebfc9d1c
> Digest-Attributes = <4><27>sip:637589919 at voztele.com
> Digest-Attributes = <3><8>INVITE
> Digest-Response = "f398469d53d8eeb47bbde0d45f78583d"
> Service-Type = SIP
> SIP-URI-User = "3400000000"
> NAS-IP-Address = 192.168.1.34
> NAS-Port = 5060
>
>
> The only difference between them are these Digest-Attributes:
>
> Digest-Attributes = <3><10>REGISTER
> Digest-Attributes = <3><8>INVITE
>
> I've been playing with <Handler Digest-Attributes = xxxxx" where xxxxx
> are
> different regular expressions but no luck.
>
> Is there some way to diferentiate both requests? I have to treat them
> in a
> different way because i need to send a reply attribute only for the
> INVITEs.
>
> Thanks in advance.
>
> Saludos
> JesusR.
>
> -------------------------------
> Jesus Rodriguez
> Endercom Comunicaciones, S.L.
> jesusr at endercom.com
> http://www.endercom.com
> Tel. +34 934424293
> -------------------------------
> ===
> 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.
> ===
> 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 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.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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