(D241024) IP PBX call distributor VoIP Gateway GSM/3G/4G/5G for home and small office
TO WRITE
PROOF OF CONCEPT
1. Requirement and concept
We're building a PBX system for our business. It will handle:
- automatic distribute incoming calls
- call outside by specific phone numbers, automatic route to reduce call cost
- sms send api for OTP maybe?
Since we don't have any SIP trunk from our carriers, we will take incoming calls from regular sim cards.
- Disadvantage:
- Single-line: only one concurrent call per SIM card at a time
- Need more work to handle system failure due to OS, power..
- Not sure:
- Voice over LTE (VoLTE) are supported by all carriers.
- Voice over Wi‑Fi (VoWiFi) are supported by VinaPhone, Mobifone?
Call flow as bellow:
Our stack:
- Hardwares:
- Mini PC / Router: ZOTAC ZBOX CI323 nano
- 2G/3G/4G/5G module: Quectel EC20CEFRG-MINIPCIE-C (Vietnam frequency bands: B1/B3/B8), PCIE to USB adapter (sim card slot included), antena
- VoIP phone: haven't bought yet
- Softwares
- OS: TrueNAS SCALE 24.10 - Electric Eel
- VM: jailmaker
- PBX: Asterisk
- Softphone: Linphone (Linux / iOS), Baresip (Android), MicroSIP (Windows)
2. Step by step
2.1 Asterisk Installation
- OS: Debian 12 ("Bookworm")
$ mkdir tmp
$ cd tmp/
$ wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22-current.tar.gz
$ tar zxvf asterisk-22-current.tar.gz
$ cd asterisk-22*/
$ sudo ./contrib/scripts/install_prereq install
$ ./configure
$ make menuselect
Most of IP phones are support G722 and / or G729 codecs now.
- Under Add-ons:
- Select [*] format_mp3
- Under Codec Translators:
- Select [*] codec_opus
- Select [*] codec_silk
- Select [*] codec_siren7
- Select [*] codec_siren14
- Select [*] codec_g729a
- Under Core Sound Packages:
- Deselect [*] CORE-SOUNDS-EN-GSM
- Select [*] CORE-SOUNDS-EN-WAV
- Select [*] CORE-SOUNDS-EN-G722
- Select [*] CORE-SOUNDS-EN-G729
- Under Extras Sound Packages:
- Select [*] EXTRA-SOUNDS-EN-WAV
- Select [*] EXTRA-SOUNDS-EN-G722
- Select [*] EXTRA-SOUNDS-EN-G729
$ make
$ sudo ./contrib/scripts/get_mp3_source.sh
$ sudo make install
$ sudo make config
$ sudo make samples
$ sudo mkdir /etc/asterisk/samples
$ sudo mv /etc/asterisk/*.* /etc/asterisk/samples/
$ sudo asterisk -rvvvv
Most important config files:
- extensions.conf
- pjsip.conf
2.2. Virtual machine vm1
Purpose: VoIP GSM Gateway to handle voice call from and or to 3G/4G/5G MNOs.
- OS: Debian 12
- IP: 192.168.1.11
- Software: Asterisk
- Driver: sterisk-chan-quectel
2.3. Virtual machine vm0
Purpose: Local PBX.
- OS: Debian 12
- IP: 192.168.1.10
- Software: Asterisk
3. Resource
Softwares:
- Servers:
- Clients:
- Docs:
- Ref: