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