Route calls between trunks

I am trying to setup a FreePBX server to act as a gateway between the PSTN and my other FreePBX servers. This also allows me all the servers to share a single SIP trunk via the gateway server for external calls.

I am using IAX2 trunks between the ‘user’ FreePBX servers and the ‘gateway’ FreePBX server. Outbound calls to PSTN work fine.

I am having trouble with inbound calls. I thought I would just be able to setup an inbound route on the gateway server, matching a range of numbers, and route the calls using the IAX2 trunk to the correct server. This doesn’t seem to work though.

Is my logic correct, and are there any special considerations I need to make. I am quite new to FreePBX/Asterisk so I appreciate any advice.

I can post any extra info you might need.

Extra info… I can dial from an extension on the gateway server to extensions on the other servers. The only problem is routing PSTN calls to the other servers.