BREAKING NEWS
Lazada Indonesia

Tips and Trick

Category 6

Category 7

March 18, 2010

Build a SMS Gateway with Gammu and MySQL

I am very grateful, because I was 1 year trying to build SMS Gateway using gnokii, kannel, etc, but I always find problems, and now Alhamdullilah has successfully built using Gammu SMS Gateway that I feel quite stable. Mobile who has successfully I tried was the Nokia 3310 and Siemens C35i. Linux distro I use to build SMS Gateway is Trustix 3.0. Before installation, please do read and read info about Gammu in http://www.mwiacek.com/gsm/soft/gammu.html


1. Gammu.tar.gz

You can download at: http://www.mwiacek.com/zips/gsm/gammu/gammu.tar.gz
or # wget http://www.mwiacek.com/zips/gsm/gammu/gammu.tar.gz

2. Web Server (If you already have a webserver, just ignore this, No. 2, if you have not yet had to first install apache, myslq, php)

3. Mobile Nokia 3310 or Siemens C35i, to support other mobile phone please read again http://www.mwiacek.com/gsm/soft/gammu.html
Gammu support with various brands of mobile kok see this:
Gammu currently supports:
majority of Nokia phones from Nokia DCT3 generation with the operating system - for example Nokia 3210, 3310, 3315, 3410, 5110, 5130, 6110, 6130, 6150, 6210, 7110, 8210
majority of Nokia phones from DCT4 generation with Nokia operating system - for example Nokia 3100, 3510, 3510i, 6220, 6230, 6310, 6310i, 6510, 6610, 7210, 8310
many AT devices - for example many Siemens, Sony Ericsson, Motorola, LG models
LG from BE5/BF5/BH4 generation - for example 501, 511, 512
some functions with OBEX and Symbian devices
4. Serial cable for mobile phone
If you've successfully mendonwload gammu.tar.gz, please extract
# tar xvfz gammu.tar.gz
After you extract you will automatically find the folder-gammu 1:05:00, now go to the folder
# cd gammu-1:05:00
Before you install make it a habit to read the README, INSTALL, etc.
#. / configure
# make
Here you need to see if there are errors or not, if there is an error!, Means your mysql library is still incomplete, the error is usually encountered is "lssl" is not often found when doing "make" or mysql database does not support it with gammu.
(The solution was trying to reinstall it mysql or complete the required library)
# make shared
# make install
# make installshared
Next you need to upgrade "library"
# Vi / etc / ld.so.conf
Add link library by typing / usr / local / lib in ld.so.conf file, then do the upgrade library by typing
# / sbin / ldconfig
Note: If you do not find the error apa2 until this stage means you have successfully mengintall Gammu SMS Gateway
Now let's go back to the folder where you extract and copy gammu.tar.gz is available files in the folder / docs / example / config / there you will find 3 files with the names of fruit gammurc, mysql.sql, then file smsdrc smsdrc you gammurc and copy it to folder / etc
gammurc smsdrc # cp / etc /
Further search Edit this file:
[gammu]
port = / dev/ttyS0 # If you are using COM2 replace with ttyS1
# model = 6110 # model of his mobile phone you ignore it, because if problems arise frequently diaktifin
connection = fbus # If you use hp Nokia connection his "fbus" if you use hp Siemens replace "fbus" becomes "at19200"
# synchronizetime = yes
# logfile = gammulog
# logformat = textall
# use_locking = yes
# gammuloc = locfile
# startinfo = yes
# gammucoding = utf8
# teststable # rsslevel = usephonedb = yes
If you are still confused, in the file already exists gammurc instructions see the bottom of it.
If you are lazy to edit the file, you also get the file in www.posmetropadang.com / gammu / gammurc
Now make sure the data cable and your phone is connected to the COM1 port on your computer, then you live type
# gammu-identify
I hope you can see the output like the following:
Manufacturer: Motorola
Model: 3310 (NHM-5)
Firmware: 06.33 F (28-11-03)
Hardware: 1012
IMEI: 350835608671298
Original IMEI: 350835608671298
Manufactured: 0802
Product code: 0505201
Simlock 1: MCC + MNC 00101, opened, user, counter 0
Simlock 2: GID1 0000, opened, factory, counter 0
Simlock 3: GID2 0000, opened, factory, counter 0
Simlock 4: MSIN 0000000001, opened, factory, counter 0
MSID: 830d50880846870ebedd126096
MCU checksum: 9C79
DSP ROM: 6
If you already have a connection like above means gammu been able to recognize your mobile phone and we can move on to another step.
So now we live to make, how all incoming sms stored directly into the mysql database and can be displayed to the website using php scripts.
Okay go bro ... our job is almost done, maybe there is coffee or a cigarette can disruputt once hehe ...??
Now try smsdrc you open the file you have copied it to folder / etc were
# vi / etc / smsdrc
sections below let alone what it is
[smsd]
PIN = 1234
logfile = smsdlog
commtimeout = 1
sendtimeout = 10
find and edit the sections below according to your circumstances mysql
# --------- Smsd SETTINGS FOR MYSQL----------
user = root
password = password_mysql_anda
pc = localhost
database = nama_database
Note: In addition to the above I mentioned that you love please sign "#" because what we need here is only part of what I just mentioned above, in order to connect to its database mysql.
Now you go to the directory / docs / example / config / is a file 'mysql.sql', which is the table structure is used, you stay put in your MySQL database.
Create a database sms
# mysqladmin-u root-p create sms
Create a table of file gammu 'mysql.sql'
# mysql-u root-p

3 comments :

  1. You can also use an online SMS gateway... Just as easy and with worldwide coverage!

    ReplyDelete
  2. where is the "db driver"??have you really ever practice this??

    ReplyDelete

 
Copyright © 2013 Just Scribble Hand
JSH