It depends on #3516387 patch, that provides b2b_logic per session flags.
It adds new flag "t". When it enabled, To: header generates from To: header of source INVITE, when it disabled To header generates from request uri (old behavior).
I need it for balance b2b sessions to multidomain proxy, when To: header should not be changed.
needs rewrite (I'll do it later)
As Anca Vamanu has written to the opensips mailing list, this behavior can be achieved with this script:
$var(orig-to) = $hdr(To);
b2b_init_request("top hiding");
In local route:
remove_hf("To");
append_hf("To: $var(orig-to)\r\n", "From");