IAX2 Trunk use the wrong context

Goodmorning everyone!
I’m try to configure 4 FreePBX server to comunicate each other. I configured a 3 IAX2 Trunks in every PBX with type=friend and host=ip.remote.pbx and context=custom-context.
Then I configure the routes to use the trunks, I want to use a prefix to “select” the pbx and then the remote extensions like this: 20100 to call the 100 extension in the second pbx; 30100 to call the 100 extension in the third pbx and so on.
Well, so far so good, I added in the extension_custom.conf the custom context with the option “exten => _.,n,Set(CALLERID(num)=20${CALLERID(num)})” but when a call arrive in the remote pbx, it wrongs the trunk context and use the context of the last iax trunk added.
Thanks to all for the support!!!

Share a call trace via pastebin of what you’re talking about. Its likely you’re setting the CID too early in the call flow, and it gets rewritten based on the macro at the outbound route. Providing Great Debug - Support Services - Documentation

I would like to help you Andrea but I’m pretty new on FreePBX, but Maybe You can help me to connect two Freepbx server. I already have the [email protected] Trunk but on the outbound route I always get the busy tone. My server 1 has the extension 7000 7001 and server 2 extension 3000 , 3001, 3002. I cant call any extension 300x from my server 1 and the same in the other direction. Any advise please?