The branch management is a little bit tricky part. $ru and $du are append
data only for 0 branch ( it's default one you work with by default). The
rest you have to manage on your own via $branch variable. Take a look to
the doc here for clear explanation and example


https://www.kamailio.org/wikidocs/cookbooks/6.0.x/pseudovariables/#branchname-branch-attributes

On Mon, Sep 8, 2025, 16:37 Benoit Panizzon via sr-users <
[email protected]> wrote:

> Hi List
>
> I'm pretty sure I had already accomplished that task a couple of months
> ago while manually looping through the more than one registered contact
> and doing append_branch() for each contact, using a complicated way of
> stacking various AVP to be able to handle each branch correctly in the
> corresponding branch routes.
>
> But that was the complicated way to go :-)
>
> Now I hope I do get branches from multiple locations the intended way by
> using lookup_to_dset, t_load_contacts, t_next_contacts
>
> But I would like to be able to add more branches - not from the location
> database - for the sake of this example just one more branch to a
> static destination.
>
> For example I do a lookup_to_dset and end up with 2 contacts I loaded
> from the registered AOR.
>
> Now I would like to add another branch and fork the call to all three
> destinations.
>
> So additionally to the destination set obtained by lookup_to_ds I would
> like to add <sip:someuser@someserver> and have the call forked to the
> IP of someserver
>
> So I basically try:
>
>         lookup_to_dset("location", "$var(lookupuri)");
>         t_load_contacts();
>         $du = "<sip:someserver>";
>         $rU = "someuser";
>         append_branch();
>         t_on_branch("BRANCH_XY");
>         route(RELAY);
>
> But no matter how I try to combine $rU or $ru or the complete URI
> including user in $du this seems to either affect all branches or none.
>
> I guess I am missing something.
>
> How do I append one branch without affecting all existing branches?
>
> Mit freundlichen Grüssen
>
> -Benoît Panizzon-
> --
> I m p r o W a r e   A G    -    Leiter Commerce Kunden
> ______________________________________________________
>
> Zurlindenstrasse 29
> <https://www.google.com/maps/search/Zurlindenstrasse+29?entry=gmail&source=g>
>            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!
>
__________________________________________________________
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