Konfigurasi Kannel

Tulisan ini adalah pengalaman saya waktu mengkonfigurasi kannel yang digunakan untuk sms gateway. Kendala yang dihadapi pada saat itu yaitu penentuan device yang digunakan oleh handphone dan konfigurasi smskannel.conf yang berbeda untuk setiap type handphone.

Sebenarnya bukan hanya kannel yang diperlukan untuk membangun sebuah sms gateway kita juga butuh apache sebagai web server untuk interface dari sms gateway dan MySQl untuk databasenya… tapi saya tidak akan menjelaskan disini dikarenakan sudah banyak yang membahas (ada bukunya juga lho)…

Dalam kesempatan ini system operasi yang digunakan yaitu Fedora core 4 dan juga berjalan baik di fedora core 6. handphone yang digunakan yaitu Sony Ericcson K320i (saya belum pernah nyoba dengan hp selain ini :( ).

Berikut ini langkah – langkah konfigurasinya:

  • Saya asumsikan kannel sudah terinstall di computer dan disimpan di /home/cyber/gateway-1.4.1 dan kita bekerja sebagai root
  • pasangkan kabel data handphone ke komputer (saya pake kabel data USB)
  • cek apakah handphone sudah terkoneksi dengan komputer dan memakai device apa.

[root@localhost ~]# tail -f /var/log/messages
Jun 22 09:14:32 localhost kernel: SELinux: initialized (dev hdc, type iso9660),uses genfs_contexts
Jun 22 09:14:33 localhost gconfd (indra-2702): Resolved address “xml:readonly:/etc/gconf/gconf.xml.mandatory” to a read-only configuration source at position 0
Jun 22 09:14:33 localhost gconfd (cyber-2702): Resolved address “xml:readwrite:/home/cyber/.gconf” to a writable configuration source at position 1 Jun 22 09:14:33 localhost gconfd (cyber-2702): Resolved address “xml:readonly:/e tc/gconf/gconf.xml.defaults” to a read-only configuration source at position 2
Jun 22 09:15:43 localhost kernel: usb 1-1: new full speed USB device using uhci_hcd and address 2
Jun 22 09:15:51 localhost kernel: cdc_acm 1-1:1.1: ttyACM0: USB ACM device
Jun 22 09:15:51 localhost kernel: cdc_acm 1-1:1.3: ttyACM1: USB ACM device
Jun 22 09:15:51 localhost kernel: usbcore: registered new driver cdc_acm
Jun 22 09:15:51 localhost kernel: drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters
Jun 22 09:16:26 localhost su(pam_unix)[2942]: session opened for user root by (uid=500)

Dengan hasil diatas dapat kita ketahui klo handphone sudah terhubung dan menggunakan ttyACM0 untuk berhubungan dengan computer. Hal ini sangat berguna untuk konfigurasi device di smskannel.conf

  • jika device yang dipakai sudah diketahui, edit file smskannel.conf. bisa lewat vi ataupun GUI

[root@localhost ~]# cd /home/cyber/gateway-1.4.1/gw

[root@localhost gw]# vi smskannel.conf

#
# THIS IS A SAMPLE CONFIGURATION FOR SMS KANNEL
#
# This basic version is used for system testing. It expects ‘fakesmsc’ to
# send messages which are replied with simple fixed text message.
# It is run like this:
#
# 1% gw/bearerbox gw/smskannel.conf
# 2% gw/smsbox gw/smskannel.conf
# 3% test/fakesmsc -i 0.1 -m 100 “123 345 text nop”
#
# ..all 3 commands in separate shells (or screen sessions)
# Note that you can run them in different machines but have to
# add certain command line argument and configuration variables then
#
#
# For any modifications to this file, see Kannel User Guide
# If that does not help, see Kannel web page (http://www.kannel.org) and
# various online help and mailing list archives
#
# Notes on those who base their configuration on this:
# 1) check security issues! (allowed IPs, passwords and ports)
# 2) groups cannot have empty rows inside them!
# 3) read the user guide
#
# Kalle Marjola for Kannel project 2001, 2004

#———————————————
# CORE
#
# There is only one core group and it sets all basic settings
# of the bearerbox (and system). You should take extra notes on
# configuration variables like ’store-file’ (or ’store-dir’),
# ‘admin-allow-ip’ and ‘access.log’

group = core
admin-port = 13000
smsbox-port = 13001
admin-password = bar
#status-password = foo
#admin-deny-ip = “”
#admin-allow-ip = “”
#log-file = “/tmp/kannel.log”
#log-level = 0
box-deny-ip = “*.*.*.*”
box-allow-ip = “127.0.0.1″
#unified-prefix = “+358,00358,0;+,00″
#access-log = “/tmp/access.log”
#store-file = “kannel.store”
#ssl-server-cert-file = “cert.pem”
#ssl-server-key-file = “key.pem”
#ssl-certkey-file = “mycertandprivkeyfile.pem”

#———————————————
# SMSC CONNECTIONS
#
# SMSC connections are created in bearerbox and they handle SMSC specific
# protocol and message relying. You need these to actually receive and send
# messages to handset, but can use GSM modems as virtual SMSCs

# This is a fake smsc connection, _only_ used to test the system and services.
# It really cannot relay messages to actual handsets!

#group = smsc
#smsc = fake
#smsc-id = FAKE
#port = 10000
#connect-allow-ip = 127.0.0.1
group = smsc
smsc = at
smsc-id = Cell
modemtype = sephone (pengenal untuk hp Sony Ericsson)
device = /dev/ttyACM0 (didapat dari pengecekan dengan perintah tail diatas)
sms-center = +62855000000 (kartu SIM yang digunakan IM3)
speed = 19200

#———————————————
# SMSBOX SETUP
#
# Smsbox(es) do higher-level SMS handling after they have been received from
# SMS centers by bearerbox, or before they are given to bearerbox for delivery

group = smsbox
bearerbox-host = 127.0.0.1
sendsms-port = 13013
global-sender = 13013
#sendsms-chars = “0123456789 +-”
#log-file = “/tmp/smsbox.log”
#log-level = 0
#access-log = “/tmp/access.log”

#———————————————
# SEND-SMS USERS
#
# These users are used when Kannel smsbox sendsms interface is used to
# send PUSH sms messages, i.e. calling URL like
# http://kannel.machine:13013/cgi-bin/sendsms?username=tester&password=foobar…

group = sendsms-user
username = tester
password = foobar
#user-deny-ip = “”
#user-allow-ip = “”

#———————————————
# SERVICES
#
# These are ‘responses’ to sms PULL messages, i.e. messages arriving from
# handsets. The response is based on message content. Only one sms-service is
# applied, using the first one to match.

group = sms-service
keyword = nop
text = “You asked nothing and I did it!”

# There should be always a ‘default’ service. This service is used when no
# other ’sms-service’ is applied.

group = sms-service
keyword = default
text = “No service specified”

group = modems
id = sephone
name = “Sony Ericsson K320″ (type hp yang digunakan)
speed = 19200
init-string = “AT+CNMI=2,3,0,1,0″

semua tulisan yang bertanda merah biasanya berbeda tergantung dari merk hp dan kartu sim yang kita gunakan.

  • aktifkan kannel

[root@localhost gw]# ./bearerbox -v 1 smskannel.conf
2007-06-22 18:12:26 [7666] [0] INFO: Debug_lvl = 1, log_file = <none>, log_lvl = 0
2007-06-22 18:12:26 [7666] [0] WARNING: DLR: using default ‘internal’ for storage type.
2007-06-22 18:12:26 [7666] [0] INFO: DLR using storage type: internal
2007-06-22 18:12:26 [7666] [0] INFO: HTTP: Opening server at port 13000.
2007-06-22 18:12:26 [7666] [0] INFO: BOXC: ’smsbox-max-pending’ not set, using default (100).
2007-06-22 18:12:26 [7666] [0] INFO: Set SMS resend frequency to 60 seconds.
2007-06-22 18:12:26 [7666] [0] INFO: SMS resend retry set to unlimited.
2007-06-22 18:12:26 [7666] [0] INFO: DLR rerouting for smsc id <Cell> disabled.
2007-06-22 18:12:26 [7666] [0] INFO: AT2[Cell]: configuration shows modemtype <sephone>
2007-06-22 18:12:26 [7666] [0] INFO: AT2[Cell]: read modem definition for <Sony Ericsson K320>
2007-06-22 18:12:26 [7666] [0] INFO: —————————————-
2007-06-22 18:12:26 [7666] [0] INFO: Kannel bearerbox II version 1.4.1 starting
2007-06-22 18:12:26 [7666] [0] INFO: MAIN: Start-up done, entering mainloop
2007-06-22 18:12:26 [7666] [6] INFO: AT2[Cell]: opening device
2007-06-22 18:12:26 [7666] [6] INFO: AT2[Cell]: init device
2007-06-22 18:12:26 [7666] [6] INFO: AT2[Cell]: speed set to 19200
2007-06-22 18:12:28 [7666] [6] INFO: AT2[Cell]: AT SMSC successfully opened.

[root@localhost gw]# ./smsbox -v 1 smskannel.conf
2007-06-22 18:13:38 [7692] [0] INFO: Debug_lvl = 1, log_file = <none>, log_lvl = 0
2007-06-22 18:13:38 [7692] [0] INFO: Service global sender set as ‘13013′
2007-06-22 18:13:38 [7692] [0] INFO: HTTP: Opening server at port 13013.
2007-06-22 18:13:38 [7692] [0] INFO: Set up send sms service at port 13013
2007-06-22 18:13:38 [7692] [0] INFO: Connected to bearerbox at 127.0.0.1 port 13001.

Jika pesan yang muncul sama dengan di atas berarti kannel sudah aktif dan siap untuk dijadikan sms gateway.

Selanjutnya…… terserah anda :)

2 comments so far

  1. liezmaya on

    hehe gak mudeng :D

  2. 6a0n9 on

    yang mananya??? mau d bantu???? :)


Leave a reply