Here I’m going to show how to setup extension to extension calling between 2 FreePBX systems using an IAX2 trunk.
There are 2 steps to this. First we need to create an IAX2 trunk on each system. Each trunk will configure the inbound and outbound user/connection. Then we will set up an outbound route on each system to tell FreePBX what calls to pass over the trunk. We will need extensions in different number ranges at each site for this to work.
Here are the details of the systems –
IP Address : 184.108.40.206
Extension Range : 3000 – 3999
IP Address : 220.127.116.11
Extension Range : 4000 – 4999
SETTING UP THE TRUNKS
First we create an IAX2 trunk on PBX1 with the following details –
We are calling the the trunk pbxlink and creating a local user called ‘pbx1’ for the other system to connect to. We are connecting to the remote system with a user called ‘pbx2’
And we set up a similar IAX2 trunk on PBX2 –
Here we are also calling the the trunk pbxlink and creating a local user called ‘pbx2’ for the other system to connect to. We are connecting to the remote system with a user called ‘pbx1’
The context for incoming calls is set to ‘from-internal’. This means any call coming across the link will be treated as though it was called from an internal extension. You have to be very careful setting a trunk context to ‘from-internal’. If you did it for a normal inbound trunk you could allow unauthorised users to make outgoing calls from your system!
SETTING UP THE OUTBOUND ROUTES
Now we need to tell FreePBX what calls to send across the link. Don’t forget we are going to send calls for extensions 3XXX to PBX1 and calls for extensios 4XXX to PBX2.
Here is the Outbound Route on PBX1 –
That will send any 4 digit number starting with a 4 to PBX2, where the call will be treated as though it was dialled from a local extension.
Now the Outbound Route on PBX2 –
And finally on PBX2 we tell FreePBX to send any 4 digit number that starts with a 3 to PBX1.
Important!! If you have multiple Outbound Routes make sure this one is listed above any others that match general numbers dialled (or you’ll end up with the call matching the general Outbound Route, rather than your site to site one)
Now we should be able to make extension to extension calls between the 2 systems!