Hi, I'm playing around with xavp, but there are some things I can't wrap my head around.
What basically works is this: $xavp(a=>foo) = 'foo'; $xavp(a[0]=>bar) = 'bar'; Getting the value like this: xlog("L_INFO", "a-foo='$xavp(a=>foo)' and a-bar='$xavp(a=>bar)'"); as well as xlog("L_INFO", "a-foo='$xavp(a[0]=>foo)' and a-bar='$xavp(a[0]=>bar)'"); ... works, because when omitting the index, it assumes [0]. I really like to avoid such implicit assumptions though, to make the config really clear, so I prefer the second approach. What doesn't work for me then is explicit assignment of the very first value, like this: $xavp(a[0]=>foo) = 'foo'; $xavp(a[0]=>bar) = 'bar'; If I do this, the "a" xavp is never created. Wouldn't it be good practice to create the xavp on first assignment? That way, I don't have to take care in the config file whether the xavp is used for the first time, where I have to omit the index. What I'm also wondering is whether it's possible to directly access nested xavps, like this: $xavp(a=>foo) = 'afoo'; $xavp(b=>foo) = 'bfoo'; $xavp(c=>a) = $xavp(a); $xavp(c=>b) = $xavp(b); xlog("L_INFO", "a-foo='$xavp(c=>a[0]=>foo)'"); or xlog("L_INFO", "a-foo='$xavp(c=>a=>foo)'"); Both ways give me "a-foo='<<xavp:0x7f0d387fe178>>'". Is this even intended? Would be really cool if that's possible! Thanks, Andreas
signature.asc
Description: OpenPGP digital signature
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users