iwanpc: Keke,
below is your script which I've modified for PostgreSQL:
#!/bin/sh
if [ "$1" != "RECEIVED" ]; then exit; fi;
#DB parameter
SQL_HOST=localhost
SQL_USER=enterprisedb
SQL_PASSWORD=
SQL_DATABASE=MitraLunas
SQL_TABLE=smsmasuk
#Extract data dari SMS file
FROM=`formail -zx From: < $2`
TEXT=`formail -I "" <$2 | sed -e"1d"`
#sekedar dipastikan biar gak ada karakter aneh
TEXTSQL=$(echo "$TEXT" | sed 's/\\/\\\\/g' | sed "s/'/\\\'/g")
#Ini kunci SQL Query
sudo -u $SQL_USER psql -U $SQL_USER -d MitraLunas -c "INSERT INTO $SQL_TABLE (Jenis,Sent,Received,Sender,Subject,Isi) VALUES ('RECEIVED','$SENT','$DATE','$FROM','$SUBJECT','$TEXTSQL');"
----end of script----
after modify the script, i started sms3 service and execute the script. but i can't store the incoming sms into the table.
Something missing in my concept?
-Iwan P-
|
iwanpc: Thanks Keke for the sample:)
I'll try this code for my PostgreSQL. So the key is using eventhandler script.
-Iwan P-
|
iwanpc: E169 is working properly even using Linux. I'm using it on my notebook, running Mandriva 2009.1. I can use it for getting connected to the internet and send SMS using smstools3
|
iwanpc: Keke,
thanks for that MySQL example script. But could you help me by providing a simple code for storing an incoming SMS into PostgreSQL?
is it possible using postgresql with smstools3?
thanks alot
-Iwan P-
|