hello there,

there is an error in you php code, just change this line:

            $stmt->bindParam(':message',$text);

into this:

            $stmt->bindParam(':text',$text);

then hopefully it works out for you :D if not, tell us more about it.

note you might also want to store more information about the SMS, such as time and the SMS center it came from ... etc.

best wishes.

Quoting bilal kamoto <bgk...@hotmail.com>:


hi users,
I've successfully managed to install kannel it is able to send as well as receive sms, i got the following script on the online it is supposed to update database fields, message and sender and then send a reply but i can only see the sender in the database the message does show...
here is the php code
<?php

define("DBHOST","localhost",true);

define("DBUSERNAME","root",true);

define("DBPASSWORD","bookert",true);

define("DBNAME","kannel",true);

$con=mysql_connect("localhost","root","bookert");

if(! $con)

{

     echo   die('Connection Failed'.mysql_error());

}




function insertSms($sender,$text)

{

    $con = 'mysql:dbname='.kannel.';host='.localhost;

    try {

            $cmd = new PDO($con,root,bookert);

$stmt = $cmd->prepare("INSERT INTO bilz (number,message) VALUES (:sender,:text)");

            $stmt->bindParam(':sender',$sender);

            $stmt->bindParam(':message',$text);

            $stmt->execute();

            $cmd = null;



                if($stmt->rowCount()>0)

                {

                    echo "Hello ".$text.". Thank you for your registration.";

                }

                else

                {

                    echo "Sorry an error has occured";

                }



            }

        catch (PDOException $e) {

            echo 'Connection failed: ' . $e->getMessage();

            }

}





insertSms($_GET['sender'],$_GET['text']);

?>

my sms-service group
get-url = "http://localhost/receivesms.php?sender=%p&amp; text=%a"

please help

Date: Tue, 22 May 2012 16:44:52 +0400
Subject: Re: kannel able to send but not receiving sms
From: spame...@gmail.com
To: bgk...@hotmail.com
CC: cornejo.alv...@gmail.com; users@kannel.org

Please don't spam the list with the same messages.

Thanks.

2012/5/22 bilal kamoto <bgk...@hotmail.com>


Thanks the bind error managed to sort it out, forwarding the sms to an application then to database is what I need to crack

From: users-boun...@kannel.org [mailto:users-boun...@kannel.org] On Behalf Of bilal kamoto

Sent: 19 May 2012 17:09
To: cornejo.alv...@gmail.com
Cc: users@kannel.org
Subject: RE: kannel able to send but not receiving sms
i have installed gnome admin network to deal with the bind am able to see other applications running on it but i cant stop them really dont have a clue how..


another thing i want to be forwarding the messages from the kannel to mysql database and what is in the text field should be used to query information and it should automatically return the values to the initiator of sms.. please help


# HTTP administration is disabled by default. Make sure you set the
# password if you enable it.

group = core
admin-port = 80
admin-password = bar
admin-deny-ip = "*.*.*.*"
admin-allow-ip = "127.0.0.1;192.168.0.*"

smsbox-port = 84
#wapbox-port = 13004
wdp-interface-name = "*"
log-file = "/var/log/kannel/bearerbox.log"
access-log="/var/log/kannel/access.log"
box-deny-ip = "*.*.*.*"

box-allow-ip = "127.0.0.1;192.168.0.*"

group = wapbox
bearerbox-host = localhost
log-file = "/var/log/kannel/wapbox.log"

# My modem
group = smsc
smsc = at
smsc-id = Nokia 5800 XpressMusic

modemtype = Nokia
device = /dev/ttyUSB0
speed = 0
#pin = 2345
sim-buffering = true
#message-storage = MT

# My modem group
group = modems
id = Nokia
name = Nokia
#detect-string = NOKIA

#keepalive-cmd = "AT+CBC;+CSQ"
#init-string = "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
#init-string = "AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0"
#init-string = "AT+CMGL=0,1,2"

#init-string = "AT+CNMI=1,1,0,2,1;+CMEE=1"
init-string = "AT+CNMI=2,1,2,2,0;+CMEE=1"
#enable-mms = true
#sim-buffering = true

# fake smsc
group = smsbox-route
smsbox-id = bil
smsc-id = Nokia 5800 XpressMusic

#port = 10000
#connect-allow-ip = 127.0.0.1

#Send SMS
group = smsbox
smsbox-id = bil
bearerbox-host = localhost
sendsms-port = 13131
#receivesms-port = 13132
sendsms-chars = "0123456789 "

global-sender = +255659375093
access-log = "kannel.access"
log-file = "smsbox.log"
log-level = 0

#Receive SMS
group = sms-service
#keyword =
keyword-regex = .*
catch-all = yes

#get-url = "http://localhost/kannel/receivesms.php?sender=%p&amp; text=%b"
accept-x-kannel-headers = true

max-messages = 0

#Authentication
group = sendsms-user
username = jones
password = jones
Date: Mon, 14 May 2012 21:10:16 -0500
Subject: Re: kannel able to send but not receiving sms
From: cornejo.al...@gmail.com

To: bgk...@hotmail.com
CC: us...@vm1.kannel.org

Allways cc list. Others can benefiy from it


I have no experience with huawei modems. Seach the list for coments.

Bind error is because you have another instance of the offending box running. You can either use the http admin interface or use a init script to handle this. Check userguide for detail.


Regards

Alvaro

On Monday, May 14, 2012, bilal kamoto <bgk...@hotmail.com> wrote:
Hi
I've tried sim-buffering still doesn't work. Am thinking of changing the

modem to Huawei but am not sure of the model that will support commands to
receive sms in the kannel.
Another problem every time I re-run the the bearerbox it show address
already in use: bind system error do you have a permanent solution rather

than using < kill pid... to kill the processes

-----Original Message-----
From: Alvaro Cornejo [mailto:cornejo.alv...@gmail.com]

Sent: 11 May 2012 18:41
To: bilal kamoto
Cc: users@kannel.org
Subject: Re: kannel able to send but not receiving sms

Hi


If your modem does not support CNMI command --common in nokia phones--, it
is not possible to configure it to fwd messages to kannel and form there to
your app.

Try with sim-buffering=true in your modem config so kannel will search for

inc messages in the modem from time to time.

Regards

Alvaro


|---------------------------------------------------------------------------
--------------------------------------|

Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
celular y Nextel en el Perú, México y en mas de 180 paises. Use aplicaciones
2 vias via SMS y GPRS online
              Visitenos en www.perusms.NET www.smsglobal.com.mx y

www.pravcom.com


On Fri, May 11, 2012 at 8:01 AM, bilal kamoto <bgk...@hotmail.com> wrote:

Hi am using Nokia 5800 xpressmusic, I tried using Mincom to initialize
the modem with AT+CNM=? It gave me an error what should be my next
move

Please help




--
|-----------------------------------------------------------------------------------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier celular y Nextel

en el Perú, México y en mas de 180 paises. Use aplicaciones 2 vias via SMS y GPRS online Visitenos en www.perusms.NET www.smsglobal.com.mx y www.pravcom.com





Reply via email to