PBX in a Flash for Newbies

Connecting two Asterisk PBX servers using an IAX2 trunk


Connecting two Asterisk PBX servers using an IAX2 trunk

IAX is the Inter-Asterisk eXchange protocol for Asterisk PBX. IAX2 is version 2 of the protocol. Version 1 (one) is no longer used. IAX2 has some advantages over SIP in that only one network port is opened for communications. SIP uses two ports: SIP and RTP. If you want to find out more about IAX2 visit Wikipedia's IAX2 page.

The first step in setting up an IAX2 trunk is to draw a picture of what you need to do. Here's an example of a simple PBX to PBX connection. Just to keep it simple the two PBXs are name 101 and 106 after their IP host address. They could very well be named Montreal and New York. PBX 101 has all their extensions starting with 1xxx while PBX 106 has all of their extensions starting with 3xxx. This will be handy when making outbound routes.

The IAX2 trunks are drawn as simple arrows pointing to their PBX peer and named based on their destination which seems like a good practise. 106-Peer is going from PBX 101 to PBX 106 and 101-Peer is going from PBX 106 to PBX 101.

I've left an area on both sides for configuration information. It shows on the PBX 101 side, I will need to configure an outbound trunk called 106-peer and I will need to configure a user called 106-user so that PBX 106's 101-peer can register/qualify to (we'll see a little later why I've used the term register/qualify).

Similarly, on the PBX 106 side, the configuration information indciates that I will need to configure an outbound trunk called 101-peer and I will need to configure a user called 101-user so that PBX 101's 106-peer can register/qualify to.

We will configure the trunks one side at a time starting with PBX 101. Once both PBXs have their IAX2 trunks up, we will configure the outbound routes.

  1. Configuring the IAX2 Trunks

    1. Configuring PBX 101 IAX2 Trunk
    2. Configuring PBX 106 IAX2 Trunk
    3. Testing the IAX2 trunks

  2. Configuring the Outbound Routes

    We have the option of configuring the outbound route for dialing directly to the extension or by dialing the digit 7 first. Both outbound routes will be shown:

  3. Now you should be able to dial through each PBX to its peer from any SIP, IAX2 or POTS extension. You can check the status of the phones online and trunks online through FreePBX Statistics window

In creating the trunks, there was no limit put on the maximum number of channels that can use the trunk. For the above FreePBX Statistics window, I had 6 phones (channels) connected in 3 connections (external calls) across the one IAX2 trunk. Three were IP phones, two were IAX2 S100i POTS to IAX2 adapters and one FXS pots phone. All worked beautifully! You don't have to configure any protocol translations - the PBX does it all for you.


Go to the

Introduction
to Networking

Online Book

Go to the

PBX in a Flash

Home Page

Go to the

FreePBX

Home Page

Return to the

PBX in a Flash
for Newbies

home page

Copyright April 2008 - Eugene Blanchard