Only available in dev yes ... you could cherry-pick the 2 commits.

I think this code should work to copy an full stack of xavps without knowing how many there is.

if (defined $xavp(x[0]))
    $avp_copy("x", 0, "y");
while (pv_unset("$xavp(x)")) {
    if(!defined $xavp(x)) {
        break;
    }
    $avp_copy("x",0,"y");
}



On Mon, Jan 20, 2020 at 4:48 PM Ovidiu Sas <osas@voipembedded.com> wrote:
xavp_copy() is available only in dev.
How can you copy an entire xavp, not just an element, without knowing
the size of the stack?
This doesn't work:
    $var(i) = 0;
    while (pv_isset("$xavp(x[$var(i)])")) {
        xavp_copy("x", "$var(i)", "y");
        $var(i) = $var(i) + 1;
    }


-ovidiu

On Mon, Jan 20, 2020 at 6:34 PM Julien Chavanton <jchavanton@gmail.com> wrote:
>
> Hi,
>
> To print all the elements in the stack, you will have to do a while loop.
> (You can make a copy using xavp_copy, it may come in handy in some cases)
> while (pv_unset("$xavp(name)")) {
>          // xavp_params_implode
>         if(!defined $xavp(name)) {
>                 break;
>         }
> }
>
>
> Or if you know how many elements are present in the stack or you could use
> while ($var(i) < x) {
>     xavp_params_implode($xavp(route_set[$var(i)]....))
>     $var(i) = $var(i) + 1;
> }
>
> Quick answer ...
>
>
> On Mon, Jan 20, 2020 at 2:08 PM Ovidiu Sas <osas@voipembedded.com> wrote:
>>
>> What's the best way to print the entire content of an xavp?
>> The xavp_params_implode() doesn't print the entire stack of an xavp,
>> only the top layer:
>>
>> The following code produces "c=d;e=f;"
>>     $xavp(x=>e) = "f";
>>     $xavp(x[0]=>c) = "d";
>>     $xavp(x[1]=>e) = "z";
>>     $xavp(x[1]=>c) = "y";
>>     xavp_params_implode("x", "$var(out)");
>>
>> Is there a way to print everything inside $xavp(x)?
>>
>> Thanks,
>> Ovidiu
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users



--
VoIP Embedded, Inc.
http://www.voipembedded.com

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users