Route outgoing calls over IAX2 to another server

We have 2 locations with a Freepbx server in each. We have 12 extensions 7 in one and 5 in the other. All extensions are configured on the Main server (so FOP2 and BLF would work correctly) we want the the 5 extensions to use the remote server. They seem to be going out the outbound route at the main server.

this is how it should work.
EX. Ext 150 => main server=> IAX2=>remote server => POTS line
Ext 100=>main Server=> POTS line.

Any ideas on the best way to do this?

Freepbx version

you can set different dial patterns from outbound to handle trunks(include PSTN).