Friday, May 27, 2011

SMS gateway In Fedora 13


Packages

gnokii-devel.i686 : Gnokii development files
gnokii-smsd.i686 : Gnokii SMS daemon
gnokii-smsd-mysql.i686 : MySQL support for Gnokii SMS daemon
gnokii-smsd-pgsql.i686 : PostgreSQL support for Gnokii SMS daemon
gnokii.i686 : Linux/Unix tool suite for various mobile phones
libopensync-plugin-gnokii.i686 : Gnokii plugin for libopensync
xgnokii.i686 : Graphical Linux/Unix tool suite for various mobile phones

#######################################
Install the packages with the yum command

#################################


After Installing create a file .gnokiirc

vi /root/.gnokiirc
[global]

port = /dev/ttyACM0
# With Linux-IrDA you will want to use
# model = symbian
model = AT
initlength = default
connection = serial
use_locking = no

serial_baudrate = 19200
smsc_timeout = 10

[xgnokii]
allow_breakage = 0

[gnokiid]
bindir = /usr/sbin/

# Handy for use for $VAR substitutions in your chat(8) script.
[connect_script]
TELEPHONE = 12345678
[disconnect_script]



[logging]

# where to log the debug output (on: stderr, off: /dev/null)
debug = off

# where to log the rlp debug output (on: stderr, off: /dev/null)
rlpdebug = off

# where to log X debug output (on: stderr, off: /dev/null)
xdebug = off

:wq!

Save it ... this configuration will work with most Nokia handsets and it is been tested with Nokia X-05 and Micromax Q3+ ... Successfully working in both...

#############################

After saving the file execute the command 'gnokii --identify' and make sure system is identifies the device .
 you will get the similar output like this;
GNOKII Version 0.6.28
IMEI         : **********
Manufacturer : Nokia
Model        : Nokia X5-01
Product name : Nokia X5-01
Revision     : V ICPR82_10w18.7.7
###################################
To send a test message

echo “Test” | /usr/bin/gnokii --sendsms +91phonenumber -r

#######################################
Now gnokii With Mysql ...

[root@nix ~]# rpm -ql gnokii-smsd-mysql-0.6.28-1.fc12.i686
/usr/lib/smsd/libsmsd_mysql.so
/usr/share/doc/gnokii-smsd-mysql-0.6.28
/usr/share/doc/gnokii-smsd-mysql-0.6.28/sms.tables.mysql.sql

Create tha database and table with the following

[root@nix ~]#mysql -p < /usr/share/doc/gnokii-smsd-mysql-0.6.28/sms.tables.mysql.sql

######

To send a message from mysq
Logind to mysql
mysql -p
use smsd;
insert into outbox (number,text) values ('+91phone_number','Hi');
\q
***********************************************************************************
***********************************************************************************

No comments: