How to connect two PBXs based on FreePBX through IAX2 using encryption
- Tutorial
- Recovery mode
I want to consider the simplest way to connect two PBXs based on the most popular FreePBX system. And so that neither the NSA nor the FSB listens to us, we add encryption.
In this example, we connect Moscow and St. Petersburg. In Moscow we have numbers of the form 1XX, in St. Petersburg of the form 2XX.
1. In Moscow, create a new IAX2 trunk
Trunk name: spb
Outbound Caller ID: not important
Trunk name (repeatedly): spb
Peer details:
Substitute your password (more authentic) and host (name or better the address of the remote server).
In the allow tag, replace the codec with the one you like. I recommend Speex and iLBC as modern and free codecs with good sound quality and good compression.
If the network is bad, you can add jitterbuffer = yes necessarily bundled with trunktimestamps = yes
That's it! Nothing more needs to be filled here.
2. In St. Petersburg we do the same thing, but a little vice versa - where at the point there is one spb, we write msk there, and where msk we write spb.
3. Create an outbound route. We tick off the intra-company, and in the match pattern field in Moscow we write 2XX, in St. Petersburg 1XX.
4. If necessary - open / forward UDP port 4569
5. In the console (or in the tools menu), the iax2 show peers command should show something like:
Everything is in order, now you can call directly, simply by dialing the internal office number in another city.
In this example, we connect Moscow and St. Petersburg. In Moscow we have numbers of the form 1XX, in St. Petersburg of the form 2XX.
1. In Moscow, create a new IAX2 trunk
Trunk name: spb
Outbound Caller ID: not important
Trunk name (repeatedly): spb
Peer details:
username=msk
secret=<длинный пароль>
host=
type=friend
context=from-internal
qualify=yes
trunk=yes
forceencryption=yes
auth=md5
disallow=all
allow=speex
Substitute your password (more authentic) and host (name or better the address of the remote server).
In the allow tag, replace the codec with the one you like. I recommend Speex and iLBC as modern and free codecs with good sound quality and good compression.
If the network is bad, you can add jitterbuffer = yes necessarily bundled with trunktimestamps = yes
That's it! Nothing more needs to be filled here.
2. In St. Petersburg we do the same thing, but a little vice versa - where at the point there is one spb, we write msk there, and where msk we write spb.
3. Create an outbound route. We tick off the intra-company, and in the match pattern field in Moscow we write 2XX, in St. Petersburg 1XX.
4. If necessary - open / forward UDP port 4569
5. In the console (or in the tools menu), the iax2 show peers command should show something like:
Name / Username Host Mask Port Status Description spb / msk xxxx (S) 255.255.255.255 4569 (T) (E) OK (12 ms) 1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Everything is in order, now you can call directly, simply by dialing the internal office number in another city.