i see it as a bug since `tosocket` is using `msg` to determine the transport instead of parsed uri from input, try to run it in a timer route and you'll see but i guess that it will also give wrong result if you receive a `udp` message and then try to apply the transform to "sip:xxx@yyy;transport=tcp". as for the backport, i think this is in 5.2 but not 5.1.