Where is OpenSIPS mentioned?
I don’t see anything, other than that the request is coming from a private network address, to suggest that the call is arriving other than through an ITSP, in which case they may well have a policy of not supporting REFER, and if they do support it, they will almost certainly charge you for a call between your two systems.
However, to meet your requirement for retaining the original call, you are going to need to do an attended transfer. At the time that I was actively involved with the Asterisk code, there was no API that would allow the initiation of an attended transfer. I thought I’d seed references to support subsequently being added, but checking the code now, I can’t find any relevant changes to the transfer application.
Where I was working at the time, we did implement extensions to the Transfer application, and chan_sip, to allow attended transfers, but we were already locked into an old version of Asterisk, and In any case I no longer have the code, so it is not possible to contribute that now. That code used the channel name to identify the replaced channel.
However, as your upstream system is refusing even a blind transfer, it is not going to accept an attended one. If you do the transfer on the agent Asterisk, you have even more problems: the provider is even less likely to accept INVITE/Replaces, than it is to accept the REFER/Replaces, that would be needed to do it from the customer facing Asterisk side (and it isn’t even accepting a simple REFER); and you would need to communicate the call ID and tags, from the customer Asterisk, to agent Asterisk, as the replaced channel name would have no meaning to it. There has never been an API for requesting Asterisk to generate an INVITE/Replaces,
As such, you need to analyse what the real problem you are trying to solve is, and see if you can go part way to solving that. In an earlier response, I suggested your main concern might be the processor load and network load, in which case direct media may help. However, there is no guarantee that the upstream system will accept direct media re-INVITEs, and direct media means that there are various Asteirsk features that you cannot use, because they require Asterisk to see the media stream.