[SR-Users] Variable interpolation in xavp identifiers

Brooks Bridges bbridges at o1.com
Wed Apr 8 16:57:56 CEST 2015


Hi Alex,

Did you ever figure this out?  We've run into a very similar (if not identical) issue.

Thanks
-Brooks

-----Original Message-----
From: sr-users [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Alex Balashov
Sent: Tuesday, March 31, 2015 3:36 PM
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Subject: [SR-Users] Variable interpolation in xavp identifiers

Hello,

There seems to be an implementational difference in interpolation of PVs in AVP and XAVP identifiers and/or field names.

The pseudovariables documentation[1] on classical AVPs says:

    The 'id' can be:

       ...

       pseudo variable - if value of pv is integer, id is integer,
       if string, id is string

So, for example, this composition of variables works:

    $var(f) = 'donkey';
    $avp($var(f) = 'eehaw';

    xlog("L_INFO", "Donkey says: $avp(donkey)\n");

It correctly prints:

    Donkey says: eehaw

Making some assumptions, I tried this, and it did not work similarly as
expected:

    $var(f) = 'donkey';
    $xavp(r=>$var(f)) = 'eehaw';

    xlog("L_INFO", "Donkey says: $xavp(r=>donkey)\n");

This prints:

    Donkey says: <null>

And a PV dump confirms that the PV value is not interpolated:

Mar 31 18:26:15 localhost /usr/local/sbin/kamailio[2399]: INFO: debugger
[debugger_api.c:1799]: dbg_dump_json(): {"$xavp(r)":[{"$var(f)":["eehaw"]}]}

Interpolation of variables does not work for either field or stem names.

Is this a design principle of XAVPs, or an oversight?

Thanks,

-- Alex

[1]
http://www.kamailio.org/wiki/cookbooks/4.2.x/pseudovariables#avp_id_-_avps

--
Alex Balashov | Principal | Evariste Systems LLC
303 Perimeter Center North, Suite 300
Atlanta, GA 30346
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users at lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list