Topologi
Dalam proyek ini akan dibangun sambungan line PABX baru melalui jalur wireless dari Main Office ke Remote Office A dan Remote Office B untuk itu dibutuhkan SPA400, (Internet Telephony Gateway) dan PAP2T (Internet Phone Adapters) serta tentu saja Asterisk. SPA400 ini menghubungkan jaringan telpon analog (PSTN atau PABX) ke jaringan VOIP (Asterisk). PAP2T menghubungkan pesawat telpon ke jaringan VOIP. Asterisk dikonfigurasi agar nomor extension PABX tertentu selalu melalui port tertentu di SPA400 (incoming dan outgoing).
- Mikrotik RB750 : 192.168.51.190
- Server Linux (CentOS 5.4) : 192.168.51.253
Perangkat VOIP
- SPA400 (Internet Telephony Gateway w/ 4 FXO ports)
No Nama IP Address Line 1 Line 2 Line 3 Line 4 UserID 1 SPA400-1 192.168.51.185 310 311 320 321 9000 2 SPA400-2 192.168.51.172 - 312 - - 9001 - PAP2T (Internet Phone Adapters with 2 VoIP Ports)
No Nama IP Address Phone 1 (VOIP 1) Phone 2 (VOIP 2) 1 PAP2T-1 192.168.51.186 321 (2000) 311 (2001) 1 PAP2T-2 192.168.51.187 310 (2002) 320 (2003) 3 PAP2T-3 192.168.51.173 312 (2004) -
Instalasi Asterisk
Berikut ini instalasi asterisk di centos 5.4.
- Buat file /etc/yum.repos.d/centos-asterisk.repo:
[asterisk-tested] name=CentOS-$releasever - Asterisk - Tested baseurl=http://packages.asterisk.org/centos/$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium [asterisk-current] name=CentOS-$releasever - Asterisk - Current baseurl=http://packages.asterisk.org/centos/$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey=http://packages.asterisk.org/RPM-GPG-KEY-Digium
- Buat file /etc/yum.repos.d/centos-digium.repo:
[digium-tested] name=CentOS-$releasever - Digium - Tested baseurl=http://packages.digium.com/centos/$releasever/tested/$basearch/ enabled=0 gpgcheck=0 #gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium [digium-current] name=CentOS-$releasever - Digium - Current baseurl=http://packages.digium.com/centos/$releasever/current/$basearch/ enabled=1 gpgcheck=0 #gpgkey=http://packages.digium.com/RPM-GPG-KEY-Digium
- Instal asterisk
Konfigurasi Asterisk
- Buat file /etc/asterisk/sip.conf
[general] port = 5060 bindaddr = 0.0.0.0 context = others register => 9000@192.168.51.185/9000 register => 9001@192.168.51.172/9001 [2000] type=friend defaultuser=2000 context=ph2000 secret=1234 host=dynamic dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=ulaw [2001] type=friend defaultuser=2001 context=ph2001 secret=1234 host=dynamic dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=ulaw [2002] type=friend defaultuser=2002 context=ph2002 secret=1234 host=dynamic dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=ulaw [2003] type=friend defaultuser=2003 context=ph2003 secret=1234 host=dynamic dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=ulaw [2004] type=friend defaultuser=2004 context=ph2004 secret=1234 host=dynamic dtmfmode=rfc2833 canreinvite=no disallow=all allow=alaw allow=ulaw [9000] ;type=peer type=friend user=9000 host=192.168.51.185 dtmfmode=rfc2833 canreinvite=no context=from-spa400-1 insecure=port,invite disallow=all allow=alaw allow=ulaw [9001] ;type=peer type=friend user=9001 host=192.168.51.172 dtmfmode=rfc2833 canreinvite=no context=from-spa400-2 insecure=port,invite disallow=all allow=alaw allow=ulaw
- Buat File /etc/asterisk/extension.conf:
[globals] TRUNK1=SIP/9000 TRUNK2=SIP/9001 [others] [trunklocal] include => fun-stuff exten => _200[0-4],1,Dial(SIP/${EXTEN},15) exten => _200[0-4],2,VoiceMail(${EXTEN},u) exten => h,1,Hangup ; 321 [ph2000] include => trunklocal exten => _XXX,1,Dial(${TRUNK1}/L1${EXTEN},15) exten => _70X.,1,Dial(${TRUNK1}/L1${EXTEN},15) exten => _83X.,1,Dial(${TRUNK1}/L1${EXTEN},15) exten => h,1,Hangup ; 311 [ph2001] include => trunklocal exten => _XXX,1,Dial(${TRUNK1}/L2${EXTEN},15) exten => _70X.,1,Dial(${TRUNK1}/L2${EXTEN},15) exten => _83X.,1,Dial(${TRUNK1}/L2${EXTEN},15) exten => h,1,Hangup ; 310 [ph2002] include => trunklocal exten => _XXX,1,Dial(${TRUNK1}/L3${EXTEN},15) exten => _70X.,1,Dial(${TRUNK1}/L3${EXTEN},15) exten => _83X.,1,Dial(${TRUNK1}/L3${EXTEN},15) exten => h,1,Hangup ; 320 [ph2003] include => trunklocal exten => _XXX,1,Dial(${TRUNK1}/L4${EXTEN},15) exten => _70X.,1,Dial(${TRUNK1}/L4${EXTEN},15) exten => _83X.,1,Dial(${TRUNK1}/L4${EXTEN},15) exten => h,1,Hangup ; 312 [ph2004] include => trunklocal exten => _XXX,1,Dial(${TRUNK2}/L2${EXTEN},15) exten => _70X.,1,Dial(${TRUNK2}/L2${EXTEN},15) exten => _83X.,1,Dial(${TRUNK2}/L2${EXTEN},15) exten => h,1,Hangup [from-trunk-1] exten => 321,1,Dial(SIP/2000,15) ;exten => 321,2,VoiceMail(2000,u) ;exten => 321,2,Hangup exten => 311,1,Dial(SIP/2001,15) ;exten => 311,2,VoiceMail(2001,u) ;exten => 311,2,Hangup exten => 310,1,Dial(SIP/2002,15) ;exten => 310,2,VoiceMail(2002,u) ;exten => 310,2,Hangup exten => 320,1,Dial(SIP/2003,15) ;exten => 320,2,VoiceMail(2003,u) ;exten => 320,2,Hangup exten => h,1,Hangup ;exten => _X.,1,Congestion() [from-trunk-2] exten => 312,1,Dial(SIP/2004,15) ;exten => 312,2,VoiceMail(2004,u) ;exten => 312,2,Hangup exten => h,1,Hangup ;exten => _X.,1,Congestion() [from-spa400-1] exten => _X.,1,Goto(from-trunk-1,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1) [from-spa400-2] exten => _X.,1,Goto(from-trunk-2,${CUT(CUT(SIP_HEADER(To),@,1),:,2)},1) [fun-stuff] exten => 500,1,Answer() exten => 500,2,Playback(demo-echotest) exten => 500,3,Echo exten => 500,4,Playback(demo-echodone) exten => 500,5,Hangup - Buat file /etc/asterisk/voicemail.conf:
[general] format = wav [default] 2000 => 4711,voicemail,2000@domain.com 2001 => 0815,voicemail,2001@domain.com 2002 => 0915,voicemail,2002@domain.com 2003 => 1015,voicemail,2003@domain.com 2004 => 1115,voicemail,2004@domain.com
- Jalankan asterisk.
/etc/init.d/asterisk start
Konfigurasi SPA400
- SPA400-1
- User ID : 9000
- IP Address : 192.168.51.185/255.255.255.192
- Gateway : 192.168.51.190
- Port ID
- Port ID 1 : 321
- Port ID 2 : 311
- Port ID 3 : 310
- Port ID 4 : 320
- SPA400-2
- User ID : 9001
- IP Address : 192.168.51.172/255.255.255.192
- Gateway : 192.168.51.190
- Port ID
- Port ID 1 : OFF1
- Port ID 2 : 312
- Port ID 3 : OFF3
- Port ID 4 : OFF4
- Konfigurasi Voice atau PSTN
- Setelah itu hubungkan line pabx sesuai nomor ext ke line1 s/d line4 di SPA400-1 dan line2 di SPA400-2. Status masing-masing SPA400 diperlihatkan pada gambar-gambar di bawah ini.
Pastikan bahwa SIP registration status menunjukkan Registered (apabila asterisk sudah running). Kemudian lihat Battery Level di Line 1 s/d 4 (SPA400-1), apabila semua line extension PABX telah disambungkan ke port-port line 1 s/d 4 di SPA400-1 maka akan ditunjukkan besar tegangan tertentu seperti 27V.Line status menunjukkan apakah ada komunikasi voip atau tidak. Jika ada komunikasi dan pembicaraan sedang berlangsung maka status dari line yang bersangkutan akan berisi Off-Hook dan tegangan line tersebut akan senantiasa < 10V. Misal jika ada panggilan melalui line 1 kemudian terjadi pembicaraan telpon maka status line 1 akan menunjukkan Off-Hook dan tegangan line 1 akan senantiasa < 10V.Apabila USB Capacity status menunjukkan error atau tidak sesuai nilai di atas, itu berarti usb flash disk belum dicolokkan ke port usb di SPA400. Matikan dahulu SPA400 sebelum mencolokkan usb.Saat memasukkan extension PABX ke port-port line di SPA400 selalu monitor battery level seperti gambar di atas. Apabila ada keanehan seperti semua line menunjukkan level tegangan namun yang dimasukkan hanya 3 line atau kurang dari itu maka matikan SPA400, tunggu sesaat kemudian hidupkan kembali.
Konfigurasi PAP2T
- Konfigurasi IP Address
Untuk konfigurasi IP Address PAP2T gunakan Interactive Voice Response Menu dengan cara hubungkan pesawat telpon ke salah satu port phone di PAP2T kemudian dial ****. Jangan tekan tombol apa pun sampai terdengar suara “Configuration menu. Please enter option followed by the # (pound) key or hang up to exit.”Command Description 100# Check DHCP feature status (wheter or not unit obtains ip via dhcp) 101# Change DHCP feature (1 to enable, 0 to disable) 110# Announce IP Address of the unit 111# To set a static IP address, the DHCP feature must be disabled . If the DHCP feature is enabled, you will hear, “Invalid Option”. Enter the IP address using the numbers on your telephone keypad. Use the * (star) key to enter a decimal point. 120# Announce netmask of the unit 121# To set the network mask, the DHCP feature must be disabled . If the DHCP feature is enabled, you will hear, “Invalid Option”. Enter the network mask using numbers on your telephone keypad. Use the * (star) key to enter a decimal point. 130# Announce default route of the unit 131# To set a static gateway IP address, the DHCP feature must be disabled. If the DHCP feature is enabled, you will hear, “Invalid Option”. Enter the IP address using numbers on your telephone keypad. Use the * (star) key to enter a decimal point. 150# Gives firmware version 732668# Reboot the unit No Nama IP Address Netmask Gateway 1 PAP2T-1 192.168.51.186 255.255.255.192 192.168.51.190 2 PAP2T-2 192.168.51.187 255.255.255.192 192.168.51.190 3 PAP2T-3 192.168.51.173 255.255.255.192 192.168.51.190 - Line Configuration
Untuk setup line configuration login ke alamat web PAP2T http://192.168.51.187.
Lalu klik link Admin Login:Line Configuration Global untuk PAP2TProxy : 192.168.51.253 Register : Yes Register Expires : 3600 Make Call Without Reg : No Ans Call Without Reg : No Preferred Codec : G711a Line Configuration PAP2T-1Line Line Enable SIP Port Display Name User ID Password Use Auth ID 1 yes 5060 2000 2000 1234 no 2 yes 5061 2001 2001 1234 no Line Configuration PAP2T-2Line Line Enable SIP Port Display Name User ID Password Use Auth ID 1 yes 5060 2002 2002 1234 no 2 yes 5061 2003 2003 1234 no Line Configuration PAP2T-3Line Line Enable SIP Port Display Name User ID Password Use Auth ID 1 yes 5060 2004 2004 1234 no
Test VOIP
- Setelah semua unit PAP2T dipasang dengan benar sesuai seting di atas maka selanjutnya jalankan browser dan buka status PAP2T-1 di http://192.168.51.186
- Pastikan bahwa status registrasi line 1 dan line 2 sudah Online seperti gambar di bawah:
- Lakukan langkah yang sama untuk mencek status PAP2T yang lain.
- Angkat pesawat telpon yang tersambung ke PAP2T dan pastikan mendengar nada dialtone.
- Lakukan test dial ke nomor VOIP. Misal jika dari pesawat 2000 dial ke 2001, 2002, 2003 dan 2004.
- Lakukan test dial ke nomor EXT. Misal jika dari ext 310 dial ke ext 311, 312, 320 dan 321. Lakukan pula ke nomor EXT di Main Office.
- Minta teman di Main Office untuk telpon ke salah satu nomor extension (310, 311, 312, 320 atau 321).
- Apabila ada masalah seperti sambungan sibuk yang ditunjukkan dengan tegangan pada sambungan drop di angka < 10V padahal sudah tidak ada percakapan di sambungan tersebut maka reboot SPA400 di Menu Administration / Reboot.
Monitor Asterisk
- Setelah logon ke server linux sebagai user root jalankan perintah di bawah:
asterisk -rvvvv
- Asterisk akan menampilkan output sebagai berikut:
Asterisk 1.6.2.19, Copyright (C) 1999 - 2010 Digium, Inc. and others. Created by Mark Spencer Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Connected to Asterisk 1.6.2.19 currently running on server (pid = 3612) Verbosity is at least 4
- Jalankan perintah sip show peers di command line asterisk untuk melihat sip peers.
server*CLI> sip show peers Name/username Host Dyn Nat ACL Port Status 2000/2000 192.168.51.186 D 5060 Unmonitored 2001/2001 192.168.51.186 D 5061 Unmonitored 2002/2002 192.168.51.187 D 5060 Unmonitored 2003/2003 192.168.51.187 D 5061 Unmonitored 2004/2004 192.168.51.173 D 5060 Unmonitored 9000 192.168.51.185 5060 Unmonitored 9001 192.168.51.172 5060 Unmonitored 7 sip peers [Monitored: 0 online, 0 offline Unmonitored: 7 online, 0 offline] server*CLI>
- Jalankan sip show registry untuk melihat status sip registration.
server*CLI> sip show registry Host dnsmgr Username Refresh State Reg.Time 192.168.51.172:5060 N 9001 105 Registered Thu, 30 Aug 2012 08:23:36 192.168.51.185:5060 N 9000 105 Registered Thu, 30 Aug 2012 08:24:07 2 SIP registrations.
- Tes dial ke no extension 312 dan perhatikan log di asterisk saat panggilan masuk (ringing), panggilan dijawab (answered) dan panggilan berakhir (hangup).
server*CLI> == Using SIP RTP CoS mark 5 -- Executing [9001@from-spa400-2:1] Goto("SIP/9001-0000001a", "from-trunk-2,312,1") in new stack -- Goto (from-trunk-2,312,1) -- Executing [312@from-trunk-2:1] Dial("SIP/9001-0000001a", "SIP/2004,15") in new stack == Using SIP RTP CoS mark 5 -- Called 2004 -- SIP/2004-0000001b is ringing -- SIP/2004-0000001b answered SIP/9001-0000001a -- Packet2Packet bridging SIP/9001-0000001a and SIP/2004-0000001b -- Executing [h@from-trunk-2:1] Hangup("SIP/9001-0000001a", "") in new stack == Spawn extension (from-trunk-2, h, 1) exited non-zero on 'SIP/9001-0000001a' == Spawn extension (from-trunk-2, 312, 1) exited non-zero on 'SIP/9001-0000001a' -- Executing [h@from-trunk-2:1] Hangup("SIP/9001-0000001a", "") in new stack == Spawn extension (from-trunk-2, h, 1) exited non-zero on 'SIP/9001-0000001a' server*CLI>
Catatan: Panggilan yang melalui SPA400 akan diteruskan ke asterisk setelah 3 nada dering (default).