Phong Lan

Chuyển đổi số cho doanh nghiệp tại Việt Nam.


(D241024) IP PBX call distributor VoIP Gateway GSM/3G/4G/5G for home and small office

PROOF OF CONCEPT

1. Requirement and concept

We're building a PBX system for our business. It will handle:

Flow Incoming Call

Since we don't have any SIP trunk from our carriers, we will take incoming calls from regular sim cards.

Call flow as bellow: GSM PBX diagram

Our stack:

2. Step by step

2.1 Asterisk Installation

$ 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.

$ 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:

2.2. Virtual machine vm1

Purpose: VoIP GSM Gateway to handle voice call from and or to 3G/4G/5G MNOs.

2.3. Virtual machine vm0

Purpose: Local PBX.

3. Resource

Softwares:

4. Miscellaneous

test@vm0:~$ cat /etc/asterisk/pjsip.conf 
;===============TRANSPORT

[system-udp]
type=transport
protocol=udp
bind=0.0.0.0

;===============TRUNK

[miko0]
type=aor
contact=sip:192.168.1.11:5060

[miko0]
type=endpoint
context=quectel-incoming
disallow=all
allow=ulaw
aors=miko0

[miko0]
type=identify
endpoint=miko0
match=192.168.1.11
test@vm0:~$ cat /etc/asterisk/extensions.conf 
[quectel-incoming]
exten => _+84XXXXXXXXX,1,Dial(PJSIP/200@miko0)
exten => s,n,Hangup()

edit /etc/asterisk/indications.conf on vm1

#!/bin/bash 

configPath="$1" # Path to the original config file

sed -i 's/country=ru/country=vn/g' "$configPath"
cat >> "$configPath" <<EOF

[vn]
description = Vietnam
; Clone from China
ringcadence = 1000,4000
dial = 450
busy = 450/350,0/350
ring = 450/1000,0/4000
congestion = 450/700,0/700
callwaiting = 450/400,0/4000
dialrecall = 450
record = 950/400,0/10000
info = 450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400
stutter = 450+425
EOF

5. Test

Number: 0918026858

« Trang trước Trang sau »