Friday, July 22, 2011

Install playsms and kannel on CentOS 6 Final and Huawei E220 unlocked



"tutorial ini murni buatan sendiri jika ada kesamaan nama, tempat atau kejadian itu hanya kebetulan belaka"

persiapan sebelum melakukan compile kannel dan konfigurasi playsms, pastikan sudah terinstall gcc dan libxml2-devel, install jika belum ada

yum install gcc
yum install libxml2-devel
yum install wvdial


cek modem huawei e220
wvdialconf /etc/wvdial.conf

jika terdeksi akan muncul seperti contoh :
Editing `/etc/wvdial.conf'.

Scanning your serial ports for a modem.

Modem Port Scan<*1>: S0 S1 S2 S3
WvModem<*1>: Cannot get information for serial port.
ttyUSB0<*1>: ATQ0 V1 E1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB0<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB0<*1>: Speed 9600: AT -- OK
ttyUSB0<*1>: Max speed is 9600; that should be safe.
ttyUSB0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
WvModem<*1>: Cannot get information for serial port.
ttyUSB1<*1>: ATQ0 V1 E1 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 Z -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
ttyUSB1<*1>: Modem Identifier: ATI -- Manufacturer: huawei
ttyUSB1<*1>: Speed 9600: AT -- OK
ttyUSB1<*1>: Max speed is 9600; that should be safe.
ttyUSB1<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
ttyUSB1: Speed 9600; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"

download xampp
http://nchc.dl.sourceforge.net/project/xampp/XAMPP%20Linux/1.7.4/xampp-linux-1.7.4.tar.gz
tar zxvf xampp-linux-1.7.4.tar.gz -C /opt/
cd /opt/lampp
./lampp start

download sms engine kannel
wget http://www.kannel.org/download/1.4.3/gateway-1.4.3.tar.gz
tar zxvf gateway-1.4.3.tar.gz -C /usr/local/src/
cd /usr/local/src/gateway-1.4.3/
mkdir -p /opt/kannel
./configure --prefix=/opt/kannel
make
make install

buat konfigurasi kannel.conf untuk modem E220 huawei seperti ini, simpan di /opt/kannel/sbin/
#CORE
group = core
admin-port = 13000
admin-password = playsms
status-password = playsms
log-file = "/var/log/kannel/kannel.log"
log-level = 0
access-log = "/var/log/kannel/access.log"
smsbox-port = 13001
store-type = file
store-file = "/var/log/kannel/kannel.store"

#SMSC MODEM GSM
group = smsc
smsc = at
port = 13013
host = "localhost"
smsc-id = Huawei
modemtype = Huawei
device = /dev/ttyUSB1
speed = 9600
sms-center = "isi dengan sms center"

group = modems
id = huawei
name = huawei
detect-string = "huawei"
init-string = "AT+CNMI=2,1,0,0,0;+CMEE=1"

#SMSBOX SETUP
group = smsbox
bearerbox-host = localhost
bearerbox-port = 13001
sendsms-port = 13131
sendsms-chars = "0123456789+"
global-sender = "isi dengan sms center"
log-file = "/var/log/kannel/smsbox.log"
log-level = 0
access-log = "/var/log/kannel/access.log"

#SEND-SMS USERS
group = sendsms-user
username = playsms
password = playsms

#SMS SERVICE
group = sms-service
keyword = default
accept-x-kannel-headers = true
max-messages = 0
assume-plain-text = true
catch-all = true
get-url = "http://localhost/playsms/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a"

jalankan sms engine
cd /opt/kannel/sbin
./bearerbox kannel.conf &
./smsbox kannel.conf &

download aplikasi (playsms)
wget http://nchc.dl.sourceforge.net/project/playsms/playsms/Version%200.9.5.2/playsms-0.9.5.2.tar.gz
tar zxvf playsms-0.9.5.2.tar.gz -C /usr/local/src/
cd /usr/local/src/playsms-0.9.5.2/web
mkdir -p /opt/lampp/htdocs/playsms
mkdir -p /var/spool/playsms
mkdir -p /var/log/playsms
cp -rR * /opt/lampp/htdocs/playsms/
/opt/lampp/bin/mysqladmin -u root -p create playsms
/opt/lampp/bin/mysql -u root -p playsms < /usr/local/src/playsms-9.5.2/db/playsms.sql cd bin/ cp playsmsd playsmsd_start playsmsd.php /usr/local/bin cp playsms /etc/default/

aktifkan sms engine di menu Gateway > Manage Kannel > kannel (Inactive) (click here to activate)

jalankan playsmsd_start
/usr/local/bin/playsmsd_start

login ke http://localhost/playsms username dan password admin, testing kirim dan terima

jika ingin dengan git repository untuk konfigurasi sama seperti yang diatas
git clone git://playsms.git.sourceforge.net/gitroot/playsms/playsms

5 comments:

  1. Saya sudah install, berhasil jalan. Tp kadang ndak mau kirim, pending. Terkadang mau lagi. Kirim sms ke 250 orang, tidak s3muanya sampai pada hari yang sama, bisa beda 3 hari. Saya pakai nomor xl, apa sebabnya?

    ReplyDelete
    Replies
    1. coba lihat status lognya bagaimana?

      Delete
  2. wow keren ..
    klo source code php untuk send sms ada mas ?
    bantu donk mas , aku kesulitan dsitu ..
    ditunggu replynya scepatnya :)
    makasih mas .. twitter : @ichsanmuhammad7

    ReplyDelete
  3. Mau naya Ya Sms ni Credit Nya DI Potong Yah, Atau Gi Mana Ya Minta Penjelasan

    ReplyDelete
    Replies
    1. Credit SMS sesuai harga dari masing2 Operator per smsnya, Ini sebagai Server SMS Gateway Personal, versi web

      Delete