You also can filter it in the request route and not create branch wich doesn't belong this server ( you can achieve that by verifying ucl variable details), or making it UDP branch being forwarded to proper server which handles the particular connection.

On Fri, 8 Sept 2023, 11:29 Benoît Panizzon, <benoit.panizzon@imp.ch> wrote:
Hi

https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#branch_name_-_branch_attributes

Assigning $null to uri attribute will drop the branch, for the rest of
attributes will just set the value to null.

I fear this does not work within branch_route

        if ($var(socket) == 0) {
                if ($avp(debug) > 0) {
                        xlog("L_INFO", "$cfg(route): $(branch(uri)[$T_branch_idx]) via Socket: $var(socket) is NOT LOCAL to this Registrar - dropping!\n");
                }
                $(branch(uri)[$T_branch_idx]) = $null;
        }

Result:

* Call is still branched to CPE
* $(branch(uri)[$T_branch_idx]) is null on all subsequent branches after the first one.

--
Mit freundlichen Grüssen

-Benoît Panizzon- @ HomeOffice und normal erreichbar
--
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
To unsubscribe send an email to sr-users-leave@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe: