Tutorial yang saya bagikan kali ini menggunakan Raspberry Pi dengan sistem operasi Raspbian (Debian Jessie). Asterisk dan paket chan_dongle di install secara manual pada Sistem Operasi Raspbian. Namun jika anda menggunakan Raspbx sudah langsung include asterisk & chan_dongle.
Berikut tahap tahapnya.
System Environtment
- Rasberry Pi Model B+ 1 GB
- Raspbian (Debian Jessie) / Raspbx
- Asterisk 11
- Chan_dongle (patched for asterisk 11)
- Huawei 3G Modem E1550
Linux Kernel source
Linux kernel upgrade to 3.4.79apt-get install linux-image-3.4.79-sun4i
Reboot sistem
apt-get install linux-headers-`uname -r`
Kompilasi software suite (Dependensi)
apt-get install build-essential automake git libncurses5-dev libxml2-dev libsqlite3-dev sqlite3 mysql-client libmysql++-dev libmyodbc libssl-dev libcurl4-openssl-dev libgmime-2.6-dev unixodbc-dev uuid-dev libsrtp0-dev libiksemel-dev
Hardware drivers
Install paket berikut :
apt-get install usbutils usb-modeswitch
Sebelum memasukkan USB Dongle GSM.
Sebelum menyambungkan GSM USB Dongle, gunakan perintah lsusb untuk melihat interface device yang sudah ada.
# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub # ls -l /dev/ttyUSB* ls: cannot access /dev/ttyUSB*: No such file or directory
Setelah memasukkan USB Dongle GSM.
Setelah anda menghubungkan modem GSM, periksa kembali menggunakan lsusb untuk memastikan interface device modem anda terbaca oleh sistem linux.
# lsusb Bus 004 Device 003: ID 12d1:1001 Huawei Technologies Co., Ltd. E169/E620/E800 HSDPA Modem Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub # ls -l /dev/ttyUSB* crw-rw---T 1 root dialout 188, 0 Feb 28 09:21 /dev/ttyUSB0 crw-rw---T 1 root dialout 188, 1 Feb 28 09:21 /dev/ttyUSB1 crw-rw---T 1 root dialout 188, 2 Feb 28 09:21 /dev/ttyUSB2
Jika ttyUSB group permissions belum terdaftar asterisk (masih dlm kondisi root), lanjutkan dengan langkah berikut:
Add /etc/udev/rules.d/92-huawei-3g.rules
Add /etc/udev/rules.d/92-huawei-3g.rules
KERNEL=="tty[A-Z]*", NAME="%k", GROUP="asterisk", MODE="0660"
Restart udev service
#> service udev stop #> service udev start
Install Asterisk 11
cd /usr/src
tar xzf asterisk-11-current.tar.gz
cd cd asterisk-11.16.0/
./configure
make menuselect
make
make install
make install-logrotate
make config
make samples
Pengaturan profil startup Asterisk
root# / etc / default / asterisk
AST_USER = "asterisk" AST_GROUP = "asterisk"
Menambahkan account dan group ke Asterisk (paket yang diinstall)
addgroup --system asterisk adduser --system --ingroup asterisk --home /var/lib/asterisk --no-create-home --shell /bin/bash asterisk
Pengaturan hak akses direktori / permissions
chown -R asterisk:asterisk /etc/asterisk chown -R asterisk:asterisk /var/{run,log,spool,lib}/asterisk
Menjalankan service asterisk
/etc/init.d/asterisk start
Menutup service asterisk
/etc/init.d/asterisk stop
CATATAN:
Setelah menjalankan service, prompt ini muncul:
asteriskPrivilege Escalation Protection disabled!
Lihat https://wiki.asterisk.org/wiki/x/1gKfAQ untuk rincian lebih. Untuk mengatasi ini, memodifikasi file /etc/asterisk/asterisk.conf menghapus komentar simbol live_dangerously = no kemudian restart service asterisk, /etc/init.d/asterisk start.
Install chan_dongle untuk asterisk 11
cd /usr/src wget https://github.com/jstasiak/asterisk-chan-dongle/archive/asterisk11.zip unzip asterisk11.zip cd asterisk-chan-dongle-asterisk11 aclocal autoconf automake -a ./configure make make install cp etc/dongle.conf /etc/asterisk/ chown asterisk:asterisk /etc/asterisk/dongle.conf
modul tes Chan_Dongle
/etc/init.d/asterisk start #> asterisk -rx "module show like dongle" Module Description Use Count chan_dongle.so Huawei 3G Dongle Channel Driver 0 1 modules loaded
Pengaturan Modul chan_dongle
root# /etc/asterisk/dongle.conf
[general] ... [defaults] context=from-trunk ... dtmf=inband ... exten=+62 8xx xxx (no hape selular yang digunaka) [dongle0] audio=/dev/ttyUSB1 data=/dev/ttyUSB2 imei=12345678xxx --> hilangkan komentar (;) imsi=12345678xxx --> hilangkan komentar (;)
Lihat IMEI & IMSI
- Pasang di kartu SIM
- Raspbian*CLI> dongle show device
raspbian*CLI> dongle reload now == Parsing '/etc/asterisk/dongle.conf': Found [Des 05 09:50:34] NOTICE[3351]: chan_dongle.c:420 do_monitor_phone: [dongle0] stopping by restart request -- [dongle0] Dongle has disconnected -- [dongle0] Trying to connect on /dev/ttyUSB2... -- [dongle0] Dongle has connected, initializing... -- [dongle0] Dongle initialized and ready raspbian*CLI> dongle show devices ID Group State RSSI Mode Submode Provider Name Model Firmware IMEI IMSI Number dongle0 0 Free 28 0 0 IND TELKOMSEL E1550 11.608.14.11.00 352445047690814 510103272276006 Unknown
IMEI & IMSI set dongle.conf
IMEI = 352445047690814 IMSI = 510103272276006 exten = 081xxxx..., yang merupakan nomor telepon kartu SIM
Terapkan Pengaturan
raspbian*CLI> dongle reload now == Parsing '/etc/asterisk/dongle.conf': Found [Feb 28 09:58:14] NOTICE[3355]: chan_dongle.c:420 do_monitor_phone: [dongle0] stopping by restart request -- [dongle0] Dongle has disconnected -- [dongle0] Trying to connect on /dev/ttyUSB2... -- [dongle0] Dongle has connected, initializing... -- [dongle0] Dongle initialized and ready
Deteksi Lokasi
raspbiyan*CLI> dongle show device state dongle0 -------------- Status ------------- Device : dongle0 State : Free Audio : /dev/ttyUSB1 Data : /dev/ttyUSB2 Voice : Yes SMS : Yes Manufacturer : huawei Model : E1550 Firmware : 11.608.14.11.00 IMEI : 352445047690814 IMSI : 510103272276006 GSM Registration Status : Registered, home network RSSI : 26, -61 dBm Mode : No Service Submode : No service Provider Name : IND TELKOMSEL Location area code : Cell ID : Subscriber Number : Unknown SMS Service Center : +6xxx Use UCS-2 encoding : Yes USSD use 7 bit encoding : No USSD use UCS-2 decoding : Yes Tasks in queue : 0 Commands in queue : 0 Call Waiting : Disabled Current device state : start Desired device state : start When change state : now Calls/Channels : 0 Active : 0 Held : 0 Dialing : 0 Alerting : 0 Incoming : 0 Waiting : 0 Releasing : 0 Initializing : 0
Uji chan_dongle
disesuaikan untuk nomor kartu SIM dari telepon lain
#> asterisk -rvvvvvvv [Feb 28 10:05:36] WARNING[3381][C-00000001]: pbx.c:6646 __ast_pbx_run: Channel 'Dongle/dongle0-0100000001' sent to invalid extension but no invalid handler: context,exten,priority=from-trunk,081xxxx...,1
Pesan diatas menunjukkan keberhasilan panggilan pada chan_dongle GSM.
Pengaturan menggunakan FreePBX
Setting Inbound
- OK dongle.conf within two parameters:
- [defaults] > context=from-trunk
- [Dongle0]> exten = <SIM card phone number>
- FreePBX > Inbound Routes > Add Inbound Roue
- Description: dongle0
- DID Number: <SIM card number>
- Set Destination: <whatever you wanted>
Pengaturan Outbound
1. Setting Custom Trunk
FreePBX > Trunks > Add Custom Trunk
- Trunk Description: dongle0
- Outbound Caller ID: <phone number>
- Custom Dial String: dongle/dongle0/$OUTNUM$
CATATAN: dongle0 harus sesuai dengan dongle.conf yang dikonfigurasi.
2. Setting Outbound Route
FreePBX > Outbound Routes > Add Route
FreePBX > Outbound Routes > Add Route
- Route Name: dongle0
- Dial Patterns: X.
- Trunk Sequence: dongle/dongle0/$OUTNUM$
Selamat mencoba.
Comments
Post a Comment