SIP Proxy - 482 Loop Detected

I have a few Asterisk boxes with different accounts behind a SIP Proxy. Some accounts are on the same asterisk server. Because Asterisk doesn’t know which account and on which server it is registered - it sends by default all messages to the SIP Proxy server. The Problem is when both customers are on the same Asterisk Server - and SIP Proxy is sending back INVITE Packet to the Asterisk where is come from. Asterisk is Rejecting the call with message 482 “Loop Detected”. I was trying to modify R-URI on the SIP Proxy - before sending back to the Asterisk - but then Asterisk is bridging SIP channel to the Local and cannot parse SIP headers sets by SIP Proxy.

Now forwarding SIP/11-00000049 to ‘Local/1001@MAIN’
This function can only be used on SIP channels

What is the recommended way to send/receive SIP Messages from Asterisk to the SIP Proxy?

I do a test with DIALPLAN_EXISTS and use a local channel to call the server itself after doing a ForkCDR on calls that are hairpinned.