I want to consider the simplest way to connect two PBXs based on the popular FreePBX system. And so that neither the NSA nor the FSB will listen to us - we will 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 (again): spb
Peer details:
username=msk secret=< > host=<xxxx> type=friend context=from-internal qualify=yes trunk=yes forceencryption=yes auth=md5 disallow=all allow=speex
Substitute your password (longer) and host (the name and better is the address of the remote server).
In the allow tag, replace the codec with one that 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
Everything! Here, nothing more needs to be filled.
2. In St. Petersburg, we do everything the same, but a little on the contrary - where in paragraph one is spb, there we write msk, and where msk, we write spb.
3. Create an outbound route. We ticked intra-company, and in the match pattern field in Moscow we write 2XX, in St. Petersburg 1XX.
4. If needed, open / forward UDP port 4569
5. In the console (or in the tools menu), the iax2 show peers command should show something like:
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 by simply dialing the internal number of the office in another city.