Looks like I am missing something and looks like we don't need to send hook flash.
Say incoming leg is A to a SIP dial-peer then to SIP IVR (leg

SIP IVR send REFER to GW
Now we have leg A, leg B, transfer to number. Which leg you like to connect to transfer to number ?
At this moment we can do leg A <-> refer_to or leg B <--> refer_to. Is this something you like to do ?
Thanks !