Jumat, 20 September 2013

Install SMS Gammu and Kalkun in ClearOS-6.2

Install SMS Gammu and Kalkun in ClearOS-6.2 1 Year, 3 Months ago  
In this tutor I had install Gammu (sms gateway) + Kalkun (web sms app) on ClearOS-6.2.
Although this gammu SMS gateway applications, sometimes we need to broadcast an sms or make an application to send sms using a daemon on the operating system to reboot server...

Preparation Environment and hardware requirements:

- Hardware: Huawei E173 USB 3G (www.ebay.com/itm/Unlocked-Huawei-E173-HS...em-New-/120814994357)
- Sim card ofcourse

It takes some of the compiler package, Install the developers

yum groupinstall 'Development Tools'
yum install cmake

Installing and configuring Gammu
Installation of hardware, Before doing the configuration, first prepare a GSM modem to be used. In this case I use Huawei E173 USB 3G like above.
wget sourceforge.net/projects/gammu/files/gam.../gammu-1.31.0.tar.gz
tar -xzvf gammu-1.31.0.tar.gz
cd gammu-1.31.0
./configure
make
make install

Then test gammu:
Gammu
If no error, the test instasi the command:
If it had error will say can't find libGammu.so.7 and link like this:

ln -s /usr/local/lib64/libGammu.so /usr/lib64/libGammu.so.7
ln -s /usr/local/lib64/libgsmsd.so /usr/lib64/libgsmsd.so.7
and configure modem by command:
gammu-config

port: /dev/ttyUSB* (depen your usb modem attached port)
connection: at115200
model: auto
logfile:/var/log/gammu/smsdlog
synchronizetime: yes
logformat: textalldate

save and exit
and identify command:
gammu --identify
if it connected it's say your modem name connection...

Create mysql database:
mysql -uroot -p
create database sms;
\q
import data tab:
mysql -uroot -p sms </root/gammu-1.31.0/docs/sql/mysql.sql

Now change your gammu identify and mysql spec like this:
nano /etc/gammu-smsdrc

Code:

[gammu]
device = /dev/ttyUSB6
model = E173 (E173)
connection = at115200

[smsd]
service = mysql
PIN = 1234
logfile = /var/log/gammu/smsdlog
debuglevel = 1
#runonreceive = /some/script
commtimeout = 30
sendtimeout = 30
user = <user_database>
password = <password>
pc = localhost
database = sms



# Now install Kalkun
cd /var/www/virtual/xxx.xxxx.xxxx
wget nchc.dl.sourceforge.net/project/kalkun/k....5/kalkun_0.5.tar.gz
tar zxvf kalkun_0.5.tar.gz

and insert your mysql info:
nano application/config/database.php

$db['default']['hostname'] = "localhost";
// MySQL
$db['default']['username'] = "";
$db['default']['password'] = "";
$db['default']['database'] = "sms";
$db['default']['dbdriver'] = "mysql";

Open a web browser, then type http:// <your domain for sms>
Configure it with next-> next
When finished, delete or rename the install folder on it's onwe web root.
Change the settings of sms daemon to run the script as a text entry.
nano /etc/gammu-smsdrc
change runonreceive to your sms webroot folder like this:
runonreceive = /var/www/xxxxxx/daemon.sh

# Edit the daemon file and its daemon.php in /scripts folder
nano /var/www/xxxx/script/daemon.sh
and change to your onwe
DAEMON=/var/www/html/sms/scripts/daemon.php

nano /var/www/xxxx/script/daemon.php
$url = "<your domain for sms>";
# Stop and start your gammu-smsdrc:
killall -9 gammu-smsdrc
gammu-smsdrc --deamon
# View log and send recieved testing
tail -f /var/log/gammu/smsdlog

Goto your kalkun by: xxxxxxxxx login by user and password: 'kalkun' and try to send and recieved SMS from your gateway, look your log to more information.

Now I'm try to integrate to openerp sms client, if anyone know it please let me know.
 
http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,41/func,view/id,42626/

Tidak ada komentar: