I needed to find a way of forwarding incoming calls from one Asterisk box over to another Asterisk box. There were restrictions in simply putting the ISDN cards into the new Asterisk box. To do this I had to first connect the boxes with an IAX2 trunk which is easy enough. Once the 2 Asterisk boxes are connected via an IAX2 trunk it was a case of creating a custom extension and to forward incoming calls to this custom extension.
For each incoming number on the first box I had to create a custom extension that corresponded to this incoming number.
Simply editing extensions_custom.conf and adding the following
[custom-5551234] exten => s,1,Dial(IAX2/TrunkName/5551234,30,r);
This is essentially saying to create a custom extension called custom-5551234 if this extension is called to start the call with priority 1 and to Dial the IAX trunk with a timeout of 30 seconds and to force the generation of the ring tone
Then on the first Asterisk box I created an Inbound Route that stated if there is a call to 5551234 transfer / call 55512334 on the IAX2 Trunk.
This was done with a simple Custom App to dial
On the second Asterisk box you simply then create and Inbound rule as normal for a direct dial and point the extension to the IVR / Extension / Conference room as requested.
This has worked really well and has proved incredibly reliable.