Hi Drew

Seems you are on the right way...


1) In your sendsms call you need to add dlr-mask in order to tell
kannel what statuses you want kannel to report. Se doc for more info.

2) If you want to add a dynamic info (such as your own message ID) it
is better to add your dlr-url in the sendsms call instead of on the
send-user

This is an example of the url I use to call sendsms:

    $URL = 
"/cgi-bin/sendsms?username=username&password=password&from=$sms_from&to=$sms_to&text=$sms_msg&smsc=$smsc&coding=0&dlr-mask=$dlr_mask&dlr-url='/smsdir/dlr.php?type=%d&smsid=$smslog_id&uid=$uid&smsc=%i&sender_id=$sms_from&mclass=$sms_type'"

here is where you need to set dlr_mask to what you want. start with 31
(all avalilable status codes)

In your case it should be something like:

    $URL = 
\"/cgi-bin/sendsms?username=username&password=password&from=$sms_from&to=$sms_to&text=$sms_msg&smsc=$smsc&coding=0&dlr-mask=31&dlr-url='http://localhost/sms.php?phone=%p&text=%a&timestamp=%T&dlrv=%d&dlrr=%A";

In order to see your script response see below:


3) the script you set will never show you anything unless you sniff
your server ip traffic. the return to kannel call to your sms.php
(the echo'es) will be returned to kannel itself, not your browser or
anything else... try to store the info to a file in the server. Also,
you might set log-level = 0 to smsbox log and there you will see the
http debugging info.

Hope helps

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 Mon, Jan 12, 2009 at 5:08 PM, Drew Stockler <[email protected]> wrote:
> I am trying to receive confirmation that an sms message was sent to a phone
> via dlr. From spending hours reading the messages, this is currently what I
> have.
> the http request sent to kannel
>
> http://localhost:13004/cgi-bin/sendsms?username=*******&password=*****&to=4043078165&text=test&drl=1
>
> according to my dlr-url below, kannel should send a get request  to a script
> called sms.php
>
> sms.php is a simple testing script that  I would like to capture the
> information from  the url. However kannel seems not be to passing any
> information. After I send a message, I got to localhost/sms.php to see if
> the script captured anything. Does anyone know what I am doing wrong. Here
> is the script from sms.php
>
> <?
>
> $phone=$_GET['phone'];
> $text=$_GET['text'];
> $timestamp=$_GET['timestamp'];
> $dlrv=$_GET['dlrv'];
> $dlrr=$_GET['dlrr'];
> ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> </head>
> <html>
> <body>
> <? echo $phone; ?><br>
> <? echo $text; ?><br>
> <? echo $timestamp; ?><br>
> <? echo $dlrv; ?><br>
> <? echo $dlrr; ?><br>
> <? echo "test"; ?><br>
> </body>
> </html>
>
>
>
>
> Conf file
>
> group = core
> admin-port = 13000
> admin-password = bar
> admin-deny-ip = ""
> admin-allow-ip = "127.0.0.1"
> smsbox-port = 13003
> wdp-interface-name = "*"
> log-file = "/var/log/kannel/bearerbox.txt"
> log-level = 0
> access-log = "/var/log/kannel/kannel.access"
> box-deny-ip = "*.*.*.*"
> box-allow-ip = "127.0.0.1"
> dlr-storage = mysql
>
> group = sms-service
> keyword =
> keyword-regex = .*
> catch-all = yes
> max-messages = 0
> dlr-mask = 1
>
> group = sendsms-user
> username = remindme
> password = alerts
> max-messages = 10
> concatenation = true
> dlr-url =
> "http://localhost/sms.php?phone=%p&text=%a&timestamp=%T&dlrv=%d&dlrr=%A";
>
>

Reply via email to