Below is a simple tested script that retrieves credit from your account.
create your database banque and create table using sql commands:

create database banque;
use banque;
create table client (id_clt int(12) primary key,
pwd_clt varchar(15),
credit_clt double);



Then populate your database.

Use below script for eventhanlder ( don't forget to configure smsd.conf )


#!/bin/sh
if [ "$1" = "RECEIVED" ]; then
FROM=`formail -zx From: < $2`
TEXT=`formail -I "" < $2`
ID=`echo $TEXT | awk ' { print $1}'`
PWD=`echo $TEXT | awk ' { print $2}'`
SQL_ARGS="-h localhost -u root -D banque -N -B -e"

credit=`mysql $SQL_ARGS "select credit_clt from client where id_clt=$ID and pwd_clt='$PWD';"`

sendsms $FROM "Your credit is: $credit DA"
fi



Send sms containing account id plus password separated by space, you will get credit on your mobile.

Good Luck!