[OpenSER-Users] help with using avp...

Daniel-Constantin Mierla daniel at voice-system.ro
Wed Jul 4 10:38:52 CEST 2007



On 07/04/07 09:26, liran tal wrote:
>
> Thank you very much Daniel.
> I was mislead that such variables are not available on 1.1.1 and that 
> I have to
> upgrade to 2.x to use it.
It is on 1.1 as well, the link provided is for release 1.1.x. You have 
to use avpops functions in 1.1 to deal with them.

Cheers,
Daniel

>
> Thanks alot, it works just fine.
> Liran.
>
> On 7/2/07, *Daniel-Constantin Mierla* <daniel at voice-system.ro 
> <mailto:daniel at voice-system.ro>> wrote:
>
>     Hello,
>
>     that's a standalone pseudo-variable you can use directlu: $au
>     http://www.openser.org/dokuwiki/doku.php/pseudovariables:1.1.x#auth_username
>     <http://www.openser.org/dokuwiki/doku.php/pseudovariables:1.1.x#auth_username>
>
>     You do not need to play with such complex regexp subst.
>
>     Daniel
>
>     On 07/01/07 10:33, liran tal wrote:
>     > Hey everyone,
>     >
>     > I'm using OpenSER 1.1.1 SVN version.
>     > I'd like to save the Authorization Digest Username as it appears in
>     > header into a variable (avp) so
>     > that later I can use it to set an accounting attribute in the
>     radius.
>     >
>     > From the SIP Packet the information is given like this:
>     >         Authorization: Digest username="dsdsds", realm=" 1.2.3.4
>     <http://1.2.3.4>
>     > <http://1.2.3.4>", algorithm=MD5, uri="sip: 1.2.3.4
>     <http://1.2.3.4> <http://1.2.3.4>",
>     >            nonce="xxx"
>     > Where I would like to grab the username part "dsdsds".
>     >
>     > From the docs I could only conclude that doing it would be something
>     > like this:
>     > avp_write("$hdr[Authorization]","s:12");
>     > avp_subst("$avp(s:12)", "/.*username=(.*),/\1/");
>     >
>     >
>     >
>     > I'm not even sure about that piece of code, if someone can help...
>     >
>     >
>     > Thanks,
>     > Lir.
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > Users mailing list
>     > Users at openser.org <mailto:Users at openser.org>
>     > http://openser.org/cgi-bin/mailman/listinfo/users
>     >
>
>




More information about the sr-users mailing list