Sending calls from one PBX to another

We have two FreePBX systems in different locations. There is an IAX trunk between each to do 4 digit dialing between them.

We will be relocating the personal from Office 2 to Office 1 merging all personal under the same building.

System 1 has a PRI with DID range 1000-1999
System 2 has a PRI with DID range 2000-2999

I’m going to move all of system 2’s extensions over to system 1 but how do i get calls that come into System 2 to forward to System 1?

If someone calls 818-555-2000, the call reaches system 2, it needs to be forwarded to extension 2000 now located at system 1.

Eventually the number will be ported over to the one PRI but I need this for the mean time.

If you have a one-to-one mapping of the last four digits of the DID dialled to “extensions” that currently work intra PBX’s then

[your-custom-context]
exten => _.,1,goto(from-internal,${EXTEN:-4},1)

should work no matter whether you get 10 or 4 digits from your provider. If you just get four which is the norm in SF Valley then just use from-internal for your trunk context