Hi Yuriy
Then for the first entry, you can set $ru and $du variables and it will become the main branch For the other do append_branch and set parameters of the branch[-1] accordingly. So you can control branch creation instead of automatically doing it by Kamailio and filter all needed.
Thank you, I think you pointed me in the right direction.
So going to replace:
if (lookup("location", "$var(lookupuri)")) {
by
if (reg_fetch_contacts("location", "$var(lookupuri)", "aor")) {
Then iterate the contacts and only add the ones having a socket set.