How to connect two Asterisk PBXs using a SIP Trunk
Session Initiation Protocol (SIP)) is a signalling protocol used for setting up and tearing down Voice over Internet Protocol (VOIP) calls. A SIP call uses two protocols: SIP and RTP. Real Time Protocol (RTP) is used for the transfer of the actual voice data. If you want to find out more about SIP visit Wikipedia's SIP page.
The first step in setting up an SIP 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 106 and 111 after their IP host address. They could very well be named Montreal and New York. PBX 106 has all their extensions starting with 3xxx while PBX 111 has all of their extensions starting with 2xxx. 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. 111-Peer is going from PBX 106 to PBX 111 and 106-Peer is going from PBX 111 to PBX 106.
I've left an area on both sides for configuration information. It shows on the PBX 106 side, I will need to configure an outbound trunk called 111-peer and I will need to configure a username called 106-user so that PBX 106's 111-peer can register/qualify to (we'll see a little later why I've used the term register/qualify).
Similarly, on the PBX 111 side, the configuration information indciates that I will need to configure an outbound trunk called 106-peer and I will need to configure a username called 111-user so that PBX 111's 106-peer can register/qualify to.
We will configure the trunks one side at a time starting with PBX 106. Once both PBXs have their SIP trunks up, we will configure the outbound routes.
- Configuring the SIP Trunks
- Configuring PBX 106 SIP Trunk
- Configuring PBX 111 SIP Trunk
- Testing the SIP trunks
- Configuring the Outbound Routes
We will be configuring the outbound route for dialing directly to the extension of the peer PBX.
- 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 4 phones (channels) connected in 2 connections (external calls) across the SIP trunk. There are two IP trunks shown here as one is an IAX2 trunk and the other the newly created SIP trunk.
Two channels were IP phones, one was an IAX2 S100i POTS to IAX2 adapter and one FXS pots phone. All worked beautifully! You don't have to configure any protocol translations - the PBX does it all for you.
|