Hello,

maybe printing all xavps and analyzing the output is a simpler way to try:

  -
https://www.kamailio.org/docs/modules/stable/modules/pv.html#pv.f.pv_xavp_print

Cheers,
Daniel

On 10.12.24 11:47, Benoit Panizzon via sr-users wrote:
> Hi List
>
> I'm trying to inspect the content of the $xavp(tm_contacts) to figure
> out how t_load_contacts exactly behaves when called multiple times.
>
>                 $var(k) = 0;
>                 while ($xavp(tm_contacts[$var(k)]) != $null) {
>                         $var(out) = "nothing";
>                         xavp_params_implode("tm_contacts[$var(k)]", 
> "$var(out)");
>                         xlog("L_INFO", "$cfg(route): tm_contacts idx: $var(k) 
> => $var(out)\n");
>                         $var(k) = $var(k) + 1;
>                 }
>
> My stack contains multiple entries.
>
> Unfortunately I struggle to access the lower entries.
>
> xavp_params_implode("tm_contacts[$var(k)]", "$var(out)");
>
> does nothing when $var(k) > 0
>
> What is the best way to dump a complete xavp stack?
>
> I suspect t_load_contacts does flush the complete stack. Is there a way
> to stack an xavp on top of another one?
>
> Something like:
>
> xavp_rm("contact_stack"); # Initialize Stack
>
> lookup("location", "sip:[email protected]");
> t_load_contacts(0);
>
> $xavp(contact_stack) = $xavp(tm_contacts); 
>
> lookup("location", "sip:[email protected]");
> t_load_contacts(0);
>
> $xavp(contact_stack) = $xavp(tm_contacts); # contact_stack now contains alice 
> + bob
>
> lookup("location", "sip:[email protected]");
> t_load_contacts(0);
>
> # $xavp(tm_contacts) now contains only charlie.
>
> $xavp(tm_contacts) = $xavp(contact_stack);
>
> # $xavp(tm_contacts) now contains only alice, bob + charlie.
>
> t_next_contacts(); # Push contacts to destination list creating branches.
> t_relay(); # Invite all contacts
>
> Mit freundlichen Grüssen
>
> -Benoît Panizzon-
> -- 
> I m p r o W a r e   A G    -    Leiter Commerce Kunden
> ______________________________________________________
>
> Zurlindenstrasse 29             Tel  +41 61 826 93 00
> CH-4133 Pratteln                Fax  +41 61 826 93 01
> Schweiz                         Web  http://www.imp.ch
> ______________________________________________________
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- 
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy, Training and Development Services -- asipto.com

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- 
[email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to