[Users] Re: $ru, $rU, $ru/username, $ruri/username, usage

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Aug 22 12:00:45 CEST 2006


Hi Greg,

the difference it;s about the meaning of the parameters.
avp_write() use a pseudo variable as data *source*.  All the time the 
pseudo variables are sources for the data.
avp_pushto() parameter is the data *destination* - where the  data 
should b e push to. This can not be an PS (which are RO).
this is the reason of the different notation.....source versus 
destination...if we would use the same notation it will be confusing....

regarding the bogus uri you get....can you print the $avp(s:tmp_uri) 
after the avp_write() ?

regards,
bogdan

Greg Fausak wrote:

> For completeness I'll follow up with what I think is a bug:
>
> I looked through the archives, and it seems that there
> was a bug fix.  So I updated my stuff to the released 1.1.0 code and
> tried again, still the same problem.
>
> So, I tried this:
>
>                avp_write("$rU","$avp(s:tmp_uri)");
>                avp_subst("$avp(s:tmp_uri)", "/;.*//");
>                avp_pushto("$ruri/username","$avp(s:tmp_uri)");
>
> Which works.
>
> I suspect there is a bug here somewhere.  I would expect:
>                avp_write("$rU","$avp(s:tmp_uri)");
>                avp_pushto("$rU","$avp(s:tmp_uri)");
> to work, but the pushto() gets a parse error on the $rU.
>  Aug 21 13:53:40 www openser[70435]: ERROR:avpops:fixup_pushto_avp:
> unsupported  destination "$rU"; expected $ru,$du,$br
>  Aug 21 13:53:40 www openser[70435]: ERROR: fix_actions: fixing
> failed (code=-1) at cfg line 82
>
>
>
> When both functions have $ruri/username as in:
>                avp_write("$ruri/username","$avp(s:tmp_uri)");
>                avp_pushto("$ruri/username","$avp(s:tmp_uri)");
> The RURI gets 4 bytes longer, starting with sip:sip:
>
> The hack I have using a mixture of $rU and $ruri/username works and
> I'll leave it that way for now.
>
>
> -g
>
>
> On 8/21/06, Greg Fausak <lgfausak at gmail.com> wrote:
>
>> More along these lines...
>>
>> When I run this sequence:
>>
>>                 avp_write("$ruri/username","$avp(s:tmp_uri)");
>>                 avp_subst("$avp(s:tmp_uri)", "/;.*//");
>>                 avp_pushto("$ruri/username","$avp(s:tmp_uri)");
>>
>> The resulting RURI looks like:
>>
>> ERROR: parse_sip_msg_uri: bad uri
>> <sip:sip:+19725551212 at 10.10.10.252:5060 at 10.10.10.252:5060>
>>
>>
>> Note the sip:sip:+XXXX header.  What's the trick?  The avp_subst is
>> effectively a no-op because the RURI doesn't contain the pattern.  I 
>> think
>> I'd get the same result with:
>>
>>                 avp_write("$ruri/username","$avp(s:tmp_uri)");
>>                 avp_pushto("$ruri/username","$avp(s:tmp_uri)");
>>
>> -g
>>
>> On 8/21/06, Greg Fausak <lgfausak at gmail.com> wrote:
>> > I want to use the RURI username in an avp query.
>> > I've seen a bunch of different ways to select it.
>> > Which way is correct?
>> >
>> > I am currently using $ruri/username, because I got an error with $rU.
>> >
>> > http://openser.org/docs/pseudo-variables.html shows '$rU', which
>> > complains when
>> > I try to reference that.
>> >
>> > Aug 21 06:55:58 www openser[89119]: ERROR:avpops:fixup_pushto_avp:
>> > unsupported  destination "$rU"; expected $ru,$du,$br
>> > Aug 21 06:55:58 www openser[89119]: ERROR: fix_actions: fixing failed
>> > (code=-1) at cfg line 82
>> >
>> > It's weird, the source code in items.c reads:
>> >
>> >          {{"ru", (sizeof("ru")-1)}, /* */
>> >                  { XL_RURI, 0, xl_get_ruri, {{0, 0}, 0}, {0, 0}}},
>> >          {{"ruri", (sizeof("ruri")-1)}, /* */
>> >                  { XL_RURI, 0, xl_get_ruri, {{0, 0}, 0}, {0, 0}}},
>> >          {{"rU", (sizeof("rU")-1)}, /* */
>> >                  { XL_RURI_USERNAME, 0, xl_get_ruri_attr, {{0, 1},
>> > 0}, {0, 0}}},
>> >
>> > Is there a list of the variables that are available in an avp 
>> operation?
>> >
>> > -g
>> >
>> >
>>
>>
>> -- 
>> Greg Fausak
>> greg at thursday.com
>>
>
>





More information about the Users mailing list