David,

I'm having exact the same setup with different type of clients behind Kamailio.

I'm using approach like

modparam("rtpengine", "extra_id_pv", "$avp(via_branch_extra_id)")

...
$avp(via_branch_extra_id) = "srtp"; # For one type of clients
...
$avp(via_branch_extra_id) = "dtls"; # For other type of clients
...
rtpengine_manage("... via-branch=extra")
....
So, basically relying not on Via branch, but client type.

Maybe this will give a hint

Le jeu. 7 août 2025 à 03:07, David Tek via sr-users <sr-users@lists.kamailio.org> a écrit :

Hello,

Using Kamailio 6.0.2.

I'm running a registrar that can fork incoming calls to two or more registered users. Some users are WebRTC and others are not, so RTPEngine needs to handle them differently.

In the branch route, I call:

rtpengine_manage("via-branch=auto replace-origin");

However, the via-branch passed to RTPEngine doesn't match the branch ID of the actual INVITEs sent out.

When one branch answers, the others get a CANCEL, but the CANCEL/200 OK sent to RTPEngine includes a different via-branch than the one used for the original INVITE. This causes media handling issues.

I saw that the docs suggest using $T_branch(name) or AVPs to set the correct branch name, but $T_branch(name) seems deprecated or removed.

In previous setups, branching was done on a separate instance, so identifying the right branch was easier. Now that it's local, I’m unsure how to arm rtpengine_manage() with the correct via-branch.

TL;DR:
When doing local forking, how can I set the correct via-branch value for each leg in rtpengine_manage()?

Thanks,
David


__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org
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!


--
Best regards,
Ihor (Igor)