thanks
because of "There is also a limitation regarding the use of the “msg_apply_changes()” function together with the “uac_replace_*” functions for messages that are loose-routed (e.g. Re-INVITE requests). In this case you need to call the “loose_route()” function after the replace and msg_apply_changes. Otherwise Kamailio can create replies with wrong From/To headers (e.g. for the 100 - Trying reply in the Re-INVITE example)."
can you confirm the correct practice is
... ds_select_dst(TRUNK, "6"); uac_replace_to("sip:" + $tU + "@" + $dd); msg_apply_changes(); loose_route(); ... record_route(); xlog("L_NOTICE", "tu $tu \n"); route(RELAY);
or is it better use restore_mode =AUTO + dialog ?
Marek
Dne 2024-03-11 v 19:32 Alex Balashov via sr-users napsal(a):
You can obtain the destination set IP from $dd, or $(du{uri.host}). However, you can't just modify the To URI like that.
You will need to do it in a way that doesn't break standards-based proscriptions about what a proxy can do, otherwise endpoint A can look at the modified header received in responses from endpoint B and say, "I didn't send that!"
Kamailio provides such a mechanism. In brief, it conceals the in-flight alterations to the To URI from endpoint A:
https://kamailio.org/docs/modules/5.8.x/modules/uac.html#uac.f.uac_replace_t...
-- Alex
On 11 Mar 2024, at 12:43, marek via sr-users sr-users@lists.kamailio.org wrote:
hi,
i have kamailio acting as SBC
i need hide topology like this
ds_select_dst(DSP_GRP_TRUNK, "6");
$tu = $(tu{re.subst,/PRIVATE_IP/IP_OF_CURRENT_SELECTED_DISPATCHER/g});
what is best way for IP extraction from $du?
thanks
Marek
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: